From 1b95a52b1e919cdcaeafc6a8d1cf029569878757 Mon Sep 17 00:00:00 2001 From: "Jake.Stine" Date: Thu, 5 Mar 2009 20:06:38 +0000 Subject: [PATCH] Better implementation of MSVC's _SCL_SECURE macro, plus some PrecompiledHeader.h cleanups. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@690 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/PrecompiledHeader.h | 46 +++++++++++++++++++++++++-------------- pcsx2/x86/BaseblockEx.cpp | 2 -- 2 files changed, 30 insertions(+), 18 deletions(-) diff --git a/pcsx2/PrecompiledHeader.h b/pcsx2/PrecompiledHeader.h index 54a1128a28..bc7ffce50a 100644 --- a/pcsx2/PrecompiledHeader.h +++ b/pcsx2/PrecompiledHeader.h @@ -1,5 +1,21 @@ +#pragma once + #ifndef _PCSX2_PRECOMPILED_HEADER_ #define _PCSX2_PRECOMPILED_HEADER_ +#endif // pragma once + +////////////////////////////////////////////////////////////////////////////////////////// +// Microsoft specific STL extensions for bounds checking and stuff: Enabled in devbuilds, +// disabled in release builds. :) + +#ifdef _MSC_VER +#ifdef PCSX2_DEVBUILD +# define _SECURE_SCL 1 +# define _SECURE_SCL_THROWS 1 +#else +# define _SECURE_SCL 0 +#endif +#endif #define NOMINMAX // Disables other libs inclusion of their own min/max macros (we use std instead) @@ -7,10 +23,14 @@ # define __LINUX__ #endif -#ifndef _WIN32 -# include +#ifdef _WIN32 +// disable warning C4244: '=' : conversion from 'big' to 'small', possible loss of data +# pragma warning(disable:4244) +#else +# include // Non-Windows platforms need this #endif +////////////////////////////////////////////////////////////////////////////////////////// // Include the STL junk that's actually handy. #include @@ -32,22 +52,10 @@ #include #include -// TODO : Add items here that are local to Pcsx2 but stay relatively unchanged for -// long periods of time. - -#ifdef _WIN32 -// disable warning C4244: '=' : conversion from 'big' to 'small', possible loss of data -#pragma warning(disable:4244) -#endif - using std::string; // we use it enough, so bring it into the global namespace. using std::min; using std::max; -#include "zlib/zlib.h" -#include "PS2Etypes.h" -#include "StringUtils.h" - typedef int BOOL; # undef TRUE @@ -55,6 +63,14 @@ typedef int BOOL; # define TRUE 1 # define FALSE 0 +////////////////////////////////////////////////////////////////////////////////////////// +// Begin Pcsx2 Includes: Add items here that are local to Pcsx2 but stay relatively +// unchanged for long periods of time. + +#include "zlib/zlib.h" +#include "PS2Etypes.h" +#include "StringUtils.h" + //////////////////////////////////////////////////////////////////// // Compiler/OS specific macros and defines -- Begin Section @@ -119,5 +135,3 @@ enum EmitterId_Count // must always be last! }; - -#endif diff --git a/pcsx2/x86/BaseblockEx.cpp b/pcsx2/x86/BaseblockEx.cpp index 916751e034..67855133c3 100644 --- a/pcsx2/x86/BaseblockEx.cpp +++ b/pcsx2/x86/BaseblockEx.cpp @@ -19,8 +19,6 @@ #include "PrecompiledHeader.h" #include "BaseblockEx.h" -#define _SECURE_SCL 0 - #include using namespace std;