From a84d5f9da10b3bed2a1421dd8db0e3fdc0d35daa Mon Sep 17 00:00:00 2001 From: Michael Wetherell Date: Mon, 17 Oct 2005 17:46:11 +0000 Subject: [PATCH] Link with bufferoverflowu.lib for VC++ 8 and later git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35916 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/msw/libraries.h | 37 +++++++++++++++++++++++++++++++++++++ include/wx/platform.h | 4 +++- 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 include/wx/msw/libraries.h diff --git a/include/wx/msw/libraries.h b/include/wx/msw/libraries.h new file mode 100644 index 0000000000..827f682436 --- /dev/null +++ b/include/wx/msw/libraries.h @@ -0,0 +1,37 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: wx/msw/libraries.h +// Purpose: Pragmas for linking libs conditionally +// Author: Michael Wetherell +// Modified by: +// RCS-ID: $Id$ +// Copyright: (c) 2005 Michael Wetherell +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +#ifndef _WX_MSW_LIBRARIES_H_ +#define _WX_MSW_LIBRARIES_H_ + +// Notes: +// +// In general the preferred place to add libs is in the bakefiles. This file +// can be used where libs must be added conditionally, for those compilers that +// support a way to do that. + +// Newer versions of VC++ support the /GS option which add buffer overflow +// checks. This adds into the generated code calls to support functions in in +// the runtime library. +// +// Starting with VC++ 8 this option is on by default, and code such as the +// runtime library that we need to link is compiled with it. Some versions of +// the runtime library don't include the support code, and a separate library +// bufferoverflowu.lib must be linked. If all versions of VC++ 8 that can +// compile wxWidgets have this lib we can link it here, if not then this will +// have to be removed. +// +// More information: http://support.microsoft.com/?id=894573 + +#if defined __VISUALC__ && __VISUALC__ >= 1400 + #pragma comment(lib,"bufferoverflowu.lib") +#endif + +#endif // _WX_MSW_LIBRARIES_H_ diff --git a/include/wx/platform.h b/include/wx/platform.h index 545e5f7a56..7dd47e6e0f 100644 --- a/include/wx/platform.h +++ b/include/wx/platform.h @@ -493,9 +493,11 @@ # define __STDC_EXT__ 1 #endif -/* Force linking against required libraries under Windows CE: */ +/* Force linking against required libraries under Windows: */ #ifdef __WXWINCE__ # include "wx/msw/wince/libraries.h" +#elif defined __WINDOWS__ +# include "wx/msw/libraries.h" #endif /* -- 2.45.2