[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Minios-devel] [UNIKRAFT/NEWLIB PATCH] Fix __rtems__ usage in glue code headers
In order to use __rtems__ one has to define it in all affected headers. Besides 'sys/stat.h', we also identified 'time.h'. Moreover, we define __rtems__ only if it was not previously defined. Signed-off-by: Costin Lupu <costin.lupu@xxxxxxxxx> --- include/sys/stat.h | 12 +++++++++--- include/time.h | 13 +++++++++++++ 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/include/sys/stat.h b/include/sys/stat.h index c87a29b..f70f698 100644 --- a/include/sys/stat.h +++ b/include/sys/stat.h @@ -1,13 +1,19 @@ #ifndef _NEWLIB_GLUE_SYS_STAT_H_ #define _NEWLIB_GLUE_SYS_STAT_H_ -#ifdef __rtems__ -#error "Unexpected definition of __rtems__. Please revisit this header wrapper." +/* define __rtems__ only if not previously defined */ +#ifndef __rtems__ +#define __undef_rtems__ +#define __rtems__ #endif -#define __rtems__ #include_next <sys/stat.h> + +/* cleanup __rtems__ */ +#ifdef __undef_rtems__ #undef __rtems__ +#undef __undef_rtems__ +#endif #define UTIME_NOW 0x3fffffff #define UTIME_OMIT 0x3ffffffe diff --git a/include/time.h b/include/time.h index e8201a0..52ca5e0 100644 --- a/include/time.h +++ b/include/time.h @@ -41,6 +41,19 @@ * such as nanosleep */ #define _POSIX_TIMERS 1 + +/* define __rtems__ only if not previously defined */ +#ifndef __rtems__ +#define __undef_rtems__ +#define __rtems__ +#endif + #include_next <time.h> +/* cleanup __rtems__ */ +#ifdef __undef_rtems__ +#undef __rtems__ +#undef __undef_rtems__ +#endif + #endif /* NEWLIBGLUE_TIME_H */ -- 2.11.0 _______________________________________________ Minios-devel mailing list Minios-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/minios-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |