]> The Tcpdump Group git mirrors - libpcap/commitdiff
diag-control.h: define PCAP_DO_PRAGMA() iff we're going to use it.
authorGuy Harris <[email protected]>
Tue, 12 Jul 2022 09:30:52 +0000 (02:30 -0700)
committerGuy Harris <[email protected]>
Thu, 14 Jul 2022 05:17:52 +0000 (22:17 -0700)
Test for whether we're using Clang 2.8 or later or GCC 4.6 or later,
rather than testing for MSVC; that way, we define it for Microsoft's
clang-cl (which is Clang-based, so we want it defined, but it defines
_MSC_VER) and don't define it for compilers that aren't MSVC, Clang, or
GCC.

This should fix issue #1115.

(cherry picked from commit e985d6564ce124c9b85084623646bd0210f47d42)

diag-control.h

index 286243065a0b5e8ba2555a79bfe2471a25acc804..a4a6aa0757dc80d0ed5fc8ccdf904a1ee95398c2 100644 (file)
@@ -37,7 +37,7 @@
 
 #include "pcap/compiler-tests.h"
 
-#ifndef _MSC_VER
+#if PCAP_IS_AT_LEAST_CLANG_VERSION(2,8) || PCAP_IS_AT_LEAST_GNUC_VERSION(4,6)
   /*
    * Clang and GCC both support this way of putting pragmas into #defines.
    * We don't use it unless we have a compiler that supports it; the