diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-05-22 18:36:31 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-05-22 18:36:31 +0200 |
commit | 9adad0d1eae6e3d54042ab1e65f0b80a77562dc6 (patch) | |
tree | 05c6103288b622517410d64d20e04ae79ca24c3d /include/sal/types.h | |
parent | b5cb4935c268f12e63b61e035b455b0a59e67aa2 (diff) |
Avoid undef use of null ptr, use offsetof instead
Change-Id: I095f45b537690fe98bf385d99194db6319d7ac93
Diffstat (limited to 'include/sal/types.h')
-rw-r--r-- | include/sal/types.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/include/sal/types.h b/include/sal/types.h index 5a534b8e5177..c19673afa11f 100644 --- a/include/sal/types.h +++ b/include/sal/types.h @@ -21,8 +21,10 @@ #define INCLUDED_SAL_TYPES_H #include <sal/config.h> -#include <sal/macros.h> +#include <stddef.h> + +#include <sal/macros.h> #include <sal/typesizes.h> #ifdef __cplusplus @@ -337,7 +339,7 @@ typedef struct _sal_Sequence char elements[1]; } sal_Sequence; -#define SAL_SEQUENCE_HEADER_SIZE ((sal_Size)&((sal_Sequence *)0)->elements) +#define SAL_SEQUENCE_HEADER_SIZE ((sal_Size) offsetof(sal_Sequence,elements)) #if defined( SAL_W32) #pragma pack(pop) |