bugGPSD - Bugs: bug #53671, policy_t type conflicts on Mach...

 
 

bug #53671: policy_t type conflicts on Mach kernel

Submitter:  None
Submitted:  Mon 16 Apr 2018 08:14:01 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  garyemiller
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 26 Dec 2018 02:47:05 PM UTC, comment #2: 

Closing. User has not bothered to respond but this was a trivial fix.  If it didn't work we'll hear about it again, I'm sure.

Eric S. Raymond <esr>
Group administrator
Thu 26 Jul 2018 07:55:43 PM UTC, comment #1: 

Commit 25edf0e836200ee4f6cf86fa4456635ee210484f changes policy_t to gps_policy_t

Please test and confirm it fixes the issue.

Gary E. Miller <garyemiller>
Group administrator
Mon 16 Apr 2018 08:14:01 PM UTC, original submission:  

See also < https://trac.macports.org/ticket/56309 >.

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>.

Hence using Boost 1.67.0 for time handling along with GPSD on Mac OS X / macOS / Darwin / Mach will result in a build error such as:
{{{
In file included from /opt/local/include/boost/thread/shared_mutex.hpp:28:
In file included from /opt/local/include/boost/thread/pthread/shared_mutex.hpp:14:
In file included from /opt/local/include/boost/thread/mutex.hpp:16:
In file included from /opt/local/include/boost/thread/pthread/mutex.hpp:24:
In file included from /opt/local/include/boost/thread/detail/platform_time.hpp:30:
In file included from /usr/include/mach/mach_time.h:32:
In file included from /usr/include/mach/mach_types.h:91:
In file included from /usr/include/mach/task_info.h:71:
/usr/include/mach/policy.h:79:17: error: typedef redefinition with different types ('int' vs 'policy_t')
typedef int                             policy_t;
                                       ^
/opt/local/include/gps.h:1905:8: note: previous definition is here
struct policy_t {
      ^
}}}

The attached patch (-p0) does globally changes "policy_t" -> "gps_policy_t", which addresses the issue. It also changes the public API of "gps.h", but I think in a desirable way as there are already (among others) "gps_device_t" and "gps_data_t" being used by GPSD.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #43953:  patch-fix_policy_t.diff added by None (4KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by esr (Posted a comment)
  • -email is unavailable- added by garyemiller (Posted a comment)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-12-26 esr StatusNone Fixed
        Open/ClosedOpen Closed
    2018-07-26 garyemiller Assigned toNone garyemiller
    2018-04-16 None Attached File- Added patch-fix_policy_t.diff, #43953

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code