Move offsetofend from defs.h to macros.h
* defs.h (offsetofend): Move ... * macros.h: ... here.
This commit is contained in:
parent
78de224180
commit
a300de56c1
5
defs.h
5
defs.h
@ -71,11 +71,6 @@ const char *strerror(int);
|
|||||||
extern char *stpcpy(char *dst, const char *src);
|
extern char *stpcpy(char *dst, const char *src);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef offsetofend
|
|
||||||
# define offsetofend(type, member) \
|
|
||||||
(offsetof(type, member) + sizeof(((type *)NULL)->member))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* macros */
|
/* macros */
|
||||||
#ifndef MAX
|
#ifndef MAX
|
||||||
# define MAX(a, b) (((a) > (b)) ? (a) : (b))
|
# define MAX(a, b) (((a) > (b)) ? (a) : (b))
|
||||||
|
5
macros.h
5
macros.h
@ -35,4 +35,9 @@
|
|||||||
#define STRINGIFY(...) #__VA_ARGS__
|
#define STRINGIFY(...) #__VA_ARGS__
|
||||||
#define STRINGIFY_VAL(...) 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 */
|
#endif /* !STRACE_MACROS_H */
|
||||||
|
Loading…
Reference in New Issue
Block a user