[MacPorts] #56309: gpsd: enhance to avoid conflict with mach policy_t type via forthcoming Boost 1.67.0

MacPorts noreply at macports.org
Mon Apr 16 20:03:38 UTC 2018


#56309: gpsd: enhance to avoid conflict with mach policy_t type via forthcoming
Boost 1.67.0
-----------------------+-------------------------
 Reporter:  michaelld  |      Owner:  (none)
     Type:  defect     |     Status:  new
 Priority:  Normal     |  Milestone:
Component:  ports      |    Version:
 Keywords:  haspatch   |       Port:  gpsd, boost
-----------------------+-------------------------
 gpsd's primary header <gps.h> defines "policy_t" (as a C struct).

 <mach/policy.h> defines it too ("typedef int policy_t"); this file is
 indirectly #include'd via <mach/mach_time.h>.

 Boost 1.67.0 changes time handling to include the header
 <mach/mach_time.h>.

 I'm attaching a tarball of a change to gpsd's files that globally does
 "policy_t" -> "gps_policy_t". This patch changes the API, but it doesn't
 seem to affect any port that depends on gpsd inside MacPorts, so at least
 internal to MacPorts this would be a safe change. The global change does
 actually make some sense for the project, as there are other API variables
 "gps_*". Getting this fix upstream would be ideal & I will create a ticket
 on GNU Savanna.

 This is the best fix I've come up with for this forthcoming issue (once
 Boost 1.67.0 is committed). I decided to go the issue route instead of a
 PR because I think this patch will be controversial & require some
 discussion.

 {{{
 :info:build In file included from
 /opt/local/include/boost/thread/shared_mutex.hpp:28:
 :info:build In file included from
 /opt/local/include/boost/thread/pthread/shared_mutex.hpp:14:
 :info:build In file included from
 /opt/local/include/boost/thread/mutex.hpp:16:
 :info:build In file included from
 /opt/local/include/boost/thread/pthread/mutex.hpp:24:
 :info:build In file included from
 /opt/local/include/boost/thread/detail/platform_time.hpp:30:
 :info:build In file included from /usr/include/mach/mach_time.h:32:
 :info:build In file included from /usr/include/mach/mach_types.h:91:
 :info:build In file included from /usr/include/mach/task_info.h:71:
 :info:build /usr/include/mach/policy.h:79:17: error: typedef redefinition
 with different types ('int' vs 'policy_t')
 :info:build typedef int                             policy_t;
 :info:build                                         ^
 :info:build /opt/local/include/gps.h:1905:8: note: previous definition is
 here
 :info:build struct policy_t {
 :info:build        ^
 }}}

-- 
Ticket URL: <https://trac.macports.org/ticket/56309>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list