[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [gpsd-dev] [PATCH 5/8] NITEMS definition cleanup.
From: |
Robert Norris |
Subject: |
Re: [gpsd-dev] [PATCH 5/8] NITEMS definition cleanup. |
Date: |
Thu, 21 Apr 2016 19:24:54 +0100 |
> Date: Wed, 20 Apr 2016 16:31:41 -0400
> From: address@hidden
> To: address@hidden
> CC: address@hidden; address@hidden
> Subject: Re: [gpsd-dev] [PATCH 5/8] NITEMS definition cleanup.
>
> Gary E. Miller <address@hidden>:
>>> However libgps.h gets used with libgpsd so one would get compiler
>>> redefinition warnings.
>>
>> How about solving it the right way? A single header file in common
>> with both sides, things things ony get defined once.
>>
>>> Perhaps creating a single version (e.g. in the new gpsd_definitons.h
>>> file or similar) would be better.
>>
>> Yup.
>>
>> As a rule, when you define something twice, they will eventually get out
>> of sync.
>
> I have a concern about this. It's OK to make new heders in the distribution;
> it's not OK for gps.h to have to include anything else, it complicates life
> for C client implementors too much.
>
> If you need shated definitionms, put them in gps.h. gpsd.h includes it,
> which is OK.
> --
> <a href="http://www.catb.org/~esr/">Eric S. Raymond</a>
No worries as gps.h will not need to include this new file.
These definitions are for the internals of libgps / libgpsd, thus they don't
need to be (or even shouldn't be) externally visible.
I'm now thinking of calling this new file "gpsd_common.h" as it could contain
types and function prototypes as well as definitions.
Rob.