1
0
mirror of git://git.musl-libc.org/musl synced 2024-12-30 19:02:48 +00:00
musl/arch
Rich Felker 150747b41e reduce impact of REG_* namespace pollution in x86[_64] signal.h
when _GNU_SOURCE is defined, which is always the case when compiling
c++ with gcc, these macros for the the indices in gregset_t are
exposed and likely to clash with applications. by using enum constants
rather than macros defined with integer literals, we can make the
clash slightly less likely to break software. the macros are still
defined in case anything checks for them with #ifdef, but they're
defined to expand to themselves so that non-file-scope (e.g.
namespaced) identifiers by the same names still work.

for the sake of avoiding mistakes, the changes were generated with sed
via the command:

sed -i -e 's/#define  *\(REG_[A-Z_0-9]\{1,\}\)  *\([0-9]\{1,\}\)'\
'/enum { \1 = \2 };\n#define \1 \1/' \
arch/i386/bits/signal.h arch/x86_64/bits/signal.h arch/x32/bits/signal.h
2017-01-04 17:08:19 -05:00
..
aarch64 add pkey_{mprotect,alloc,free} syscalls from linux v4.9 2016-12-29 22:10:19 -05:00
arm add pkey_{mprotect,alloc,free} syscalls from linux v4.9 2016-12-29 22:10:19 -05:00
generic/bits remove legacy i386 fallback stdarg implementation and framework 2016-12-15 12:18:24 -05:00
i386 reduce impact of REG_* namespace pollution in x86[_64] signal.h 2017-01-04 17:08:19 -05:00
microblaze microblaze: add syscall numbers from linux v4.7 2016-08-30 15:58:28 -04:00
mips add pkey_{mprotect,alloc,free} syscalls from linux v4.9 2016-12-29 22:10:19 -05:00
mips64 add pkey_{mprotect,alloc,free} syscalls from linux v4.9 2016-12-29 22:10:19 -05:00
mipsn32 add pkey_{mprotect,alloc,free} syscalls from linux v4.9 2016-12-29 22:10:19 -05:00
or1k add pkey_{mprotect,alloc,free} syscalls from linux v4.9 2016-12-29 22:10:19 -05:00
powerpc add bits/hwcap.h and include it in sys/auxv.h 2016-10-20 01:28:25 -04:00
powerpc64 add bits/hwcap.h and include it in sys/auxv.h 2016-10-20 01:28:25 -04:00
s390x fix use of incomplete struct type in s390x user.h 2016-12-16 22:36:22 -05:00
sh add bits/hwcap.h and include it in sys/auxv.h 2016-10-20 01:28:25 -04:00
x32 reduce impact of REG_* namespace pollution in x86[_64] signal.h 2017-01-04 17:08:19 -05:00
x86_64 reduce impact of REG_* namespace pollution in x86[_64] signal.h 2017-01-04 17:08:19 -05:00