diff --git a/src/importc.h b/src/importc.h index a15ceb8058..7156c11fb7 100644 --- a/src/importc.h +++ b/src/importc.h @@ -55,3 +55,13 @@ * Define it to do what other C compilers do. */ #define __builtin_offsetof(t,i) ((typeof(sizeof(0)))((char *)&((t *)0)->i - (char *)0)) + +/**************************** + * Define it to do what other C compilers do. + */ +#define _Alignof(type) __builtin_offsetof(struct { char c; type member; }, member) + +/**************************** + * clang's preprocessor generates __alignof instead + */ +#define __alignof _Alignof