- 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
This commit is contained in:
Rom Walton 2010-03-16 18:53:55 +00:00
parent bb0ec847c3
commit 9961002b4c
6 changed files with 56 additions and 17 deletions

View File

@ -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

View File

@ -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

View File

@ -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 @@
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="..;../win_build;../lib;../api;../../boinc_depends_win_vs2005/openssl/include;../coprocs/cuda/include"
PreprocessorDefinitions="_WIN32;WIN32;_MT;_DLL;NDEBUG;_LIB_WIN32;_WINDOWS;_CONSOLE;HAVE_STD_MAX;HAVE_STD_MIN;HAVE_STD_TRANSFORM;CLIENT;BOINC_APP_GRAPHICS"
PreprocessorDefinitions="_WIN32;WIN32;_MT;_DLL;NDEBUG;_LIB_WIN32;_WINDOWS;_CONSOLE;CLIENT;BOINC_APP_GRAPHICS"
RuntimeLibrary="0"
FloatingPointModel="2"
UsePrecompiledHeader="2"
@ -263,7 +263,7 @@
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="..;../win_build;../lib;../api;../../boinc_depends_win_vs2005/openssl/include;../coprocs/cuda/include"
PreprocessorDefinitions="_WIN32;WIN32;_MT;_DLL;NDEBUG;_LIB_WIN32;_WINDOWS;_CONSOLE;HAVE_STD_MAX;HAVE_STD_MIN;HAVE_STD_TRANSFORM;CLIENT;BOINC_APP_GRAPHICS"
PreprocessorDefinitions="_WIN32;WIN32;_MT;_DLL;NDEBUG;_LIB_WIN32;_WINDOWS;_CONSOLE;CLIENT;BOINC_APP_GRAPHICS"
ExceptionHandling="1"
RuntimeLibrary="0"
FloatingPointModel="2"

View File

@ -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;_DEBUG;_LIB_WIN32;_WINDOWS;_CONSOLE;HAVE_STD_MAX;HAVE_STD_MIN;HAVE_STD_TRANSFORM;CLIENT;BOINC_APP_GRAPHICS"
PreprocessorDefinitions="_WIN32;WIN32;_MT;_DEBUG;_LIB_WIN32;_WINDOWS;_CONSOLE;CLIENT;BOINC_APP_GRAPHICS"
MinimalRebuild="false"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@ -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;_DEBUG;_LIB_WIN32;_WINDOWS;_CONSOLE;HAVE_STD_MAX;HAVE_STD_MIN;HAVE_STD_TRANSFORM;CLIENT;BOINC_APP_GRAPHICS"
PreprocessorDefinitions="_WIN32;WIN32;_MT;_DEBUG;_LIB_WIN32;_WINDOWS;_CONSOLE;CLIENT;BOINC_APP_GRAPHICS"
MinimalRebuild="false"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@ -192,7 +192,7 @@
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="..;../win_build;../lib;../api;../../boinc_depends_win_vs2005/openssl/include;../coprocs/cuda/include"
PreprocessorDefinitions="_WIN32;WIN32;_MT;NDEBUG;_LIB_WIN32;_WINDOWS;_CONSOLE;HAVE_STD_MAX;HAVE_STD_MIN;HAVE_STD_TRANSFORM;CLIENT;BOINC_APP_GRAPHICS"
PreprocessorDefinitions="_WIN32;WIN32;_MT;NDEBUG;_LIB_WIN32;_WINDOWS;_CONSOLE;CLIENT;BOINC_APP_GRAPHICS"
RuntimeLibrary="0"
FloatingPointModel="2"
UsePrecompiledHeader="2"
@ -263,7 +263,7 @@
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="..;../win_build;../lib;../api;../../boinc_depends_win_vs2005/openssl/include;../coprocs/cuda/include"
PreprocessorDefinitions="_WIN32;WIN32;_MT;NDEBUG;_LIB_WIN32;_WINDOWS;_CONSOLE;HAVE_STD_MAX;HAVE_STD_MIN;HAVE_STD_TRANSFORM;CLIENT;BOINC_APP_GRAPHICS"
PreprocessorDefinitions="_WIN32;WIN32;_MT;NDEBUG;_LIB_WIN32;_WINDOWS;_CONSOLE;CLIENT;BOINC_APP_GRAPHICS"
ExceptionHandling="1"
RuntimeLibrary="0"
FloatingPointModel="2"

View File

