From 9961002b4c50b96c1dc112ab9306e0616fb53f48 Mon Sep 17 00:00:00 2001 From: Rom Walton Date: Tue, 16 Mar 2010 18:53:55 +0000 Subject: [PATCH] - Define HAVE_ALLOCA in boinc_win.h so that any component using strcasestr in str_util.cpp uses stack allocations instead of more expensive heap allocations. - Move remaining HAVE_* defines from project files to boinc_win.h lib/ boinc_win.h win_build/ *.vcproc svn path=/trunk/boinc/; revision=20928 --- checkin_notes | 11 ++++++++++ lib/boinc_win.h | 30 +++++++++++++++++++++++++- win_build/libboinc.vcproj | 8 +++---- win_build/libboinc_staticcrt.vcproj | 8 +++---- win_build/libboincapi_staticcrt.vcproj | 8 +++---- win_build/libgraphics2.vcproj | 8 +++---- 6 files changed, 56 insertions(+), 17 deletions(-) diff --git a/checkin_notes b/checkin_notes index 673c4b701c..920b89c15c 100644 --- a/checkin_notes +++ b/checkin_notes @@ -1980,3 +1980,14 @@ David 16 Mar 2010 schema.sql lib/ str_util.cpp + +Rom 16 Mar 2010 + - Define HAVE_ALLOCA in boinc_win.h so that any component using + strcasestr in str_util.cpp uses stack allocations instead of + more expensive heap allocations. + - Move remaining HAVE_* defines from project files to boinc_win.h + + lib/ + boinc_win.h + win_build/ + *.vcproc diff --git a/lib/boinc_win.h b/lib/boinc_win.h index 2539f5a54e..e4a5eb11b8 100644 --- a/lib/boinc_win.h +++ b/lib/boinc_win.h @@ -22,9 +22,31 @@ #ifndef _BOINC_WIN_ #define _BOINC_WIN_ +#ifndef __CYGWIN32__ + +// Windows C Runtime Library + +#ifndef HAVE_STD_MAX +#define HAVE_STD_MAX 1 +#endif + +#ifndef HAVE_STD_MIN +#define HAVE_STD_MIN 1 +#endif + +#ifndef HAVE_STD_TRANSFORM +#define HAVE_STD_TRANSFORM 1 +#endif + +#ifndef HAVE_ALLOCA +#define HAVE_ALLOCA 1 +#endif + +#else + // Under CYGWIN we need to include config.h first. -#ifdef __CYGWIN32__ #include "config.h" + #endif // Windows System Libraries @@ -36,9 +58,15 @@ // platforms we are going to disable the deprecation warnings if we are compiling // on Visual Studio 2005 #if _MSC_VER >= 1400 + #ifndef _CRT_SECURE_NO_DEPRECATE #define _CRT_SECURE_NO_DEPRECATE #endif + +#ifndef _CRT_SECURE_NO_WARNINGS +#define _CRT_SECURE_NO_WARNINGS +#endif + #endif // Target Windows 2000 or better with Internet Explorer 5.01 or better diff --git a/win_build/libboinc.vcproj b/win_build/libboinc.vcproj index ed11d84c46..40ee3b8c8e 100644 --- a/win_build/libboinc.vcproj +++ b/win_build/libboinc.vcproj @@ -44,7 +44,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="..;../win_build;../lib;../api;../../boinc_depends_win_vs2005/openssl/include;../coprocs/cuda/include" - PreprocessorDefinitions="_WIN32;WIN32;_MT;_DLL;_DEBUG;_LIB_WIN32;_WINDOWS;_CONSOLE;HAVE_STD_MAX;HAVE_STD_MIN;HAVE_STD_TRANSFORM;CLIENT;BOINC_APP_GRAPHICS" + PreprocessorDefinitions="_WIN32;WIN32;_MT;_DLL;_DEBUG;_LIB_WIN32;_WINDOWS;_CONSOLE;CLIENT;BOINC_APP_GRAPHICS" MinimalRebuild="false" BasicRuntimeChecks="3" RuntimeLibrary="3" @@ -119,7 +119,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="..;../win_build;../lib;../api;../../boinc_depends_win_vs2005/openssl/include;../coprocs/cuda/include" - PreprocessorDefinitions="_WIN32;WIN32;_MT;_DLL;_DEBUG;_LIB_WIN32;_WINDOWS;_CONSOLE;HAVE_STD_MAX;HAVE_STD_MIN;HAVE_STD_TRANSFORM;CLIENT;BOINC_APP_GRAPHICS" + PreprocessorDefinitions="_WIN32;WIN32;_MT;_DLL;_DEBUG;_LIB_WIN32;_WINDOWS;_CONSOLE;CLIENT;BOINC_APP_GRAPHICS" MinimalRebuild="false" BasicRuntimeChecks="3" RuntimeLibrary="3" @@ -192,7 +192,7 @@