[En-Nut-Discussion] unix port & header files

Matthias Ringwald mringwal at inf.ethz.ch
Fri Mar 5 11:13:39 CET 2004


On 05.03.2004, at 09:38, Harald Kipp wrote:

> Matthias,
>
> At 19:29 04.03.2004 +0100, you wrote:
>> I guess for the application level wrapper,
>> there is no such common header file. :(
>>
>> But adding one include line in the application
>> should be fine.
>>
>> Or I could add a check to all nut/os files...
>
> One idea is, to
> #define NUTOS_APPLICATION
> before the first #include in your application
> code and include different header files
> in compiler.h

Is compiler.h included by all library files?
(implicitly, one would then assume it is also
included somehow by any application using
nut/os)

that would be fine. then most twiddling with
header files can go into one place.

> #ifdef NUTOS_APPLICATION
> #include for apps
> #else
> #include for os
> #endif
>
> However, I think it is a better idea to
> specify a different definition in the Nut/OS,
> code like
> #define NUTOS_LIBRARY
> So the application need not to deal with
> this stuff.

Again, you're right.

This can also be defined in the makefile for the library
but to set it in every nut lib file doens't hurt and
is simple (to understand, track, etc.. )

ok, let's see.
next week I'm snowboarding so there won't be any news... :)

CU,
Matthias




More information about the En-Nut-Discussion mailing list