glibc/include/setjmp.h

75 lines
2.2 KiB
C
Raw Permalink Normal View History

#ifndef _SETJMP_H
1995-02-18 02:27:10 +01:00
#include <setjmp/setjmp.h>
Update. 1998-08-09 09:40 Ulrich Drepper <drepper@cygnus.com> * nss/nss_files/files-XXX.c (internal_getent): In case of an read error do not trust errno value, set it to ENOENT. * db2/db_185.h: Move __ prototypes into include/* header. * dirent/dirent.h: Likewise. * elf/dlfcn.h: Likewise. * gmon/sys/gmon.h: Likewise. * grp/grp.h: Likewise. * intl/libintl.h: Likewise. * io/fcntl.h: Likewise. * io/sys/stat.h: Likewise. * io/sys/statfs.h: Likewise. * io/sys/statvfs.h: Likewise. * libio/stdio.h: Likewise. * login/utmp.h: Likewise. * misc/mntent.h: Likewise. * misc/search.h: Likewise. * misc/sys/file.h: Likewise. * misc/sys/ioctl.h: Likewise. * misc/sys/select.h: Likewise. * misc/sys/uio.h: Likewise. * misc/sys/ustat.h: Likewise. * posix/unistd.h: Likewise. * posix/sys/times.h: Likewise. * posix/sys/wait.h: Likewise. * pwd/pwd.h: Likewise. * resource/ulimit.h: Likewise. * resource/sys/resource.h: Likewise. * setjmp/setjmp.h: Likewise. * shadow/shadow.h: Likewise. * signal/signal.h: Likewise. * socket/sys/socket.h: Likewise. * stdlib/alloca.h: Likewise. * stdlib/stdlib.h: Likewise. * string/string.h: Likewise. * sysdeps/generic/sys/mman.h: Likewise. * sysdeps/unix/bsd/osf/sys/mman.h: Likewise. * sysdeps/unix/bsd/sun/sunos4/sys/mman.h: Likewise. * sysdeps/unix/bsd/ultrix4/sys/mman.h: Likewise. * sysdeps/unix/sysv/irix4/sys/mman.h: Likewise. * sysdeps/unix/sysv/linux/bits/sched.h: Likewise. * sysdeps/unix/sysv/linux/sys/mman.h: Likewise. * termios/termios.h: Likewise. * time/time.h: Likewise. * time/sys/time.h: Likewise. * wcsmbs/wchar.h: Likewise. * include/alloca.h: Add __ prototypes here. * include/db_185.h: Likewise. * include/dirent.h: Likewise. * include/dlfcn.h: Likewise. * include/fcntl.h: Likewise. * include/grp.h: Likewise. * include/libintl.h: Likewise. * include/mntent.h: Likewise. * include/pwd.h: Likewise. * include/sched.h: Likewise. * include/search.h: Likewise. * include/setjmp.h: Likewise. * include/shadow.h: Likewise. * include/signal.h: Likewise. * include/stdio.h: Likewise. * include/stdlib.h: Likewise. * include/string.h: Likewise. * include/termios.h: Likewise. * include/time.h: Likewise. * include/ulimit.h: Likewise. * include/unistd.h: Likewise. * include/utmp.h: Likewise. * include/wchar.h: Likewise. * include/sys/file.h: Likewise. * include/sys/gmon.h: Likewise. * include/sys/ioctl.h: Likewise. * include/sys/mman.h: Likewise. * include/sys/resource.h: Likewise. * include/sys/select.h: Likewise. * include/sys/socket.h: Likewise. * include/sys/stat.h: Likewise. * include/sys/statfs.h: Likewise. * include/sys/time.h: Likewise. * include/sys/times.h: Likewise. * include/sys/uio.h: Likewise. * include/sys/wait.h: Likewise. * Makeconfig (+includes): Search in $(..)include first. * io/fstat.c: Undefine __fstat. * io/lstat.c: Undefine __lstat. * wcsmbs/Versions: Add __mbrlen.
1998-08-09 19:39:48 +02:00
#ifndef _ISOMAC
Update. 1998-08-09 09:40 Ulrich Drepper <drepper@cygnus.com> * nss/nss_files/files-XXX.c (internal_getent): In case of an read error do not trust errno value, set it to ENOENT. * db2/db_185.h: Move __ prototypes into include/* header. * dirent/dirent.h: Likewise. * elf/dlfcn.h: Likewise. * gmon/sys/gmon.h: Likewise. * grp/grp.h: Likewise. * intl/libintl.h: Likewise. * io/fcntl.h: Likewise. * io/sys/stat.h: Likewise. * io/sys/statfs.h: Likewise. * io/sys/statvfs.h: Likewise. * libio/stdio.h: Likewise. * login/utmp.h: Likewise. * misc/mntent.h: Likewise. * misc/search.h: Likewise. * misc/sys/file.h: Likewise. * misc/sys/ioctl.h: Likewise. * misc/sys/select.h: Likewise. * misc/sys/uio.h: Likewise. * misc/sys/ustat.h: Likewise. * posix/unistd.h: Likewise. * posix/sys/times.h: Likewise. * posix/sys/wait.h: Likewise. * pwd/pwd.h: Likewise. * resource/ulimit.h: Likewise. * resource/sys/resource.h: Likewise. * setjmp/setjmp.h: Likewise. * shadow/shadow.h: Likewise. * signal/signal.h: Likewise. * socket/sys/socket.h: Likewise. * stdlib/alloca.h: Likewise. * stdlib/stdlib.h: Likewise. * string/string.h: Likewise. * sysdeps/generic/sys/mman.h: Likewise. * sysdeps/unix/bsd/osf/sys/mman.h: Likewise. * sysdeps/unix/bsd/sun/sunos4/sys/mman.h: Likewise. * sysdeps/unix/bsd/ultrix4/sys/mman.h: Likewise. * sysdeps/unix/sysv/irix4/sys/mman.h: Likewise. * sysdeps/unix/sysv/linux/bits/sched.h: Likewise. * sysdeps/unix/sysv/linux/sys/mman.h: Likewise. * termios/termios.h: Likewise. * time/time.h: Likewise. * time/sys/time.h: Likewise. * wcsmbs/wchar.h: Likewise. * include/alloca.h: Add __ prototypes here. * include/db_185.h: Likewise. * include/dirent.h: Likewise. * include/dlfcn.h: Likewise. * include/fcntl.h: Likewise. * include/grp.h: Likewise. * include/libintl.h: Likewise. * include/mntent.h: Likewise. * include/pwd.h: Likewise. * include/sched.h: Likewise. * include/search.h: Likewise. * include/setjmp.h: Likewise. * include/shadow.h: Likewise. * include/signal.h: Likewise. * include/stdio.h: Likewise. * include/stdlib.h: Likewise. * include/string.h: Likewise. * include/termios.h: Likewise. * include/time.h: Likewise. * include/ulimit.h: Likewise. * include/unistd.h: Likewise. * include/utmp.h: Likewise. * include/wchar.h: Likewise. * include/sys/file.h: Likewise. * include/sys/gmon.h: Likewise. * include/sys/ioctl.h: Likewise. * include/sys/mman.h: Likewise. * include/sys/resource.h: Likewise. * include/sys/select.h: Likewise. * include/sys/socket.h: Likewise. * include/sys/stat.h: Likewise. * include/sys/statfs.h: Likewise. * include/sys/time.h: Likewise. * include/sys/times.h: Likewise. * include/sys/uio.h: Likewise. * include/sys/wait.h: Likewise. * Makeconfig (+includes): Search in $(..)include first. * io/fstat.c: Undefine __fstat. * io/lstat.c: Undefine __lstat. * wcsmbs/Versions: Add __mbrlen.
1998-08-09 19:39:48 +02:00
/* Now define the internal interfaces. */
/* Internal machine-dependent function to restore context sans signal mask. */
extern void __longjmp (__jmp_buf __env, int __val)
__attribute__ ((__noreturn__)) attribute_hidden;
Update. 1998-08-09 09:40 Ulrich Drepper <drepper@cygnus.com> * nss/nss_files/files-XXX.c (internal_getent): In case of an read error do not trust errno value, set it to ENOENT. * db2/db_185.h: Move __ prototypes into include/* header. * dirent/dirent.h: Likewise. * elf/dlfcn.h: Likewise. * gmon/sys/gmon.h: Likewise. * grp/grp.h: Likewise. * intl/libintl.h: Likewise. * io/fcntl.h: Likewise. * io/sys/stat.h: Likewise. * io/sys/statfs.h: Likewise. * io/sys/statvfs.h: Likewise. * libio/stdio.h: Likewise. * login/utmp.h: Likewise. * misc/mntent.h: Likewise. * misc/search.h: Likewise. * misc/sys/file.h: Likewise. * misc/sys/ioctl.h: Likewise. * misc/sys/select.h: Likewise. * misc/sys/uio.h: Likewise. * misc/sys/ustat.h: Likewise. * posix/unistd.h: Likewise. * posix/sys/times.h: Likewise. * posix/sys/wait.h: Likewise. * pwd/pwd.h: Likewise. * resource/ulimit.h: Likewise. * resource/sys/resource.h: Likewise. * setjmp/setjmp.h: Likewise. * shadow/shadow.h: Likewise. * signal/signal.h: Likewise. * socket/sys/socket.h: Likewise. * stdlib/alloca.h: Likewise. * stdlib/stdlib.h: Likewise. * string/string.h: Likewise. * sysdeps/generic/sys/mman.h: Likewise. * sysdeps/unix/bsd/osf/sys/mman.h: Likewise. * sysdeps/unix/bsd/sun/sunos4/sys/mman.h: Likewise. * sysdeps/unix/bsd/ultrix4/sys/mman.h: Likewise. * sysdeps/unix/sysv/irix4/sys/mman.h: Likewise. * sysdeps/unix/sysv/linux/bits/sched.h: Likewise. * sysdeps/unix/sysv/linux/sys/mman.h: Likewise. * termios/termios.h: Likewise. * time/time.h: Likewise. * time/sys/time.h: Likewise. * wcsmbs/wchar.h: Likewise. * include/alloca.h: Add __ prototypes here. * include/db_185.h: Likewise. * include/dirent.h: Likewise. * include/dlfcn.h: Likewise. * include/fcntl.h: Likewise. * include/grp.h: Likewise. * include/libintl.h: Likewise. * include/mntent.h: Likewise. * include/pwd.h: Likewise. * include/sched.h: Likewise. * include/search.h: Likewise. * include/setjmp.h: Likewise. * include/shadow.h: Likewise. * include/signal.h: Likewise. * include/stdio.h: Likewise. * include/stdlib.h: Likewise. * include/string.h: Likewise. * include/termios.h: Likewise. * include/time.h: Likewise. * include/ulimit.h: Likewise. * include/unistd.h: Likewise. * include/utmp.h: Likewise. * include/wchar.h: Likewise. * include/sys/file.h: Likewise. * include/sys/gmon.h: Likewise. * include/sys/ioctl.h: Likewise. * include/sys/mman.h: Likewise. * include/sys/resource.h: Likewise. * include/sys/select.h: Likewise. * include/sys/socket.h: Likewise. * include/sys/stat.h: Likewise. * include/sys/statfs.h: Likewise. * include/sys/time.h: Likewise. * include/sys/times.h: Likewise. * include/sys/uio.h: Likewise. * include/sys/wait.h: Likewise. * Makeconfig (+includes): Search in $(..)include first. * io/fstat.c: Undefine __fstat. * io/lstat.c: Undefine __lstat. * wcsmbs/Versions: Add __mbrlen.
1998-08-09 19:39:48 +02:00
extern void ____longjmp_chk (__jmp_buf __env, int __val)
__attribute__ ((__noreturn__)) attribute_hidden;
Update. 1998-08-09 09:40 Ulrich Drepper <drepper@cygnus.com> * nss/nss_files/files-XXX.c (internal_getent): In case of an read error do not trust errno value, set it to ENOENT. * db2/db_185.h: Move __ prototypes into include/* header. * dirent/dirent.h: Likewise. * elf/dlfcn.h: Likewise. * gmon/sys/gmon.h: Likewise. * grp/grp.h: Likewise. * intl/libintl.h: Likewise. * io/fcntl.h: Likewise. * io/sys/stat.h: Likewise. * io/sys/statfs.h: Likewise. * io/sys/statvfs.h: Likewise. * libio/stdio.h: Likewise. * login/utmp.h: Likewise. * misc/mntent.h: Likewise. * misc/search.h: Likewise. * misc/sys/file.h: Likewise. * misc/sys/ioctl.h: Likewise. * misc/sys/select.h: Likewise. * misc/sys/uio.h: Likewise. * misc/sys/ustat.h: Likewise. * posix/unistd.h: Likewise. * posix/sys/times.h: Likewise. * posix/sys/wait.h: Likewise. * pwd/pwd.h: Likewise. * resource/ulimit.h: Likewise. * resource/sys/resource.h: Likewise. * setjmp/setjmp.h: Likewise. * shadow/shadow.h: Likewise. * signal/signal.h: Likewise. * socket/sys/socket.h: Likewise. * stdlib/alloca.h: Likewise. * stdlib/stdlib.h: Likewise. * string/string.h: Likewise. * sysdeps/generic/sys/mman.h: Likewise. * sysdeps/unix/bsd/osf/sys/mman.h: Likewise. * sysdeps/unix/bsd/sun/sunos4/sys/mman.h: Likewise. * sysdeps/unix/bsd/ultrix4/sys/mman.h: Likewise. * sysdeps/unix/sysv/irix4/sys/mman.h: Likewise. * sysdeps/unix/sysv/linux/bits/sched.h: Likewise. * sysdeps/unix/sysv/linux/sys/mman.h: Likewise. * termios/termios.h: Likewise. * time/time.h: Likewise. * time/sys/time.h: Likewise. * wcsmbs/wchar.h: Likewise. * include/alloca.h: Add __ prototypes here. * include/db_185.h: Likewise. * include/dirent.h: Likewise. * include/dlfcn.h: Likewise. * include/fcntl.h: Likewise. * include/grp.h: Likewise. * include/libintl.h: Likewise. * include/mntent.h: Likewise. * include/pwd.h: Likewise. * include/sched.h: Likewise. * include/search.h: Likewise. * include/setjmp.h: Likewise. * include/shadow.h: Likewise. * include/signal.h: Likewise. * include/stdio.h: Likewise. * include/stdlib.h: Likewise. * include/string.h: Likewise. * include/termios.h: Likewise. * include/time.h: Likewise. * include/ulimit.h: Likewise. * include/unistd.h: Likewise. * include/utmp.h: Likewise. * include/wchar.h: Likewise. * include/sys/file.h: Likewise. * include/sys/gmon.h: Likewise. * include/sys/ioctl.h: Likewise. * include/sys/mman.h: Likewise. * include/sys/resource.h: Likewise. * include/sys/select.h: Likewise. * include/sys/socket.h: Likewise. * include/sys/stat.h: Likewise. * include/sys/statfs.h: Likewise. * include/sys/time.h: Likewise. * include/sys/times.h: Likewise. * include/sys/uio.h: Likewise. * include/sys/wait.h: Likewise. * Makeconfig (+includes): Search in $(..)include first. * io/fstat.c: Undefine __fstat. * io/lstat.c: Undefine __lstat. * wcsmbs/Versions: Add __mbrlen.
1998-08-09 19:39:48 +02:00
/* Internal function to possibly save the current mask of blocked signals
in ENV, and always set the flag saying whether or not it was saved.
This is used by the machine-dependent definition of `__sigsetjmp'.
Always returns zero, for convenience. */
extern int __sigjmp_save (jmp_buf __env, int __savemask);
extern void _longjmp_unwind (jmp_buf env, int val);
2002-08-21 10:08:03 +02:00
extern void __libc_siglongjmp (sigjmp_buf env, int val)
__attribute__ ((noreturn));
2002-08-21 10:08:03 +02:00
extern void __libc_longjmp (sigjmp_buf env, int val)
__attribute__ ((noreturn));
2000-12-27 21:25:30 +01:00
libc_hidden_proto (_setjmp)
libc_hidden_proto (__sigsetjmp)
Introduce NO_RTLD_HIDDEN, make hurd use it instead of NO_HIDDEN On the Hurd, the rtld needs to see its own dumb versions of a few functions (defined in sysdeps/mach/hurd/dl-sysdep.c) overridden by libc's versions once loaded. rtld should thus not have hidden attribute for these. To achieve this, the Hurd port used to just define NO_HIDDEN, which disables it completely. For now, this changes that to disabling it for all rtld functions, for simplicity. See Roland's comment on https://sourceware.org/bugzilla/show_bug.cgi?id=15605#c5 The ld.so numbers remain at 8 .rel.plt 000000c8 00000c24 00000c24 00000c24 2**2 CONTENTS, ALLOC, LOAD, READONLY, DATA 9 .plt 000001a0 00000cf0 00000cf0 00000cf0 2**4 CONTENTS, ALLOC, LOAD, READONLY, CODE 10 .plt.got 00000010 00000e90 00000e90 00000e90 2**3 CONTENTS, ALLOC, LOAD, READONLY, CODE 18 .got.plt 00000070 0002d000 0002d000 0002c000 2**2 CONTENTS, ALLOC, LOAD, DATA which is about 3 times as much as on Linux. The libc.so numbers get divided by 3 (the remainings are mostly RPC stub calls) * include/libc-symbols.h [NO_RTLD_HIDDEN] (rtld_hidden_proto, rtld_hidden_tls_proto, rtld_hidden_def, rtld_hidden_weak, rtld_hidden_rtld_hidden_ver, data_def, rtld_hidden_data_weak, rtld_hidden_data_ver): Define to empty. * include/assert.h [IS_IN(rtld) && NO_RTLD_HIDDEN] (__assert_fail, __assert_perror_fail): Likewise. * include/dirent.h [IS_IN(rtld) && NO_RTLD_HIDDEN] (__rewinddir): Likewise. * include/libc-internal.h [IS_IN(rtld) && NO_RTLD_HIDDEN] (__profile_frequency): Likewise. * include/setjmp.h (__sigsetjmp): Likewise. * include/signal.h [IS_IN(rtld) && NO_RTLD_HIDDEN] (__sigaction, __libc_sigaction): Likewise. * include/stdlib.h [NO_RTLD_HIDDEN] (unsetenv, __strtoul_internal): Do not set hidden attribute. * include/string.h [IS_IN(rtld) && NO_RTLD_HIDDEN] (__stpcpy, __strdup, __strerror_t, __strsep_g, memchr, memcmp, memcpy, memmove, memset, rawmemchr, stpcpy, strchr, strcmp, strlen, strnlen, strsep): Likewise. * include/sys/stat.h [IS_IN(rtld) && NO_RTLD_HIDDEN] (__fxstat, __fxstat64, __lxstat, __lxstat64, __xstat, __xstat64, __fxstatat64): Likewise. * include/sys/utsname.h [IS_IN(rtld) && NO_RTLD_HIDDEN] (__uname): Likewise. * include/sysdeps/generic/_itoa.h [IS_IN(rtld) && NO_RTLD_HIDDEN] (_itoa_upper_digits, _itoa_lower_digits): Likewise. * sysdeps/mach/hurd/configure.ac (NO_HIDDEN): Do not set. (NO_RTLD_HIDDEN): Set. * sysdeps/mach/hurd/configure: Refresh. * config.h.in: Refresh.
2017-10-03 01:26:58 +02:00
# if IS_IN (rtld) && !defined NO_RTLD_HIDDEN
extern __typeof (__sigsetjmp) __sigsetjmp attribute_hidden;
# endif
Add jmp_buf-macros.h Verify that sizes, alignments and field offsets of jmp_buf as well as sigjmp_buf are unchanged regardless how struct __jmp_buf_tag is defined. Since jmp_buf is target specific, jmp_buf-macros.h is added for each Linux target. A new target must provides its own jmp_buf-macros.h. TODO: Hurd needs to provide a jmp_buf-macros.h. Tested with build-many-glibcs.py. * include/setjmp.h [!_ISOMAC]: Include <stddef.h> and <jmp_buf-macros.h>. [!_ISOMAC] (STR_HELPER): New. [!_ISOMAC] (STR): Likewise. [!_ISOMAC] (TEST_SIZE): Likewise. [!_ISOMAC] (TEST_ALIGN): Likewise. [!_ISOMAC] (TEST_OFFSET): Likewise. [!_ISOMAC] Add _Static_assert to check sizes, alignments and field offsets of jmp_buf as well as sigjmp_buf. * sysdeps/unix/sysv/linux/aarch64/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/alpha/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/arm/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/hppa/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/i386/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/ia64/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/m68k/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/microblaze/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/mips/mips32/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/mips/mips64/n32/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/mips/mips64/n64/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/nios2/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/sh/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/tile/tilepro/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/x86_64/64/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/x86_64/x32/jmp_buf-macros.h: Likewise.
2017-11-09 14:09:49 +01:00
2022-08-11 20:23:08 +02:00
#if ! defined __e2k__
Add jmp_buf-macros.h Verify that sizes, alignments and field offsets of jmp_buf as well as sigjmp_buf are unchanged regardless how struct __jmp_buf_tag is defined. Since jmp_buf is target specific, jmp_buf-macros.h is added for each Linux target. A new target must provides its own jmp_buf-macros.h. TODO: Hurd needs to provide a jmp_buf-macros.h. Tested with build-many-glibcs.py. * include/setjmp.h [!_ISOMAC]: Include <stddef.h> and <jmp_buf-macros.h>. [!_ISOMAC] (STR_HELPER): New. [!_ISOMAC] (STR): Likewise. [!_ISOMAC] (TEST_SIZE): Likewise. [!_ISOMAC] (TEST_ALIGN): Likewise. [!_ISOMAC] (TEST_OFFSET): Likewise. [!_ISOMAC] Add _Static_assert to check sizes, alignments and field offsets of jmp_buf as well as sigjmp_buf. * sysdeps/unix/sysv/linux/aarch64/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/alpha/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/arm/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/hppa/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/i386/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/ia64/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/m68k/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/microblaze/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/mips/mips32/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/mips/mips64/n32/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/mips/mips64/n64/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/nios2/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/sh/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/tile/tilepro/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/x86_64/64/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/x86_64/x32/jmp_buf-macros.h: Likewise.
2017-11-09 14:09:49 +01:00
/* Check jmp_buf sizes, alignments and offsets. */
# include <stddef.h>
# include <jmp_buf-macros.h>
# define STR_HELPER(x) #x
# define STR(x) STR_HELPER(x)
# define TEST_SIZE(type, size) \
_Static_assert (sizeof (type) == size, \
"size of " #type " != " \
STR (size))
# define TEST_ALIGN(type, align) \
_Static_assert (__alignof__ (type) == align , \
"align of " #type " != " \
STR (align))
# define TEST_OFFSET(type, member, offset) \
_Static_assert (offsetof (type, member) == offset, \
"offset of " #member " field of " #type " != " \
STR (offset))
/* Check if jmp_buf have the expected sizes. */
TEST_SIZE (jmp_buf, JMP_BUF_SIZE);
TEST_SIZE (sigjmp_buf, SIGJMP_BUF_SIZE);
/* Check if jmp_buf have the expected alignments. */
TEST_ALIGN (jmp_buf, JMP_BUF_ALIGN);
TEST_ALIGN (sigjmp_buf, SIGJMP_BUF_ALIGN);
/* Check if internal fields in jmp_buf have the expected offsets. */
TEST_OFFSET (struct __jmp_buf_tag, __mask_was_saved,
MASK_WAS_SAVED_OFFSET);
TEST_OFFSET (struct __jmp_buf_tag, __saved_mask,
SAVED_MASK_OFFSET);
2022-08-11 20:23:08 +02:00
#endif /* ! defined __e2k__ */
#endif
#endif