tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Having to define _STANDALONE to get standard <time.h>

On Wed, Apr 17, 2019 at 08:27:02PM +0200, wrote:
> In order to have only standard definitions in <time.h>, I have to 
> define not standard macro _STANDALONE due to inclusion of <sys/time.h>
> (that does not only contain declarations but definitions of functions?
> In a header?).

It only includes <sys/time.h> if _POSIX_C_SOURCE, _XOPEN_SOURCE or
_NETBSD_SOURCE is defined.

> Shouldn't it be the reverse, not:
> #if !defined(_STANDALONE)

No, the parts protected by that #ifdef should not be available in a standalone
environment (that is for example bootloaders).

You did not describe what exact problem you are hitting. Therere are various
standards in several versions that describe different things that <time.h>
should export - maybe one of the ifdefs is wrong, but it is not the 
_STANDALONE part directly.


Home | Main Index | Thread Index | Old Index