mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-05-14 06:00:02 +08:00
linker_set.h: Add alignof implementation for when not C11 or C++11
The default implementation was completely broken. Use the GCC specific __alignof__ if compiling for C99 or C++03. If not C++11, C11, or GCC, then it is an error.
This commit is contained in:
parent
c41318075e
commit
c5e81a2169
@ -73,8 +73,10 @@
|
|||||||
#define RTEMS_BSD_ALIGNOF( _type_name ) alignof( _type_name )
|
#define RTEMS_BSD_ALIGNOF( _type_name ) alignof( _type_name )
|
||||||
#elif __STDC_VERSION__ >= 201112L
|
#elif __STDC_VERSION__ >= 201112L
|
||||||
#define RTEMS_BSD_ALIGNOF( _type_name ) _Alignof( _type_name )
|
#define RTEMS_BSD_ALIGNOF( _type_name ) _Alignof( _type_name )
|
||||||
|
#elif defined(__GNUC__)
|
||||||
|
#define RTEMS_BSD_ALIGNOF( _type_name ) __alignof__( _type_name )
|
||||||
#else
|
#else
|
||||||
#define RTEMS_BSD_ALIGNOF( _type_name ) sizeof( _type_name )
|
#error "FIX ME! Implement RTEMS_BSD_ALIGNOF() for this environment"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define RTEMS_BSD_SET_ALIGN( type ) \
|
#define RTEMS_BSD_SET_ALIGN( type ) \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user