diff --git a/dlls/mysqlx/msvc8/mysql2.vcproj b/dlls/mysqlx/msvc8/mysql2.vcproj new file mode 100644 index 00000000..7f7ff408 --- /dev/null +++ b/dlls/mysqlx/msvc8/mysql2.vcproj @@ -0,0 +1,359 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dlls/mysqlx/mysql/MysqlHeaders.h b/dlls/mysqlx/mysql/MysqlHeaders.h index 3197bbac..c2fbef19 100644 --- a/dlls/mysqlx/mysql/MysqlHeaders.h +++ b/dlls/mysqlx/mysql/MysqlHeaders.h @@ -1,6 +1,20 @@ #ifndef _INCLUDE_SOURCEMOD_MYSQL_HEADERS_H #define _INCLUDE_SOURCEMOD_MYSQL_HEADERS_H +#if _MSC_VER >= 1400 + /* 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 strnicmp _strnicmp + + /* Disable deprecation warnings because MSVC8 seemingly thinks the ISO C++ conformant + * functions above are deprecated. */ + #pragma warning (disable:4996) +#endif + #include #if defined WIN32 || defined _WIN32 #include diff --git a/dlls/mysqlx/sdk/amxxmodule.cpp b/dlls/mysqlx/sdk/amxxmodule.cpp index 1441e450..9d92f6f5 100755 --- a/dlls/mysqlx/sdk/amxxmodule.cpp +++ b/dlls/mysqlx/sdk/amxxmodule.cpp @@ -2657,11 +2657,10 @@ C_DLLEXPORT int AMXX_PluginsLoaded() // Advanced MF functions void MF_Log(const char *fmt, ...) { - // :TODO: Overflow possible here char msg[3072]; va_list arglst; va_start(arglst, fmt); - vsprintf(msg, fmt, arglst); + vsnprintf(msg, sizeof(msg) - 1, fmt, arglst); va_end(arglst); g_fn_Log("[%s] %s", MODULE_LOGTAG, msg); @@ -2669,11 +2668,10 @@ void MF_Log(const char *fmt, ...) void MF_LogError(AMX *amx, int err, const char *fmt, ...) { - // :TODO: Overflow possible here char msg[3072]; va_list arglst; va_start(arglst, fmt); - vsprintf(msg, fmt, arglst); + vsnprintf(msg, sizeof(msg) - 1, fmt, arglst); va_end(arglst); g_fn_LogErrorFunc(amx, err, "[%s] %s", MODULE_LOGTAG, msg); diff --git a/dlls/mysqlx/sdk/amxxmodule.h b/dlls/mysqlx/sdk/amxxmodule.h index 168fa2b4..71077bdd 100755 --- a/dlls/mysqlx/sdk/amxxmodule.h +++ b/dlls/mysqlx/sdk/amxxmodule.h @@ -153,9 +153,137 @@ typedef int (AMXAPI *AMX_DEBUG)(struct tagAMX *amx); #endif #if defined _MSC_VER - #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" */ + #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 + #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/dlls/mysqlx/sdk/moduleconfig.h b/dlls/mysqlx/sdk/moduleconfig.h index d1dfd0b4..84fd0974 100755 --- a/dlls/mysqlx/sdk/moduleconfig.h +++ b/dlls/mysqlx/sdk/moduleconfig.h @@ -5,9 +5,9 @@ // Module info #define MODULE_NAME "MySQL X" -#define MODULE_VERSION "1.01" +#define MODULE_VERSION "1.72" #define MODULE_AUTHOR "AMX Mod X Dev Team" -#define MODULE_URL "http://www.amxmodx.org/" +#define MODULE_URL "http://www.amxmodx.org/" #define MODULE_LOGTAG "SQLX" // If you want the module not to be reloaded on mapchange, remove / comment out the next line //#define MODULE_RELOAD_ON_MAPCHANGE @@ -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 @@ -85,10 +88,10 @@ // #define FN_ClientCommand ClientCommand /* pfnClientCommand() (wd) Player has sent a command (typed or from a bind) */ // #define FN_ClientUserInfoChanged ClientUserInfoChanged /* pfnClientUserInfoChanged() (wd) Client has updated their setinfo structure */ // #define FN_ServerActivate ServerActivate /* pfnServerActivate() (wd) Server is starting a new map */ -#define FN_ServerDeactivate ServerDeactivate /* pfnServerDeactivate() (wd) Server is leaving the map (shutdown or changelevel); SDK2 */ +#define FN_ServerDeactivate ServerDeactivate /* pfnServerDeactivate() (wd) Server is leaving the map (shutdown or changelevel); SDK2 */ // #define FN_PlayerPreThink PlayerPreThink /* pfnPlayerPreThink() */ // #define FN_PlayerPostThink PlayerPostThink /* pfnPlayerPostThink() */ -#define FN_StartFrame StartFrame /* pfnStartFrame() */ +#define FN_StartFrame StartFrame /* pfnStartFrame() */ // #define FN_ParmsNewLevel ParmsNewLevel /* pfnParmsNewLevel() */ // #define FN_ParmsChangeLevel ParmsChangeLevel /* pfnParmsChangeLevel() */ // #define FN_GetGameDescription GetGameDescription /* pfnGetGameDescription() Returns string describing current .dll. E.g. "TeamFotrress 2" "Half-Life" */ diff --git a/dlls/mysqlx/sdk/sh_list.h b/dlls/mysqlx/sdk/sh_list.h index ec049aaa..e5c65347 100644 --- a/dlls/mysqlx/sdk/sh_list.h +++ b/dlls/mysqlx/sdk/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