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

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

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

MacPorts
#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
Reply | Threaded
Open this post in threaded view
|

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

MacPorts
#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:
Resolution:               |   Keywords:  haspatch
      Port:  gpsd, boost  |
--------------------------+----------------------
Changes (by michaelld):

 * Attachment "gpsd.tar.bz2" added.


--
Ticket URL: <https://trac.macports.org/ticket/56309>
MacPorts <https://www.macports.org/>
Ports system for macOS
Reply | Threaded
Open this post in threaded view
|

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

MacPorts
In reply to this post by MacPorts
#56309: gpsd: enhance to avoid conflict with mach policy_t type via forthcoming
Boost 1.67.0
--------------------------+------------------------
  Reporter:  michaelld    |      Owner:  ryandesign
      Type:  defect       |     Status:  assigned
  Priority:  Normal       |  Milestone:
 Component:  ports        |    Version:
Resolution:               |   Keywords:  haspatch
      Port:  gpsd, boost  |
--------------------------+------------------------
Changes (by michaelld):

 * owner:  (none) => ryandesign
 * status:  new => assigned


Comment:

 Please note that this issue is really just with any OS using the Mach
 kernel, so it likely doesn't impact Linux. That said, I think it's wise to
 fix such type names to be unique for the project, and not something that
 could easily conflict with type names outside the project.

--
Ticket URL: <https://trac.macports.org/ticket/56309#comment:1>
MacPorts <https://www.macports.org/>
Ports system for macOS
Reply | Threaded
Open this post in threaded view
|

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

MacPorts
In reply to this post by MacPorts
#56309: gpsd: enhance to avoid conflict with mach policy_t type via forthcoming
Boost 1.67.0
--------------------------+------------------------
  Reporter:  michaelld    |      Owner:  ryandesign
      Type:  defect       |     Status:  assigned
  Priority:  Normal       |  Milestone:
 Component:  ports        |    Version:
Resolution:               |   Keywords:  haspatch
      Port:  gpsd, boost  |
--------------------------+------------------------

Comment (by michaelld):

 https://savannah.nongnu.org/bugs/index.php?53671

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