diff --git a/amxmodx/amx.h b/amxmodx/amx.h index 81a4b755..1c2d76fa 100755 --- a/amxmodx/amx.h +++ b/amxmodx/amx.h @@ -166,6 +166,14 @@ typedef int (AMXAPI *AMX_NATIVE_FILTER)(struct tagAMX *amx, int index); #pragma warning(disable:4103) /* disable warning message 4103 that complains * about pragma pack in a header file */ #pragma warning(disable:4100) /* "'%$S' : unreferenced formal parameter" */ + + #if _MSC_VER >= 1400 + // MSVC8 - Replace POSIX stricmp with ISO C++ conformant one as it is deprecated + #define stricmp _stricmp + + // Need this because of some stupid bug + #pragma warning (disable : 4996) + #endif #endif /* Some compilers do not support the #pragma align, which should be fine. Some diff --git a/amxmodx/amxmodx.h b/amxmodx/amxmodx.h index c3b52901..7c917784 100755 --- a/amxmodx/amxmodx.h +++ b/amxmodx/amxmodx.h @@ -42,8 +42,13 @@ #include #include -#ifdef MEMORY_TEST - #include "mmgr/mmgr.h" +#ifdef _MSC_VER + // MSVC8 - replace POSIX functions with ISO C++ conformant ones as they are deprecated + #if _MSC_VER >= 1400 + #define unlink _unlink + #define mkdir _mkdir + #define strdup _strdup + #endif #endif #include "md5.h" diff --git a/amxmodx/amxtime.cpp b/amxmodx/amxtime.cpp index 9e7c2241..40e7dd5e 100755 --- a/amxmodx/amxtime.cpp +++ b/amxmodx/amxtime.cpp @@ -54,7 +54,7 @@ static cell AMX_NATIVE_CALL _time(AMX *amx, cell *params) /* the time() function returns the number of seconds since January 1 1970 * in Universal Coordinated Time (the successor to Greenwich Mean Time) */ - return sec1970; + return (cell)sec1970; } #if defined __BORLANDC__ || defined __WATCOMC__ diff --git a/amxmodx/file.cpp b/amxmodx/file.cpp index 1cecdeda..24bee9a3 100755 --- a/amxmodx/file.cpp +++ b/amxmodx/file.cpp @@ -51,8 +51,6 @@ #include #endif -#include -#include #include "amxmodx.h" CVector FileList; diff --git a/amxmodx/modules.cpp b/amxmodx/modules.cpp index e7cfebb4..f9988e10 100755 --- a/amxmodx/modules.cpp +++ b/amxmodx/modules.cpp @@ -814,14 +814,14 @@ void ConvertModuleName(const char *pathString, String &path) } } #else - char *ptr = strstr(pathString, ".dll"); + char *ptr = const_cast(strstr(pathString, ".dll")); if (ptr) { path.assign(pathString); } else { //prevent this from loading .so too - ptr = strstr(pathString, ".so"); + ptr = const_cast(strstr(pathString, ".so")); if (ptr) { diff --git a/amxmodx/msvc8/amxmodx_mm.sln b/amxmodx/msvc8/amxmodx_mm.sln index ea8a5cfa..a7921c18 100644 --- a/amxmodx/msvc8/amxmodx_mm.sln +++ b/amxmodx/msvc8/amxmodx_mm.sln @@ -1,35 +1,24 @@ + Microsoft Visual Studio Solution File, Format Version 9.00 # Visual Studio 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "amxmodx", "amxmodx_mm.vcproj", "{2BF64D1A-AC89-41B0-9D02-FB8CB610F850}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "amxmodx_mm", "amxmodx_mm.vcproj", "{2BF64D1A-AC89-41B0-9D02-FB8CB610F850}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 JITDebug|Win32 = JITDebug|Win32 - JITMemtestRelease|Win32 = JITMemtestRelease|Win32 + JITDebugBinLog|Win32 = JITDebugBinLog|Win32 JITRelease|Win32 = JITRelease|Win32 - MaximalSpeed|Win32 = MaximalSpeed|Win32 - MemtestDebug|Win32 = MemtestDebug|Win32 - MemtestRelease|Win32 = MemtestRelease|Win32 - Release|Win32 = Release|Win32 + JITReleaseBinLog|Win32 = JITReleaseBinLog|Win32 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {2BF64D1A-AC89-41B0-9D02-FB8CB610F850}.Debug|Win32.ActiveCfg = Debug|Win32 - {2BF64D1A-AC89-41B0-9D02-FB8CB610F850}.Debug|Win32.Build.0 = Debug|Win32 {2BF64D1A-AC89-41B0-9D02-FB8CB610F850}.JITDebug|Win32.ActiveCfg = JITDebug|Win32 {2BF64D1A-AC89-41B0-9D02-FB8CB610F850}.JITDebug|Win32.Build.0 = JITDebug|Win32 - {2BF64D1A-AC89-41B0-9D02-FB8CB610F850}.JITMemtestRelease|Win32.ActiveCfg = JITMemtestRelease|Win32 - {2BF64D1A-AC89-41B0-9D02-FB8CB610F850}.JITMemtestRelease|Win32.Build.0 = JITMemtestRelease|Win32 + {2BF64D1A-AC89-41B0-9D02-FB8CB610F850}.JITDebugBinLog|Win32.ActiveCfg = JITDebugBinLog|Win32 + {2BF64D1A-AC89-41B0-9D02-FB8CB610F850}.JITDebugBinLog|Win32.Build.0 = JITDebugBinLog|Win32 {2BF64D1A-AC89-41B0-9D02-FB8CB610F850}.JITRelease|Win32.ActiveCfg = JITRelease|Win32 {2BF64D1A-AC89-41B0-9D02-FB8CB610F850}.JITRelease|Win32.Build.0 = JITRelease|Win32 - {2BF64D1A-AC89-41B0-9D02-FB8CB610F850}.MaximalSpeed|Win32.ActiveCfg = MaximalSpeed|Win32 - {2BF64D1A-AC89-41B0-9D02-FB8CB610F850}.MaximalSpeed|Win32.Build.0 = MaximalSpeed|Win32 - {2BF64D1A-AC89-41B0-9D02-FB8CB610F850}.MemtestDebug|Win32.ActiveCfg = MemtestDebug|Win32 - {2BF64D1A-AC89-41B0-9D02-FB8CB610F850}.MemtestDebug|Win32.Build.0 = MemtestDebug|Win32 - {2BF64D1A-AC89-41B0-9D02-FB8CB610F850}.MemtestRelease|Win32.ActiveCfg = MemtestRelease|Win32 - {2BF64D1A-AC89-41B0-9D02-FB8CB610F850}.MemtestRelease|Win32.Build.0 = MemtestRelease|Win32 - {2BF64D1A-AC89-41B0-9D02-FB8CB610F850}.Release|Win32.ActiveCfg = Release|Win32 - {2BF64D1A-AC89-41B0-9D02-FB8CB610F850}.Release|Win32.Build.0 = Release|Win32 + {2BF64D1A-AC89-41B0-9D02-FB8CB610F850}.JITReleaseBinLog|Win32.ActiveCfg = JITReleaseBinLog|Win32 + {2BF64D1A-AC89-41B0-9D02-FB8CB610F850}.JITReleaseBinLog|Win32.Build.0 = JITReleaseBinLog|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/amxmodx/msvc8/amxmodx_mm.vcproj b/amxmodx/msvc8/amxmodx_mm.vcproj index dc8ffef3..35475c8e 100644 --- a/amxmodx/msvc8/amxmodx_mm.vcproj +++ b/amxmodx/msvc8/amxmodx_mm.vcproj @@ -2,8 +2,9 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - + + @@ -1252,6 +831,14 @@ RelativePath="..\natives-x86.asm" > + + + + - - - - - - - - - - - - = 1400 + #if !defined NO_MSVC8_AUTO_COMPAT + + /* Disable deprecation warnings concerning unsafe CRT functions */ + #if !defined _CRT_SECURE_NO_DEPRECATE + #define _CRT_SECURE_NO_DEPRECATE + #endif + + /* Replace the POSIX function with ISO C++ conformant ones as they are now deprecated */ + #define access _access + #define cabs _cabs + #define cgets _cgets + #define chdir _chdir + #define chmod _chmod + #define chsize _chsize + #define close _close + #define cprintf _cprintf + #define cputs _cputts + #define creat _creat + #define cscanf _cscanf + #define cwait _cwait + #define dup _dup + #define dup2 _dup2 + #define ecvt _ecvt + #define eof _eof + #define execl _execl + #define execle _execle + #define execlp _execlp + #define execlpe _execlpe + #define execv _execv + #define execve _execv + #define execvp _execvp + #define execvpe _execvpe + #define fcloseall _fcloseall + #define fcvt _fcvt + #define fdopen _fdopen + #define fgetchar _fgetchar + #define filelength _filelength + #define fileno _fileno + #define flushall _flushall + #define fputchar _fputchar + #define gcvt _gcvt + #define getch _getch + #define getche _getche + #define getcwd _getcwd + #define getpid _getpid + #define getw _getw + #define hypot _hypot + #define inp _inp + #define inpw _inpw + #define isascii __isascii + #define isatty _isatty + #define iscsym __iscsym + #define iscsymf __iscsymf + #define itoa _itoa + #define j0 _j0 + #define j1 _j1 + #define jn _jn + #define kbhit _kbhit + #define lfind _lfind + #define locking _locking + #define lsearch _lsearch + #define lseek _lseek + #define ltoa _ltoa + #define memccpy _memccpy + #define memicmp _memicmp + #define mkdir _mkdir + #define mktemp _mktemp + #define open _open + #define outp _outp + #define outpw _outpw + #define putch _putch + #define putenv _putenv + #define putw _putw + #define read _read + #define rmdir _rmdir + #define rmtmp _rmtmp + #define setmode _setmode + #define sopen _sopen + #define spawnl _spawnl + #define spawnle _spawnle + #define spawnlp _spawnlp + #define spawnlpe _spawnlpe + #define spawnv _spawnv + #define spawnve _spawnve + #define spawnvp _spawnvp + #define spawnvpe _spawnvpe + #define strcmpi _strcmpi + #define strdup _strdup + #define stricmp _stricmp + #define strlwr _strlwr + #define strnicmp _strnicmp + #define strnset _strnset + #define strrev _strrev + #define strset _strset + #define strupr _strupr + #define swab _swab + #define tell _tell + #define tempnam _tempnam + #define toascii __toascii + #define tzset _tzset + #define ultoa _ultoa + #define umask _umask + #define ungetch _ungetch + #define unlink _unlink + #define wcsdup _wcsdup + #define wcsicmp _wcsicmp + #define wcsicoll _wcsicoll + #define wcslwr _wcslwr + #define wcsnicmp _wcsnicmp + #define wcsnset _wcsnset + #define wcsrev _wcsrev + #define wcsset _wcsset + #define wcsupr _wcsupr + #define write _write + #define y0 _y0 + #define y1 _y1 + #define yn _yn + + /* Disable deprecation warnings because MSVC8 seemingly thinks the ISO C++ conformant + * functions above are deprecated. */ + #pragma warning (disable:4996) + + #endif + #else + #define vsnprintf _vsnprintf + #endif #endif diff --git a/amxmodx/sdk/moduleconfig.h b/amxmodx/sdk/moduleconfig.h index bb8c625d..543bb5f9 100755 --- a/amxmodx/sdk/moduleconfig.h +++ b/amxmodx/sdk/moduleconfig.h @@ -31,6 +31,9 @@ // It allows you to compile without libstdc++.so as a dependency // #define NO_ALLOC_OVERRIDES +// Uncomment this if you are using MSVC8 or greater and want to fix some of the compatibility issues yourself +// #define NO_MSVC8_AUTO_COMPAT + // - AMXX Init functions // Also consider using FN_META_* // AMXX query diff --git a/amxmodx/sh_list.h b/amxmodx/sh_list.h index 9b7afb61..e632ceca 100644 --- a/amxmodx/sh_list.h +++ b/amxmodx/sh_list.h @@ -11,6 +11,13 @@ #ifndef _INCLUDE_SMM_LIST_H #define _INCLUDE_SMM_LIST_H +// MSVC8 fix for offsetof macro redefition warnings +#ifdef _MSC_VER + #if _MSC_VER >= 1400 + #undef offsetof + #endif +#endif + #include #include diff --git a/amxmodx/strptime.cpp b/amxmodx/strptime.cpp index 043cc5ca..13ce9587 100755 --- a/amxmodx/strptime.cpp +++ b/amxmodx/strptime.cpp @@ -14,6 +14,16 @@ #define strnicmp strncasecmp #endif +#if _MSC_VER + #if _MSC_VER >= 1400 + // MSVC8 - Replace POSIX stricmp with ISO C++ conformant one as it is deprecated + #define stricmp _stricmp + + // Need this because of some stupid bug + #pragma warning (disable : 4996) + #endif +#endif + // this file does not include amxmodx.h, so we have to include the memory manager here #ifdef MEMORY_TEST #include "mmgr/mmgr.h" diff --git a/amxmodx/version.rc b/amxmodx/version.rc index f8f85ed8..2a3b7a02 100755 --- a/amxmodx/version.rc +++ b/amxmodx/version.rc @@ -1,6 +1,5 @@ // Microsoft Visual C++ generated resource script. // -#include "resource.h" #define APSTUDIO_READONLY_SYMBOLS /////////////////////////////////////////////////////////////////////////////