From f098a548228a5f7547d1d3a079fac42b89ed03f7 Mon Sep 17 00:00:00 2001 From: Andreas Schuh Date: Tue, 20 Nov 2012 14:48:22 +0000 Subject: [PATCH] Fix deprecation warnings of VC++ regarding strdup and unlink. Add solution files for VS 2010 and VS 2012. git-svn-id: https://gflags.googlecode.com/svn/trunk@80 6586e3c6-dcc4-952a-343f-ff74eb82781d --- gflags.sln => gflags-vs2003.sln | 4 +- gflags-vs2010.sln | 25 ++++ gflags-vs2012.sln | 25 ++++ src/windows/port.h | 11 +- ...t.vcproj => gflags_unittest-vs2003.vcproj} | 0 .../gflags_unittest-vs2010.vcxproj | 113 +++++++++++++++ .../gflags_unittest-vs2012.vcxproj | 116 +++++++++++++++ ...bgflags.vcproj => libgflags-vs2003.vcproj} | 0 vsprojects/libgflags/libgflags-vs2010.vcxproj | 129 +++++++++++++++++ vsprojects/libgflags/libgflags-vs2012.vcxproj | 132 ++++++++++++++++++ 10 files changed, 550 insertions(+), 5 deletions(-) rename gflags.sln => gflags-vs2003.sln (85%) mode change 100755 => 100644 create mode 100644 gflags-vs2010.sln create mode 100644 gflags-vs2012.sln rename vsprojects/gflags_unittest/{gflags_unittest.vcproj => gflags_unittest-vs2003.vcproj} (100%) create mode 100644 vsprojects/gflags_unittest/gflags_unittest-vs2010.vcxproj create mode 100644 vsprojects/gflags_unittest/gflags_unittest-vs2012.vcxproj rename vsprojects/libgflags/{libgflags.vcproj => libgflags-vs2003.vcproj} (100%) mode change 100755 => 100644 create mode 100644 vsprojects/libgflags/libgflags-vs2010.vcxproj create mode 100644 vsprojects/libgflags/libgflags-vs2012.vcxproj diff --git a/gflags.sln b/gflags-vs2003.sln old mode 100755 new mode 100644 similarity index 85% rename from gflags.sln rename to gflags-vs2003.sln index 2f6c057..ec25b09 --- a/gflags.sln +++ b/gflags-vs2003.sln @@ -1,9 +1,9 @@ Microsoft Visual Studio Solution File, Format Version 8.00 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libgflags", "vsprojects\libgflags\libgflags.vcproj", "{FB27FBDB-E6C0-4D00-A7F8-1EEEF1B48ABC}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libgflags", "vsprojects\libgflags\libgflags-vs2003.vcproj", "{FB27FBDB-E6C0-4D00-A7F8-1EEEF1B48ABC}" ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gflags_unittest", "vsprojects\gflags_unittest\gflags_unittest.vcproj", "{4B263748-5F0F-468C-8C5C-ED2682BB6BE3}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gflags_unittest", "vsprojects\gflags_unittest\gflags_unittest-vs2003.vcproj", "{4B263748-5F0F-468C-8C5C-ED2682BB6BE3}" ProjectSection(ProjectDependencies) = postProject {FB27FBDB-E6C0-4D00-A7F8-1EEEF1B48ABC} = {FB27FBDB-E6C0-4D00-A7F8-1EEEF1B48ABC} EndProjectSection diff --git a/gflags-vs2010.sln b/gflags-vs2010.sln new file mode 100644 index 0000000..5c34be4 --- /dev/null +++ b/gflags-vs2010.sln @@ -0,0 +1,25 @@ +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libgflags", "vsprojects\libgflags\libgflags-vs2010.vcxproj", "{FB27FBDB-E6C0-4D00-A7F8-1EEEF1B48ABC}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gflags_unittest", "vsprojects\gflags_unittest\gflags_unittest-vs2010.vcxproj", "{4B263748-5F0F-468C-8C5C-ED2682BB6BE3}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {FB27FBDB-E6C0-4D00-A7F8-1EEEF1B48ABC}.Debug|Win32.ActiveCfg = Debug|Win32 + {FB27FBDB-E6C0-4D00-A7F8-1EEEF1B48ABC}.Debug|Win32.Build.0 = Debug|Win32 + {FB27FBDB-E6C0-4D00-A7F8-1EEEF1B48ABC}.Release|Win32.ActiveCfg = Release|Win32 + {FB27FBDB-E6C0-4D00-A7F8-1EEEF1B48ABC}.Release|Win32.Build.0 = Release|Win32 + {4B263748-5F0F-468C-8C5C-ED2682BB6BE3}.Debug|Win32.ActiveCfg = Debug|Win32 + {4B263748-5F0F-468C-8C5C-ED2682BB6BE3}.Debug|Win32.Build.0 = Debug|Win32 + {4B263748-5F0F-468C-8C5C-ED2682BB6BE3}.Release|Win32.ActiveCfg = Release|Win32 + {4B263748-5F0F-468C-8C5C-ED2682BB6BE3}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/gflags-vs2012.sln b/gflags-vs2012.sln new file mode 100644 index 0000000..dea7012 --- /dev/null +++ b/gflags-vs2012.sln @@ -0,0 +1,25 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Express 2012 for Windows Desktop +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libgflags", "vsprojects\libgflags\libgflags-vs2012.vcxproj", "{FB27FBDB-E6C0-4D00-A7F8-1EEEF1B48ABC}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gflags_unittest", "vsprojects\gflags_unittest\gflags_unittest-vs2012.vcxproj", "{4B263748-5F0F-468C-8C5C-ED2682BB6BE3}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {FB27FBDB-E6C0-4D00-A7F8-1EEEF1B48ABC}.Debug|Win32.ActiveCfg = Debug|Win32 + {FB27FBDB-E6C0-4D00-A7F8-1EEEF1B48ABC}.Debug|Win32.Build.0 = Debug|Win32 + {FB27FBDB-E6C0-4D00-A7F8-1EEEF1B48ABC}.Release|Win32.ActiveCfg = Release|Win32 + {FB27FBDB-E6C0-4D00-A7F8-1EEEF1B48ABC}.Release|Win32.Build.0 = Release|Win32 + {4B263748-5F0F-468C-8C5C-ED2682BB6BE3}.Debug|Win32.ActiveCfg = Debug|Win32 + {4B263748-5F0F-468C-8C5C-ED2682BB6BE3}.Debug|Win32.Build.0 = Debug|Win32 + {4B263748-5F0F-468C-8C5C-ED2682BB6BE3}.Release|Win32.ActiveCfg = Release|Win32 + {4B263748-5F0F-468C-8C5C-ED2682BB6BE3}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/src/windows/port.h b/src/windows/port.h index eea4eb5..fbeccd7 100644 --- a/src/windows/port.h +++ b/src/windows/port.h @@ -48,9 +48,9 @@ #include #include /* for mkdir */ #include /* for _putenv, getenv */ -#include /* need this to override stdio's snprintf */ +#include /* need this to override stdio's snprintf, also defines _unlink used by unit tests */ #include /* util.h uses va_copy */ -#include /* for _stricmp */ +#include /* for _stricmp and _strdup */ /* We can't just use _vsnprintf and _snprintf as drop-in-replacements, * because they don't always NUL-terminate. :-( We also can't use the @@ -87,7 +87,12 @@ inline void setenv(const char* name, const char* value, int) { } } -#define strcasecmp _stricmp +#define strcasecmp _stricmp + +#if defined(_MSC_VER) && _MSC_VER >= 1400 +#define strdup _strdup +#define unlink _unlink +#endif #define PRId32 "d" #define PRIu32 "u" diff --git a/vsprojects/gflags_unittest/gflags_unittest.vcproj b/vsprojects/gflags_unittest/gflags_unittest-vs2003.vcproj similarity index 100% rename from vsprojects/gflags_unittest/gflags_unittest.vcproj rename to vsprojects/gflags_unittest/gflags_unittest-vs2003.vcproj diff --git a/vsprojects/gflags_unittest/gflags_unittest-vs2010.vcxproj b/vsprojects/gflags_unittest/gflags_unittest-vs2010.vcxproj new file mode 100644 index 0000000..77bd3f5 --- /dev/null +++ b/vsprojects/gflags_unittest/gflags_unittest-vs2010.vcxproj @@ -0,0 +1,113 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {4B263748-5F0F-468C-8C5C-ED2682BB6BE3} + Win32Proj + + + + Application + MultiByte + + + Application + MultiByte + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)$(Configuration)\ + $(Configuration)\ + true + $(SolutionDir)$(Configuration)\ + $(Configuration)\ + false + AllRules.ruleset + + + AllRules.ruleset + + + + + + Disabled + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + $(OutDir)gflags_unittest.exe + true + $(OutDir)gflags_unittest.pdb + Console + MachineX86 + + + + + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreaded + + + Level3 + ProgramDatabase + + + $(OutDir)gflags_unittest.exe + true + Console + true + true + MachineX86 + + + + + ..\..\src\windows; ..\..\src;%(AdditionalIncludeDirectories) + MultiThreadedDebugDLL + ..\..\src\windows; ..\..\src;%(AdditionalIncludeDirectories) + MultiThreadedDLL + + + + + + + + + + + + {fb27fbdb-e6c0-4d00-a7f8-1eeef1b48abc} + false + + + + + + \ No newline at end of file diff --git a/vsprojects/gflags_unittest/gflags_unittest-vs2012.vcxproj b/vsprojects/gflags_unittest/gflags_unittest-vs2012.vcxproj new file mode 100644 index 0000000..4b5049e --- /dev/null +++ b/vsprojects/gflags_unittest/gflags_unittest-vs2012.vcxproj @@ -0,0 +1,116 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {4B263748-5F0F-468C-8C5C-ED2682BB6BE3} + Win32Proj + gflags_unittest + + + + Application + MultiByte + v110 + + + Application + MultiByte + v110 + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)$(Configuration)\ + $(Configuration)\ + true + $(SolutionDir)$(Configuration)\ + $(Configuration)\ + false + AllRules.ruleset + + + AllRules.ruleset + + + + + + Disabled + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + $(OutDir)gflags_unittest.exe + true + $(OutDir)gflags_unittest.pdb + Console + MachineX86 + + + + + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreaded + + + Level3 + ProgramDatabase + + + $(OutDir)gflags_unittest.exe + true + Console + true + true + MachineX86 + + + + + ..\..\src\windows; ..\..\src;%(AdditionalIncludeDirectories) + MultiThreadedDebugDLL + ..\..\src\windows; ..\..\src;%(AdditionalIncludeDirectories) + MultiThreadedDLL + + + + + + + + + + + + {fb27fbdb-e6c0-4d00-a7f8-1eeef1b48abc} + false + + + + + + \ No newline at end of file diff --git a/vsprojects/libgflags/libgflags.vcproj b/vsprojects/libgflags/libgflags-vs2003.vcproj old mode 100755 new mode 100644 similarity index 100% rename from vsprojects/libgflags/libgflags.vcproj rename to vsprojects/libgflags/libgflags-vs2003.vcproj diff --git a/vsprojects/libgflags/libgflags-vs2010.vcxproj b/vsprojects/libgflags/libgflags-vs2010.vcxproj new file mode 100644 index 0000000..7b9d36c --- /dev/null +++ b/vsprojects/libgflags/libgflags-vs2010.vcxproj @@ -0,0 +1,129 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {FB27FBDB-E6C0-4D00-A7F8-1EEEF1B48ABC} + libgflags + Win32Proj + + + + DynamicLibrary + MultiByte + + + DynamicLibrary + MultiByte + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)$(Configuration)\ + $(Configuration)\ + true + $(SolutionDir)$(Configuration)\ + $(Configuration)\ + false + AllRules.ruleset + + + AllRules.ruleset + + + + + + Disabled + WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBGFLAGS_EXPORTS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + $(OutDir)libgflags-debug.dll + true + $(OutDir)libgflags-debug.pdb + Windows + $(OutDir)libgflags-debug.lib + MachineX86 + + + + + WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBGFLAGS_EXPORTS;%(PreprocessorDefinitions) + MultiThreaded + + + Level3 + ProgramDatabase + + + $(OutDir)libgflags.dll + true + Windows + true + true + $(OutDir)libgflags.lib + MachineX86 + + + + + ..\..\src\windows; ..\..\src;%(AdditionalIncludeDirectories) + MultiThreadedDebugDLL + ..\..\src\windows; ..\..\src;%(AdditionalIncludeDirectories) + MultiThreadedDLL + + + ..\..\src\windows; ..\..\src;%(AdditionalIncludeDirectories) + MultiThreadedDebugDLL + ..\..\src\windows; ..\..\src;%(AdditionalIncludeDirectories) + MultiThreadedDLL + + + ..\..\src\windows; ..\..\src;%(AdditionalIncludeDirectories) + MultiThreadedDebugDLL + ..\..\src\windows; ..\..\src;%(AdditionalIncludeDirectories) + MultiThreadedDLL + + + ..\..\src\windows; ..\..\src;%(AdditionalIncludeDirectories) + MultiThreadedDebugDLL + ..\..\src\windows; ..\..\src;%(AdditionalIncludeDirectories) + MultiThreadedDLL + + + + + + + + + + + + + + \ No newline at end of file diff --git a/vsprojects/libgflags/libgflags-vs2012.vcxproj b/vsprojects/libgflags/libgflags-vs2012.vcxproj new file mode 100644 index 0000000..a777bed --- /dev/null +++ b/vsprojects/libgflags/libgflags-vs2012.vcxproj @@ -0,0 +1,132 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {FB27FBDB-E6C0-4D00-A7F8-1EEEF1B48ABC} + libgflags + Win32Proj + libgflags + + + + DynamicLibrary + MultiByte + v110 + + + DynamicLibrary + MultiByte + v110 + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)$(Configuration)\ + $(Configuration)\ + true + $(SolutionDir)$(Configuration)\ + $(Configuration)\ + false + AllRules.ruleset + + + AllRules.ruleset + + + + + + Disabled + WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBGFLAGS_EXPORTS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + $(OutDir)libgflags-debug.dll + true + $(OutDir)libgflags-debug.pdb + Windows + $(OutDir)libgflags-debug.lib + MachineX86 + + + + + WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBGFLAGS_EXPORTS;%(PreprocessorDefinitions) + MultiThreaded + + + Level3 + ProgramDatabase + + + $(OutDir)libgflags.dll + true + Windows + true + true + $(OutDir)libgflags.lib + MachineX86 + + + + + ..\..\src\windows; ..\..\src;%(AdditionalIncludeDirectories) + MultiThreadedDebugDLL + ..\..\src\windows; ..\..\src;%(AdditionalIncludeDirectories) + MultiThreadedDLL + + + ..\..\src\windows; ..\..\src;%(AdditionalIncludeDirectories) + MultiThreadedDebugDLL + ..\..\src\windows; ..\..\src;%(AdditionalIncludeDirectories) + MultiThreadedDLL + + + ..\..\src\windows; ..\..\src;%(AdditionalIncludeDirectories) + MultiThreadedDebugDLL + ..\..\src\windows; ..\..\src;%(AdditionalIncludeDirectories) + MultiThreadedDLL + + + ..\..\src\windows; ..\..\src;%(AdditionalIncludeDirectories) + MultiThreadedDebugDLL + ..\..\src\windows; ..\..\src;%(AdditionalIncludeDirectories) + MultiThreadedDLL + + + + + + + + + + + + + + \ No newline at end of file