Tree @upstream/latest (Download .tar.gz)
- ..
- glthread
- m4
- unicase
- unictype
- unigbrk
- unilbrk
- uninorm
- unistr
- uniwidth
- _Noreturn.h
- alloca.c
- alloca.in.h
- allocator.c
- allocator.h
- anytostr.c
- areadlink.c
- areadlink.h
- arg-nonnull.h
- array-mergesort.h
- asnprintf.c
- asprintf.c
- basename-lgpl.c
- basename.c
- binary-io.c
- binary-io.h
- btowc.c
- byteswap.in.h
- c++defs.h
- c-asprintf.c
- c-ctype.c
- c-ctype.h
- c-snprintf.c
- c-snprintf.h
- c-strcase.h
- c-strcasecmp.c
- c-strcasestr.c
- c-strcasestr.h
- c-strncasecmp.c
- c-strtod.c
- c-strtod.h
- c-vasnprintf.c
- c-vasnprintf.h
- c-vasprintf.c
- c-vasprintf.h
- c-xasprintf.c
- c-xvasprintf.c
- c-xvasprintf.h
- canonicalize-lgpl.c
- careadlinkat.c
- careadlinkat.h
- cdefs.h
- clean-temp.c
- clean-temp.h
- cloexec.c
- cloexec.h
- close.c
- count-one-bits.c
- count-one-bits.h
- crc.c
- crc.h
- dirname-lgpl.c
- dirname.c
- dirname.h
- dosname.h
- dtoastr.c
- dup2.c
- errno.in.h
- error.c
- error.h
- exitfail.c
- exitfail.h
- fatal-signal.c
- fatal-signal.h
- fcntl.c
- fcntl.in.h
- fd-hook.c
- fd-hook.h
- filename.h
- flexmember.h
- float+.h
- float.c
- float.in.h
- floor.c
- fprintf.c
- fpucw.h
- frexp.c
- frexpl.c
- fseek.c
- fseeko.c
- fseterr.c
- fseterr.h
- fstat.c
- ftell.c
- ftello.c
- ftoastr.c
- ftoastr.h
- full-read.c
- full-read.h
- full-write.c
- full-write.h
- fwriteerror.c
- fwriteerror.h
- getdelim.c
- getdtablesize.c
- getline.c
- getopt-cdefs.in.h
- getopt-core.h
- getopt-ext.h
- getopt-pfx-core.h
- getopt-pfx-ext.h
- getopt.c
- getopt.in.h
- getopt1.c
- getopt_int.h
- getpass.c
- getpass.h
- getprogname.c
- getprogname.h
- gettext.h
- gettimeofday.c
- gl_anyhash_list1.h
- gl_anyhash_list2.h
- gl_anylinked_list1.h
- gl_anylinked_list2.h
- gl_linkedhash_list.c
- gl_linkedhash_list.h
- gl_list.c
- gl_list.h
- gl_xlist.c
- gl_xlist.h
- hard-locale.c
- hard-locale.h
- imaxtostr.c
- intprops.h
- inttostr.c
- inttostr.h
- isfinite.c
- isinf.c
- isnan.c
- isnand-nolibm.h
- isnand.c
- isnanf-nolibm.h
- isnanf.c
- isnanl-nolibm.h
- isnanl.c
- iswblank.c
- itold.c
- langinfo.in.h
- libc-config.h
- limits.in.h
- localcharset.c
- localcharset.h
- locale.in.h
- localeconv.c
- localtime-buffer.c
- localtime-buffer.h
- lseek.c
- lstat.c
- Makefile.am
- Makefile.in
- malloc.c
- malloca.c
- malloca.h
- math.c
- math.in.h
- mbchar.c
- mbchar.h
- mbiter.c
- mbiter.h
- mbrtowc.c
- mbsinit.c
- mbtowc-impl.h
- mbtowc.c
- md4.c
- md4.h
- memcasecmp.c
- memcasecmp.h
- memchr.c
- memchr.valgrind
- memchr2.c
- memchr2.h
- memchr2.valgrind
- mempcpy.c
- memrchr.c
- minmax.h
- mkdir.c
- mkdtemp.c
- mkstemp.c
- mktime-internal.h
- mktime.c
- msvc-inval.c
- msvc-inval.h
- msvc-nothrow.c
- msvc-nothrow.h
- nl_langinfo.c
- nstrftime.c
- offtostr.c
- open.c
- pathmax.h
- pipe2.c
- printf-args.c
- printf-args.h
- printf-frexp.c
- printf-frexp.h
- printf-frexpl.c
- printf-frexpl.h
- printf-parse.c
- printf-parse.h
- printf.c
- progname.c
- progname.h
- progreloc.c
- raise.c
- rawmemchr.c
- rawmemchr.valgrind
- read-file.c
- read-file.h
- read.c
- readlink.c
- realloc.c
- regcomp.c
- regex.c
- regex.h
- regex_internal.c
- regex_internal.h
- regexec.c
- relocatable.c
- relocatable.h
- relocwrapper.c
- rename.c
- rijndael-alg-fst.c
- rijndael-alg-fst.h
- rijndael-api-fst.c
- rijndael-api-fst.h
- rmdir.c
- round.c
- safe-read.c
- safe-read.h
- safe-write.c
- safe-write.h
- same-inode.h
- secure_getenv.c
- select.c
- setenv.c
- sig-handler.c
- sig-handler.h
- sigaction.c
- signal.in.h
- signbitd.c
- signbitf.c
- signbitl.c
- sigprocmask.c
- size_max.h
- snprintf.c
- sockets.c
- sockets.h
- sprintf.c
- stat-time.c
- stat-time.h
- stat-w32.c
- stat-w32.h
- stat.c
- stdalign.in.h
- stdarg.in.h
- stdbool.in.h
- stddef.in.h
- stdint.in.h
- stdio-impl.h
- stdio.in.h
- stdlib.in.h
- stpcpy.c
- str-two-way.h
- strcasecmp.c
- strcasestr.c
- strdup.c
- streq.h
- strerror-override.c
- strerror-override.h
- strerror.c
- strftime.h
- string.in.h
- strings.in.h
- stripslash.c
- strncasecmp.c
- strncat.c
- strndup.c
- strnlen.c
- strsep.c
- strtod.c
- strtok_r.c
- sys-limits.h
- sys_select.in.h
- sys_socket.c
- sys_socket.in.h
- sys_stat.in.h
- sys_time.in.h
- sys_types.in.h
- sys_uio.in.h
- tempname.c
- tempname.h
- termios.in.h
- time-internal.h
- time.in.h
- time_r.c
- time_rz.c
- timegm.c
- tmpdir.c
- tmpdir.h
- trunc.c
- tzset.c
- uinttostr.c
- umaxtostr.c
- unicase.in.h
- unictype.in.h
- unigbrk.in.h
- unilbrk.in.h
- uninorm.in.h
- unistd.c
- unistd.in.h
- unistr.in.h
- unitypes.in.h
- uniwidth.in.h
- unlocked-io.h
- unsetenv.c
- unused-parameter.h
- vasnprintf.c
- vasnprintf.h
- vasprintf.c
- verify.h
- version-etc-fsf.c
- version-etc.c
- version-etc.h
- vfprintf.c
- vprintf.c
- vsnprintf.c
- vsprintf.c
- w32sock.h
- warn-on-use.h
- wchar.in.h
- wcrtomb.c
- wctype-h.c
- wctype.in.h
- wcwidth.c
- write.c
- xalloc-die.c
- xalloc-oversized.h
- xalloc.h
- xasprintf.c
- xmalloc.c
- xmalloca.c
- xmalloca.h
- xmemdup0.c
- xmemdup0.h
- xreadlink.c
- xreadlink.h
- xsize.c
- xsize.h
- xstrndup.c
- xstrndup.h
- xvasprintf.c
- xvasprintf.h
stdalign.in.h @upstream/latest — raw · history · blame
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 | /* A substitute for ISO C11 <stdalign.h>. Copyright 2011-2018 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, see <https://www.gnu.org/licenses/>. */ /* Written by Paul Eggert and Bruno Haible. */ #ifndef _GL_STDALIGN_H #define _GL_STDALIGN_H /* ISO C11 <stdalign.h> for platforms that lack it. References: ISO C11 (latest free draft <http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf>) sections 6.5.3.4, 6.7.5, 7.15. C++11 (latest free draft <http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3242.pdf>) section 18.10. */ /* alignof (TYPE), also known as _Alignof (TYPE), yields the alignment requirement of a structure member (i.e., slot or field) that is of type TYPE, as an integer constant expression. This differs from GCC's __alignof__ operator, which can yield a better-performing alignment for an object of that type. For example, on x86 with GCC, __alignof__ (double) and __alignof__ (long long) are 8, whereas alignof (double) and alignof (long long) are 4 unless the option '-malign-double' is used. The result cannot be used as a value for an 'enum' constant, if you want to be portable to HP-UX 10.20 cc and AIX 3.2.5 xlc. Include <stddef.h> for offsetof. */ #include <stddef.h> /* FreeBSD 9.1 <sys/cdefs.h>, included by <stddef.h> and lots of other standard headers, defines conflicting implementations of _Alignas and _Alignof that are no better than ours; override them. */ #undef _Alignas #undef _Alignof /* GCC releases before GCC 4.9 had a bug in _Alignof. See GCC bug 52023 <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52023>. */ #if (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112 \ || (defined __GNUC__ && __GNUC__ < 4 + (__GNUC_MINOR__ < 9))) # ifdef __cplusplus # if 201103 <= __cplusplus # define _Alignof(type) alignof (type) # else template <class __t> struct __alignof_helper { char __a; __t __b; }; # define _Alignof(type) offsetof (__alignof_helper<type>, __b) # endif # else # define _Alignof(type) offsetof (struct { char __a; type __b; }, __b) # endif #endif #if ! (defined __cplusplus && 201103 <= __cplusplus) # define alignof _Alignof #endif #define __alignof_is_defined 1 /* alignas (A), also known as _Alignas (A), aligns a variable or type to the alignment A, where A is an integer constant expression. For example: int alignas (8) foo; struct s { int a; int alignas (8) bar; }; aligns the address of FOO and the offset of BAR to be multiples of 8. A should be a power of two that is at least the type's alignment and at most the implementation's alignment limit. This limit is 2**28 on typical GNUish hosts, and 2**13 on MSVC. To be portable to MSVC through at least version 10.0, A should be an integer constant, as MSVC does not support expressions such as 1 << 3. To be portable to Sun C 5.11, do not align auto variables to anything stricter than their default alignment. The following C11 requirements are not supported here: - If A is zero, alignas has no effect. - alignas can be used multiple times; the strictest one wins. - alignas (TYPE) is equivalent to alignas (alignof (TYPE)). */ #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__) \ || (__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)) # endif #endif #if ((defined _Alignas && ! (defined __cplusplus && 201103 <= __cplusplus)) \ || (defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__)) # define alignas _Alignas #endif #if defined alignas || (defined __cplusplus && 201103 <= __cplusplus) # define __alignas_is_defined 1 #endif #endif /* _GL_STDALIGN_H */ |