diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2021-03-04 00:47:19 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2021-03-04 00:49:59 -0800 |
commit | 3c55969da66ccb9e6c0d045261a246254ca4494c (patch) | |
tree | 7429d8bd346ca40e47c065e708398d0162ef0fce /lib/stdalign.in.h | |
parent | 7c748055361ce5e9400d4dd460df0b84c735eff4 (diff) | |
download | gnulib-3c55969da66ccb9e6c0d045261a246254ca4494c.tar.gz |
stdalign: port to tcc + glibc
* lib/stdalign.in.h (_Alignas): Do not define using __attribute__
if __attribute__ is defined as a macro, as __attribute__ surely a
no-op in that case and this is an area where __attribute__ cannot
simply be ignored.
* m4/stdalign.m4 (gl_STDALIGN_H): Include <stdint.h> so that
it #defines __attribute__(x) to nothing on glibc-based systems
when non-GNU-C-compatible compilers are used.
This exposes a bug in Tiny C Compiler 0.9.27’s implementation
of _Alignas on glibc platforms.
Diffstat (limited to 'lib/stdalign.in.h')
-rw-r--r-- | lib/stdalign.in.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/stdalign.in.h b/lib/stdalign.in.h index e7a7402ee8..52a4a7b6e7 100644 --- a/lib/stdalign.in.h +++ b/lib/stdalign.in.h @@ -104,12 +104,13 @@ #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112 # if defined __cplusplus && 201103 <= __cplusplus # define _Alignas(a) alignas (a) -# elif ((defined __APPLE__ && defined __MACH__ \ - ? 4 < __GNUC__ + (1 <= __GNUC_MINOR__) \ - : __GNUC__ && !defined __ibmxl__) \ - || (4 <= __clang_major__) \ - || (__ia64 && (61200 <= __HP_cc || 61200 <= __HP_aCC)) \ - || __ICC || 0x590 <= __SUNPRO_C || 0x0600 <= __xlC__) +# elif (!defined __attribute__ \ + && ((defined __APPLE__ && defined __MACH__ \ + ? 4 < __GNUC__ + (1 <= __GNUC_MINOR__) \ + : __GNUC__ && !defined __ibmxl__) \ + || (4 <= __clang_major__) \ + || (__ia64 && (61200 <= __HP_cc || 61200 <= __HP_aCC)) \ + || __ICC || 0x590 <= __SUNPRO_C || 0x0600 <= __xlC__)) # define _Alignas(a) __attribute__ ((__aligned__ (a))) # elif 1300 <= _MSC_VER # define _Alignas(a) __declspec (align (a)) |