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

Re: [Minios-devel] [UNIKRAFT/NEWLIB PATCH v2] Fix __rtems__ usage in glue code headers



Hi Costin,

Patch looks good, thanks.

— Felipe

Reviewed-by: Felipe Huici <felipe.huici@xxxxxxxxx>

On 14.03.19, 10:41, "Minios-devel on behalf of Costin Lupu" 
<minios-devel-bounces@xxxxxxxxxxxxxxxxxxxx on behalf of costin.lupu@xxxxxxxxx> 
wrote:

    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 | 13 ++++++++++---
     include/time.h     | 14 ++++++++++++++
     2 files changed, 24 insertions(+), 3 deletions(-)
    
    diff --git a/include/sys/stat.h b/include/sys/stat.h
    index c87a29b..07a9fab 100644
    --- a/include/sys/stat.h
    +++ b/include/sys/stat.h
    @@ -1,13 +1,20 @@
     #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__
    +/* A definition only for this header */
    +#define __undef_rtems___NEWLIB_GLUE_SYS_STAT_H_
    +#define __rtems__
     #endif
     
    -#define __rtems__
     #include_next <sys/stat.h>
    +
    +/* cleanup __rtems__ */
    +#ifdef __undef_rtems___NEWLIB_GLUE_SYS_STAT_H_
     #undef __rtems__
    +#undef __undef_rtems___NEWLIB_GLUE_SYS_STAT_H_
    +#endif
     
     #define UTIME_NOW  0x3fffffff
     #define UTIME_OMIT 0x3ffffffe
    diff --git a/include/time.h b/include/time.h
    index e8201a0..b51b2dd 100644
    --- a/include/time.h
    +++ b/include/time.h
    @@ -41,6 +41,20 @@
      * such as nanosleep
      */
     #define _POSIX_TIMERS 1
    +
    +/* define __rtems__ only if not previously defined */
    +#ifndef __rtems__
    +/* A definition only for this header */
    +#define __undef_rtems__NEWLIBGLUE_TIME_H
    +#define __rtems__
    +#endif
    +
     #include_next <time.h>
     
    +/* cleanup __rtems__ */
    +#ifdef __undef_rtems__NEWLIBGLUE_TIME_H
    +#undef __rtems__
    +#undef __undef_rtems__NEWLIBGLUE_TIME_H
    +#endif
    +
     #endif /* NEWLIBGLUE_TIME_H */
    -- 
    2.11.0
    
    
    _______________________________________________
    Minios-devel mailing list
    Minios-devel@xxxxxxxxxxxxxxxxxxxx
    https://lists.xenproject.org/mailman/listinfo/minios-devel

_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.