about summary refs log tree commit diff
path: root/src/misc/getopt.c
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2017-01-04 17:08:19 -0500
committerRich Felker <dalias@aerifal.cx>2017-01-04 17:08:19 -0500
commit150747b41e1ecefe82aa45d68c84b9e957b03e29 (patch)
tree90ac2d2b54a61343c926b02d1bce8f5ca84d2c3e /src/misc/getopt.c
parent769f53598e781ffc89191520f3f8a93cb58db91f (diff)
downloadmusl-150747b41e1ecefe82aa45d68c84b9e957b03e29.tar.gz
musl-150747b41e1ecefe82aa45d68c84b9e957b03e29.tar.xz
musl-150747b41e1ecefe82aa45d68c84b9e957b03e29.zip
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
Diffstat (limited to 'src/misc/getopt.c')
0 files changed, 0 insertions, 0 deletions