Explorar el Código

[build] Really use __builtin_offsetof() when available

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Arkadiusz Miskiewicz hace 14 años
padre
commit
719f2d793c
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. 2
    2
      src/include/stddef.h

+ 2
- 2
src/include/stddef.h Ver fichero

@@ -10,8 +10,8 @@ FILE_LICENCE ( GPL2_ONLY );
10 10
 #define NULL ((void *)0)
11 11
 
12 12
 #undef offsetof
13
-#ifdef __compiler_offsetof
14
-#define offsetof(TYPE,MEMBER) __compiler_offsetof(TYPE,MEMBER)
13
+#if ( defined ( __GNUC__ ) && ( __GNUC__ > 3 ) )
14
+#define offsetof(TYPE, MEMBER) __builtin_offsetof(TYPE, MEMBER)
15 15
 #else
16 16
 #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
17 17
 #endif

Loading…
Cancelar
Guardar