]> The Tcpdump Group git mirrors - libpcap/commitdiff
HAVE_SNPRINTF is defined only for versions of MSVC that have provided snprintf(). 501/head
authorYang Luo <[email protected]>
Mon, 27 Jun 2016 06:52:30 +0000 (23:52 -0700)
committerYang Luo <[email protected]>
Mon, 27 Jun 2016 06:52:30 +0000 (23:52 -0700)
Win32/Prj/libpcap.vcxproj
Win32/Prj/libpcap.vcxproj.filters
pcap-stdinc.h

index 34cfea7b54abd0937e069e534ef328b534eac868..d899fc4d5f99a61a9e04d58b57d2e887b619f141 100644 (file)
@@ -61,7 +61,7 @@
       <SuppressStartupBanner>true</SuppressStartupBanner>
       <WarningLevel>Level3</WarningLevel>
       <AdditionalIncludeDirectories>../../;../../lbl/;../../bpf/;../include/;../../../../common;../../../../dag/include;../../../../dag/drv/windows;../../../Win32-Extensions;./;Win32-Extensions;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>NDEBUG;YY_NEVER_INTERACTIVE;yylval=pcap_lval;_USRDLL;BUILDING_PCAP;HAVE_STRERROR;__STDC__;INET6;_WINDOWS;HAVE_ADDRINFO;WIN32;_U_=;HAVE_SNPRINTF;HAVE_VSNPRINTF;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>NDEBUG;YY_NEVER_INTERACTIVE;yylval=pcap_lval;_USRDLL;BUILDING_PCAP;HAVE_STRERROR;__STDC__;INET6;_WINDOWS;HAVE_ADDRINFO;WIN32;_U_=;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <AssemblerListingLocation>.\Release\</AssemblerListingLocation>
       <PrecompiledHeaderOutputFile>.\Release\libpcap.pch</PrecompiledHeaderOutputFile>
       <ObjectFileName>.\Release\</ObjectFileName>
@@ -94,7 +94,7 @@
       <MinimalRebuild>true</MinimalRebuild>
       <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
       <AdditionalIncludeDirectories>../../;../../lbl/;../../bpf/;../include/;../../../../common;../../../../dag/include;../../../../dag/drv/windows;../../../Win32-Extensions;./;Win32-Extensions;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>_DEBUG;YY_NEVER_INTERACTIVE;yylval=pcap_lval;_USRDLL;BUILDING_PCAP;HAVE_STRERROR;__STDC__;INET6;_WINDOWS;HAVE_ADDRINFO;WIN32;_U_=;HAVE_SNPRINTF;HAVE_VSNPRINTF;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>_DEBUG;YY_NEVER_INTERACTIVE;yylval=pcap_lval;_USRDLL;BUILDING_PCAP;HAVE_STRERROR;__STDC__;INET6;_WINDOWS;HAVE_ADDRINFO;WIN32;_U_=;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <AssemblerListingLocation>.\Debug\</AssemblerListingLocation>
       <PrecompiledHeaderOutputFile>.\Debug\libpcap.pch</PrecompiledHeaderOutputFile>
       <ObjectFileName>.\Debug\</ObjectFileName>
     <ClCompile Include="..\..\gencode.c" />
     <ClCompile Include="..\..\grammar.c" />
     <ClCompile Include="..\..\inet.c" />
+    <ClCompile Include="..\..\missing\win_snprintf.c" />
     <ClCompile Include="..\..\nametoaddr.c" />
     <ClCompile Include="..\..\optimize.c" />
     <ClCompile Include="..\..\pcap-common.c" />
index a64ad71e6c97e7ce42a32caf67e1b6b47e057b75..2383d31ec38a2269fcb8194e5d70bfe469cd013f 100644 (file)
@@ -55,6 +55,7 @@
     <ClCompile Include="..\..\fad-helpers.c">
       <Filter>Source Files</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\missing\win_snprintf.c" />
   </ItemGroup>
   <ItemGroup>
     <Filter Include="Header Files">
index b890b647374e2e0e8aa6177cf4045e814c39c8e9..0896a6020f20275fd31578fe10878521509d4c75 100644 (file)
   /*
    * MSVC.
    */
+
+#if _MSC_VER >= 1900
+    /*
+     * VS 2015 or newer; we have snprintf() function.
+     */
+    #define HAVE_SNPRINTF
+  #endif
+
   #if _MSC_VER >= 1800
     /*
      * VS 2013 or newer; we have <inttypes.h>.