X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/95e9f3471ab6c7fb5e3350eefb670689d1fd11a7..d2777156522f139a858bd6b5b51e364826bc95a7:/ftmacros.h diff --git a/ftmacros.h b/ftmacros.h index 3fafab80..7975463b 100644 --- a/ftmacros.h +++ b/ftmacros.h @@ -45,7 +45,12 @@ * namespace to the maximum extent possible"? */ #if defined(sun) || defined(__sun) - #define __EXTENSIONS__ + /* + * On Solaris Clang defines __EXTENSIONS__ automatically. + */ + #ifndef __EXTENSIONS__ + #define __EXTENSIONS__ + #endif /* * We also need to define _XPG4_2 in order to get @@ -105,9 +110,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