@ -44,7 +44,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=".;../;../api;../lib;../samples/image_libs;../samples/jpeglib;../samples/glut"
PreprocessorDefinitions="WIN32;_MT;_DEBUG;_WINDOWS;_CONSOLE;_CRT_SECURE_NO_WARNINGS;HAVE_STD_MAX;HAVE_STD_MIN;CLIENT;BOINC_APP_GRAPHICS"
PreprocessorDefinitions="WIN32;_MT;_DEBUG;_WINDOWS;_CONSOLE;CLIENT;BOINC_APP_GRAPHICS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@ -115,7 +115,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=".;../;../api;../lib;../samples/image_libs;../samples/jpeglib;../samples/glut"
PreprocessorDefinitions="WIN32;_MT;_DEBUG;_WINDOWS;_CONSOLE;_CRT_SECURE_NO_WARNINGS;HAVE_STD_MAX;HAVE_STD_MIN;CLIENT;BOINC_APP_GRAPHICS"
PreprocessorDefinitions="WIN32;_MT;_DEBUG;_WINDOWS;_CONSOLE;CLIENT;BOINC_APP_GRAPHICS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@ -184,7 +184,7 @@
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=".;../;../api;../lib;../samples/image_libs;../samples/jpeglib;../samples/glut"
PreprocessorDefinitions="WIN32;NDEBUG;_MT;_LIB;_CONSOLE;_CRT_SECURE_NO_WARNINGS;HAVE_STD_MAX;HAVE_STD_MIN;HAVE_STD_TRANSFORM;CLIENT;BOINC_APP_GRAPHICS"
PreprocessorDefinitions="WIN32;NDEBUG;_MT;_LIB;_CONSOLE;CLIENT;BOINC_APP_GRAPHICS"
RuntimeLibrary="0"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="boinc_win.h"
@ -252,7 +252,7 @@
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=".;../;../api;../lib;../samples/image_libs;../samples/jpeglib;../samples/glut"
PreprocessorDefinitions="WIN32;NDEBUG;_MT;_LIB;_CONSOLE;_CRT_SECURE_NO_WARNINGS;HAVE_STD_MAX;HAVE_STD_MIN;HAVE_STD_TRANSFORM;CLIENT;BOINC_APP_GRAPHICS"
PreprocessorDefinitions="WIN32;NDEBUG;_MT;_LIB;_CONSOLE;CLIENT;BOINC_APP_GRAPHICS"
ExceptionHandling="1"
RuntimeLibrary="0"
UsePrecompiledHeader="2"

View File

@ -44,7 +44,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=".;../;../api;../lib;../samples/image_libs;../samples/jpeglib;../samples/glut"
PreprocessorDefinitions="WIN32;_MT;_DEBUG;_WINDOWS;_CONSOLE;_CRT_SECURE_NO_WARNINGS;HAVE_STD_MAX;HAVE_STD_MIN;CLIENT;BOINC_APP_GRAPHICS"
PreprocessorDefinitions="WIN32;_MT;_DEBUG;_WINDOWS;_CONSOLE;CLIENT;BOINC_APP_GRAPHICS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@ -114,7 +114,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=".;../;../api;../lib;../samples/image_libs;../samples/jpeglib;../samples/glut"
PreprocessorDefinitions="WIN32;_MT;_DEBUG;_WINDOWS;_CONSOLE;_CRT_SECURE_NO_WARNINGS;HAVE_STD_MAX;HAVE_STD_MIN;CLIENT;BOINC_APP_GRAPHICS"
PreprocessorDefinitions="WIN32;_MT;_DEBUG;_WINDOWS;_CONSOLE;CLIENT;BOINC_APP_GRAPHICS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@ -182,7 +182,7 @@
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=".;../;../api;../lib;../samples/image_libs;../samples/jpeglib;../samples/glut"
PreprocessorDefinitions="WIN32;NDEBUG;_MT;_LIB;_CONSOLE;_CRT_SECURE_NO_WARNINGS;HAVE_STD_MAX;HAVE_STD_MIN;HAVE_STD_TRANSFORM;CLIENT;BOINC_APP_GRAPHICS"
PreprocessorDefinitions="WIN32;NDEBUG;_MT;_LIB;_CONSOLE;CLIENT;BOINC_APP_GRAPHICS"
RuntimeLibrary="0"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="boinc_win.h"
@ -249,7 +249,7 @@
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=".;../;../api;../lib;../samples/image_libs;../samples/jpeglib;../samples/glut"
PreprocessorDefinitions="WIN32;NDEBUG;_MT;_LIB;_CONSOLE;_CRT_SECURE_NO_WARNINGS;HAVE_STD_MAX;HAVE_STD_MIN;HAVE_STD_TRANSFORM;CLIENT;BOINC_APP_GRAPHICS"
PreprocessorDefinitions="WIN32;NDEBUG;_MT;_LIB;_CONSOLE;CLIENT;BOINC_APP_GRAPHICS"
ExceptionHandling="1"
RuntimeLibrary="0"
UsePrecompiledHeader="2"