mirror of
https://gitlab.freedesktop.org/libbsd/libbsd.git
synced 2025-01-23 18:42:30 +01:00
Use uintptr_t and size_t instead of __-prefixed types in <sys/cdefs.h>
The __-prefixed types cannot be assumed to be defined. Use the standard types instead. Closes: #6
This commit is contained in:
parent
edea268ce9
commit
1c3ff61699
@ -187,10 +187,10 @@
|
|||||||
# else
|
# else
|
||||||
# ifndef __cplusplus
|
# ifndef __cplusplus
|
||||||
# define __offsetof(type, field) \
|
# define __offsetof(type, field) \
|
||||||
((__size_t)(__uintptr_t)((const volatile void *)&((type *)0)->field))
|
((size_t)(uintptr_t)((const volatile void *)&((type *)0)->field))
|
||||||
# else
|
# else
|
||||||
# define __offsetof(type, field) \
|
# define __offsetof(type, field) \
|
||||||
(__offsetof__ (reinterpret_cast <__size_t> \
|
(__offsetof__ (reinterpret_cast <size_t> \
|
||||||
(&reinterpret_cast <const volatile char &> \
|
(&reinterpret_cast <const volatile char &> \
|
||||||
(static_cast<type *> (0)->field))))
|
(static_cast<type *> (0)->field))))
|
||||||
# endif
|
# endif
|
||||||
@ -243,15 +243,15 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef __DECONST
|
#ifndef __DECONST
|
||||||
#define __DECONST(type, var) ((type)(__uintptr_t)(const void *)(var))
|
#define __DECONST(type, var) ((type)(uintptr_t)(const void *)(var))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef __DEVOLATILE
|
#ifndef __DEVOLATILE
|
||||||
#define __DEVOLATILE(type, var) ((type)(__uintptr_t)(volatile void *)(var))
|
#define __DEVOLATILE(type, var) ((type)(uintptr_t)(volatile void *)(var))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef __DEQUALIFY
|
#ifndef __DEQUALIFY
|
||||||
#define __DEQUALIFY(type, var) ((type)(__uintptr_t)(const volatile void *)(var))
|
#define __DEQUALIFY(type, var) ((type)(uintptr_t)(const volatile void *)(var))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user