diff options
author | Philip Prindeville <philipp@redfish-solutions.com> | 2018-04-18 15:09:35 -0600 |
---|---|---|
committer | Azat Khuzhin <a3at.mail@gmail.com> | 2018-06-08 02:14:38 +0300 |
commit | 587e9f5828c4eb3c6e79e9eb29f174e4ae0c05bd (patch) | |
tree | 586c04a4f4ddda36f54c2b46d41e1941ca325103 /make-event-config.sed | |
parent | c57f5c34903b02c6e7378865f71a2b83a5befb96 (diff) | |
download | libevent-587e9f5828c4eb3c6e79e9eb29f174e4ae0c05bd.tar.gz |
config.h can't be prefixed unconditionally
The script make-event-config.sed was mangling all the symbols by
prefixing them with "EVENT__". The problem here is that some
symbols aren't for local consumption within libevent, but rather
influence other system header files (ex: __USE_FILE_OFFSET64 is
used by dozens of header files including <sys/sendfile.h>).
As a workaround, all symbols starting with a capital letter only
(with the exception of STDC_HEADERS which must also be left
untouched) will be mangled.
Future contributors will need to be aware of this distinction.
Diffstat (limited to 'make-event-config.sed')
-rw-r--r-- | make-event-config.sed | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/make-event-config.sed b/make-event-config.sed index e31018a2..3dc404b5 100644 --- a/make-event-config.sed +++ b/make-event-config.sed @@ -18,6 +18,10 @@ $a\ \ #endif /* event2/event-config.h */ -s/#\( *\)define /#\1define EVENT__/ -s/#\( *\)undef /#\1undef EVENT__/ -s/#\( *\)if\(n*\)def /#\1if\2def EVENT__/ +/#\( *\)undef STDC_HEADERS\>/b +/#\( *\)define STDC_HEADERS\>/b + +# Only rewrite symbols starting with capitals +s/#\( *\)define \([A-Z]\)/#\1define EVENT__\2/ +s/#\( *\)undef \([A-Z]\)/#\1undef EVENT__\2/ +s/#\( *\)if\(n*\)def \([A-Z]\)/#\1if\2def EVENT__\2/ |