Ah ok, I didn't read the style guide - I just copied the style of the
existing files I checked (the HAL headers) seem to put #ifdef __cplusplus
before #includes. I had a further search and some files put it after, some
before.

I'll have a look at getting them after the #includes. Might be quite
difficult with my regex hack though... Maybe make a temporary exception and
then say all new files must follow the style guide?

On 11 September 2016 at 20:58, Peter Snyder <[email protected]> wrote:

> I think this is great too, but I don’t think it’s keeping to the mynewt
> coding standard. In particular I think the C++ wrappers are supposed to
> appear after other included files and before any file content. For sure
> this messes up your script (sorry) but it avoids any potential conflicts
> with the included headers. I’m fine being corrected on this (sure would be
> easier to automate this work :-).
>
> Here’s the relevant section from the coding standard <
> https://github.com/apache/incubator-mynewt-core/blob/
> master/CODING_STANDARDS.md>:
> Header files must contain the following structure:
>
> Apache License (see above)
> #ifdef aliasing, to prevent multiple includes
> #include directives for other required header files
> #ifdef __cplusplus wrappers to maintain C++ friendly APIs
> Contents of the header file
> - peter
>
>
> > On Sep 11, 2016, at 12:41 PM, Christopher Collins <[email protected]>
> wrote:
> >
> > On Sun, Sep 11, 2016 at 12:39:27PM -0700, Christopher Collins wrote:
> >> Look great to me, thanks!  I just have a question - the commit message
> >> indicates that two files were not modified:
> >>
> >>    libs/baselibc/src/baselibc_test/unittests.h
> >>    libs/shell/include/shell/shell_prompt.h
> >>
> >> Why did you exclude these files?
> >
> > Er... the commit message also explains why they were excluded [*].
> > Sorry :).
> >
> > [*] "Because the hack I used looks for normal #include guards for its
> place
> > to put the C++ ones, and those files don't have any."
>
>

Reply via email to