From 647356f7f9f8ba41f5a4bb76e60d225ab0255dc9 Mon Sep 17 00:00:00 2001 From: hybrid Date: Wed, 5 Sep 2007 15:21:47 +0000 Subject: [PATCH] Added MSVC support for sprintf_s Added copyright notice to all platform libs Removed some (hopefully) unused libs git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@909 dfc29bdd-3216-0410-991c-e03cc46cb475 --- include/irrTypes.h | 8 ++++++++ source/Irrlicht/Irrlicht.cpp | 6 ++---- source/Irrlicht/Irrlicht8.0.vcproj | 6 +++--- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/include/irrTypes.h b/include/irrTypes.h index 0cc89cfc..98b9f9d5 100644 --- a/include/irrTypes.h +++ b/include/irrTypes.h @@ -68,8 +68,15 @@ typedef double f64; #ifdef _IRR_WINDOWS_API_ //! Defines for s{w,n}printf because these methods do not match the ISO C //! standard on Windows platforms, but it does on all others. +//! These should be int snprintf(char *str, size_t size, const char *format, ...); +//! and int swprintf(wchar_t *wcs, size_t maxlen, const wchar_t *format, ...); +#if defined(_MSC_VER) && _MSC_VER > 1310 +#define swprintf swprintf_s +#define snprintf sprintf_s +#else #define swprintf _snwprintf #define snprintf _snprintf +#endif // define the wchar_t type if not already built in. #ifdef _MSC_VER @@ -150,3 +157,4 @@ code like 'code', but some generate warnings so we use this macro here */ #endif // __IRR_TYPES_H_INCLUDED__ + diff --git a/source/Irrlicht/Irrlicht.cpp b/source/Irrlicht/Irrlicht.cpp index f209b1f6..c90d53ba 100644 --- a/source/Irrlicht/Irrlicht.cpp +++ b/source/Irrlicht/Irrlicht.cpp @@ -4,6 +4,8 @@ #include "IrrCompileConfig.h" +static const char* const copyright = "Irrlicht Engine (c) 2002-2007 Nikolaus Gebhardt"; + #ifdef _IRR_WINDOWS_ #include #if defined(_DEBUG) && !defined(__GNUWIN32__) @@ -44,10 +46,6 @@ namespace irr #if defined(_IRR_WINDOWS_API_) -#ifdef _MSC_VER -#pragma comment(exestr, "Irrlicht Engine (c) 2002-2007 Nikolaus Gebhardt") -#endif - BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved ) diff --git a/source/Irrlicht/Irrlicht8.0.vcproj b/source/Irrlicht/Irrlicht8.0.vcproj index d62ce641..110f39d0 100644 --- a/source/Irrlicht/Irrlicht8.0.vcproj +++ b/source/Irrlicht/Irrlicht8.0.vcproj @@ -78,7 +78,7 @@ Name="VCLinkerTool" UseLibraryDependencyInputs="true" AdditionalOptions="/MACHINE:I386" - AdditionalDependencies="kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib glu32.lib opengl32.lib" + AdditionalDependencies="kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib opengl32.lib" OutputFile="..\..\bin\Win32-visualstudio\Irrlicht.dll" LinkIncremental="2" SuppressStartupBanner="true" @@ -178,7 +178,7 @@