From 674e37de2316fcabdb582364ff42767b47741155 Mon Sep 17 00:00:00 2001 From: Patrick von Reth Date: Sun, 2 Jan 2011 14:13:50 +0100 Subject: [PATCH] more correct mingw fix --- src/plugins/snarl/SnarlInterface.cpp | 15 ++++----------- src/plugins/snarl/SnarlInterface.h | 2 ++ 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/plugins/snarl/SnarlInterface.cpp b/src/plugins/snarl/SnarlInterface.cpp index a7c02c1..699cd51 100644 --- a/src/plugins/snarl/SnarlInterface.cpp +++ b/src/plugins/snarl/SnarlInterface.cpp @@ -50,21 +50,14 @@ namespace Snarl { namespace V41 { -// workaround for mingw + + +// workaround for mingw-w64 bug #ifdef __GNUC__ inline errno_t strncat_s( char *strDest, size_t bufferSizeInBytes, const char *strSource, size_t count){ strncat(strDest,strSource,count); return 0; } - -inline errno_t _itoa_s( int value, char *buffer, size_t sizeInCharacters, int radix = 10){ - itoa(value,buffer,radix); - return 0; -} - -inline int _vsnprintf_s( char *buffer, size_t sizeOfBuffer, size_t count, const char *format, va_list argptr ){ -return vsnprintf(buffer, sizeOfBuffer, format, argptr); -} #endif //__GNUC__ //----------------------------------------------------------------------------- @@ -289,7 +282,7 @@ LONG32 SnarlInterface::EZUpdate(LONG32 msgToken, LPCSTR title /* = NULL */, LPCS } if (timeout != -1) { char tmp[32]; - _itoa_s(timeout, tmp, 10); + _itoa_s(timeout, tmp, 32, 10); err |= strncat_s(pData, SnarlPacketDataSize, (pData[0] != NULL) ? "#?timeout::" : "timeout::", _TRUNCATE); err |= strncat_s(pData, SnarlPacketDataSize, tmp, _TRUNCATE); diff --git a/src/plugins/snarl/SnarlInterface.h b/src/plugins/snarl/SnarlInterface.h index 9440451..eda6ba5 100644 --- a/src/plugins/snarl/SnarlInterface.h +++ b/src/plugins/snarl/SnarlInterface.h @@ -1,6 +1,8 @@ #ifndef SNARL_INTERFACE_V41 #define SNARL_INTERFACE_V41 +#define MINGW_HAS_SECURE_API + #include #include #include