diff options
-rw-r--r-- | include/psxtypes/compiler/__nt_compiler_gcc.h | 4 | ||||
-rw-r--r-- | include/psxtypes/compiler/__nt_compiler_msvc.h | 4 | ||||
-rw-r--r-- | include/psxtypes/compiler/__psx_compiler_gcc.h | 4 |
3 files changed, 12 insertions, 0 deletions
diff --git a/include/psxtypes/compiler/__nt_compiler_gcc.h b/include/psxtypes/compiler/__nt_compiler_gcc.h index df81c64..b6cb064 100644 --- a/include/psxtypes/compiler/__nt_compiler_gcc.h +++ b/include/psxtypes/compiler/__nt_compiler_gcc.h @@ -73,6 +73,10 @@ #endif +/* offsetof */ +#define __offsetof(st,member) __builtin_offsetof(st,member) + + /* named section support */ #define __attr_section__(s) __attribute__((section(s))) #define __attr_section_decl__(s) diff --git a/include/psxtypes/compiler/__nt_compiler_msvc.h b/include/psxtypes/compiler/__nt_compiler_msvc.h index c865706..57a348e 100644 --- a/include/psxtypes/compiler/__nt_compiler_msvc.h +++ b/include/psxtypes/compiler/__nt_compiler_msvc.h @@ -98,6 +98,10 @@ #endif +/* offsetof */ +#define __offsetof(st,member) ((size_t)((char *)&(((st *)0)->member) - (char *)0)) + + /* named section support */ #define __attr_section__(s) #define __attr_section_decl__(s) __declspec(allocate(s)) diff --git a/include/psxtypes/compiler/__psx_compiler_gcc.h b/include/psxtypes/compiler/__psx_compiler_gcc.h index ee205f3..b5c08b7 100644 --- a/include/psxtypes/compiler/__psx_compiler_gcc.h +++ b/include/psxtypes/compiler/__psx_compiler_gcc.h @@ -58,6 +58,10 @@ #define __attr_protected__ __attribute__ ((visibility("protected"))) +/* offsetof */ +#define __offsetof(st,member) __builtin_offsetof(st,member) + + /* named section support */ #define __attr_section__(s) __attribute__((section(s))) #define __attr_section_decl__(s) |