From: Guy Harris Date: Tue, 12 Jul 2022 09:30:52 +0000 (-0700) Subject: diag-control.h: define PCAP_DO_PRAGMA() iff we're going to use it. X-Git-Tag: libpcap-1.10.2~107 X-Git-Url: https://git.tcpdump.org/libpcap/commitdiff_plain/41799b3d6340136e18ac6bd9593ff4b6143e12ef diag-control.h: define PCAP_DO_PRAGMA() iff we're going to use it. 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) --- diff --git a/diag-control.h b/diag-control.h index 28624306..a4a6aa07 100644 --- a/diag-control.h +++ b/diag-control.h @@ -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