diff options
author | Guy Harris <gharris@sonic.net> | 2021-01-02 17:05:43 -0800 |
---|---|---|
committer | Guy Harris <gharris@sonic.net> | 2021-01-02 17:05:43 -0800 |
commit | 31a07ea881f1f982ca90808461493fdea1eea798 (patch) | |
tree | 246ff2111e51391e52e8be72371b43732915856f /ftmacros.h | |
parent | ee9955e4184702b966d95c8bef168459796e7edd (diff) |
Pick up redefinition protection from tcpdump.
In case _DEFAULT_SOURCE or _BSD_SOURCE have already been defined, don't
redefine them, as that will get warnings that may turn into errors.
Diffstat (limited to 'ftmacros.h')
-rw-r--r-- | ftmacros.h | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -105,9 +105,18 @@ * don't whine about _BSD_SOURCE being deprecated; we still have * to define _BSD_SOURCE to handle older versions of GNU libc that * don't support _DEFAULT_SOURCE. + * + * But, if it's already defined, don't define it, so that we don't + * get a warning of it being redefined if it's defined as, for + * example, 1. */ - #define _DEFAULT_SOURCE - #define _BSD_SOURCE + #ifndef _DEFAULT_SOURCE + #define _DEFAULT_SOURCE + #endif + /* Avoid redefining _BSD_SOURCE if it's already defined as for ex. 1 */ + #ifndef _BSD_SOURCE + #define _BSD_SOURCE + #endif #endif #endif |