]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Do not define __EXTENSIONS__ if already defined. [skip ci]
authorDenis Ovsienko <[email protected]>
Tue, 10 Aug 2021 09:18:19 +0000 (10:18 +0100)
committerDenis Ovsienko <[email protected]>
Wed, 29 Sep 2021 14:11:01 +0000 (15:11 +0100)
SunOS solaris11-amd64 5.11 11.4.0.15.0 i86pc i386 i86pc
clang version 6.0.0 (tags/RELEASE_600/final)

Every .c file that included netdissect-stdinc.h generated a warning:

In file included from ./netdissect-stdinc.h:42:
./ftmacros.h:48:11: warning: '__EXTENSIONS__' macro redefined
      [-Wmacro-redefined]
<built-in>:345:9: note: previous definition is here

(cherry picked from commit f139f17ba91ac60b36a0db424db01fbedf23a798)

ftmacros.h

index 3cd750568785d738bb241577c35d2385029f8557..7975463b3a6924738ef7e1ffa72370f11006ada6 100644 (file)
  * 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