diff options
author | Michael Forney <mforney@mforney.org> | 2021-04-14 00:41:28 -0700 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2021-07-05 20:22:57 -0400 |
commit | a39e58bab602dc39cf263954c4484c8d12bf306c (patch) | |
tree | 9c73ff65690a01bb45ddcd4937a4fec3b42938e6 | |
parent | 9d5fdcc5db1b5246028dc871e5f0fb908dd64771 (diff) | |
download | e2fsprogs-a39e58bab602dc39cf263954c4484c8d12bf306c.tar.gz |
libext2fs: use offsetof() from stddef.h
offsetof is a standard C feature available from stddef.h, going
back all the way to ANSI C.
Signed-off-by: Michael Forney <mforney@mforney.org>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-rw-r--r-- | lib/ext2fs/compiler.h | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/lib/ext2fs/compiler.h b/lib/ext2fs/compiler.h index 03c35ab80..42faa61c3 100644 --- a/lib/ext2fs/compiler.h +++ b/lib/ext2fs/compiler.h @@ -1,18 +1,7 @@ #ifndef _EXT2FS_COMPILER_H #define _EXT2FS_COMPILER_H -#ifndef __has_builtin -#define __has_builtin(x) 0 -#endif - -#undef offsetof -#if __has_builtin(__builtin_offsetof) -#define offsetof(TYPE, MEMBER) __builtin_offsetof(TYPE, MEMBER) -#elif defined(__compiler_offsetof) -#define offsetof(TYPE,MEMBER) __compiler_offsetof(TYPE,MEMBER) -#else -#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) -#endif +#include <stddef.h> #ifdef __GNUC__ #define container_of(ptr, type, member) ({ \ |