Move offsetofend from defs.h to macros.h

* defs.h (offsetofend): Move ...
* macros.h: ... here.
This commit is contained in:
Дмитрий Левин 2017-07-26 10:28:25 +00:00
parent 78de224180
commit a300de56c1
2 changed files with 5 additions and 5 deletions

5
defs.h
View File

@ -71,11 +71,6 @@ const char *strerror(int);
extern char *stpcpy(char *dst, const char *src);
#endif
#ifndef offsetofend
# define offsetofend(type, member) \
(offsetof(type, member) + sizeof(((type *)NULL)->member))
#endif
/* macros */
#ifndef MAX
# define MAX(a, b) (((a) > (b)) ? (a) : (b))

View File

@ -35,4 +35,9 @@
#define STRINGIFY(...) #__VA_ARGS__
#define STRINGIFY_VAL(...) STRINGIFY(__VA_ARGS__)
#ifndef offsetofend
# define offsetofend(type_, member_) \
(offsetof(type_, member_) + sizeof(((type_ *)0)->member_))
#endif
#endif /* !STRACE_MACROS_H */