Re: Define __MYNEWT__ symbol for Mynewt build
Hi Chris, Indeed, now I see that you added this to newt tool ​recently - I was using newt 1.3.0 :-) I'm fine with MYNEWT=1 name. So in this case I'll just close my PR as it is not applicable now. Thanks! Andrzej On Fri, Feb 9, 2018 at 5:08 PM, Christopher Collinswrote: > Hi Andrzej, > > The newt tool already adds the `-DMYNEWT=1` compiler flag during builds. > Mynewt and newt are not part of the C implementation, so in my opinion > they should not introduce identifiers in the reserved namespace (leading > underscore). I know opinions differ on this point, and I could probably > be convinced otherwise :). > > Chris > > On Fri, Feb 09, 2018 at 04:03:24PM +0100, Andrzej Kaczmarek wrote: > > Hi all, > > > > I created a PR which modifies all compiler packages by adding > > -D__MYNEWT__=1 to compiler.flags.base, see here: > > https://github.com/apache/mynewt-core/pull/803 > > > > The reason for this is to have some common symbol which can be used to > > distinguish between building code for Mynewt or for some other platform - > > similar symbols are defined for other platforms. This will be especially > > useful for components which have separate repository, e.g. mynewt-nffs or > > upcoming mynewt-nimble which can be also ported to other platforms so may > > use different set of headers or some porting layer. > > > > Best regards, > > Andrzej >
Re: Define __MYNEWT__ symbol for Mynewt build
Hi Andrzej, The newt tool already adds the `-DMYNEWT=1` compiler flag during builds. Mynewt and newt are not part of the C implementation, so in my opinion they should not introduce identifiers in the reserved namespace (leading underscore). I know opinions differ on this point, and I could probably be convinced otherwise :). Chris On Fri, Feb 09, 2018 at 04:03:24PM +0100, Andrzej Kaczmarek wrote: > Hi all, > > I created a PR which modifies all compiler packages by adding > -D__MYNEWT__=1 to compiler.flags.base, see here: > https://github.com/apache/mynewt-core/pull/803 > > The reason for this is to have some common symbol which can be used to > distinguish between building code for Mynewt or for some other platform - > similar symbols are defined for other platforms. This will be especially > useful for components which have separate repository, e.g. mynewt-nffs or > upcoming mynewt-nimble which can be also ported to other platforms so may > use different set of headers or some porting layer. > > Best regards, > Andrzej
Define __MYNEWT__ symbol for Mynewt build
Hi all, I created a PR which modifies all compiler packages by adding -D__MYNEWT__=1 to compiler.flags.base, see here: https://github.com/apache/mynewt-core/pull/803 The reason for this is to have some common symbol which can be used to distinguish between building code for Mynewt or for some other platform - similar symbols are defined for other platforms. This will be especially useful for components which have separate repository, e.g. mynewt-nffs or upcoming mynewt-nimble which can be also ported to other platforms so may use different set of headers or some porting layer. Best regards, Andrzej