From 56a77b2429945da374a5c1e73671fc18d9536b01 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Wed, 6 Jan 2016 19:55:04 +0100 Subject: [PATCH] snprintf-replacement: fix invalid preprocessor defines for compiler detection on windows for older vs-versions --- code/StringUtils.h | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/code/StringUtils.h b/code/StringUtils.h index 32442ad..275bcbf 100644 --- a/code/StringUtils.h +++ b/code/StringUtils.h @@ -44,8 +44,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include -//namespace Assimp { - /// @fn ai_snprintf /// @brief The portable version of the function snprintf ( C99 standard ), which works on visual studio compilers 2013 and earlier. /// @param outBuf The buffer to write in @@ -53,7 +51,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /// @param format The format string /// @param ap The additional arguments. /// @return The number of written characters if the buffer size was big enough. If an encoding error occurs, a negative number is returned. -//#if defined(_MSC_VER) && _MSC_VER < 1900 +#if defined(_MSC_VER) && _MSC_VER < 1900 inline int c99_ai_vsnprintf(char *outBuf, size_t size, const char *format, va_list ap) { int count(-1); @@ -67,8 +65,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. return count; } -#if defined(_MSC_VER) && _MSC_VER < 1900 - inline int ai_snprintf(char *outBuf, size_t size, const char *format, ...) { int count; va_list ap; @@ -81,21 +77,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. } #else -#define ai_snprintf snprintf - /*inline int ai_snprintf(char *outBuf, size_t size, const char *format, ...) { - int count; - va_list args; - va_start(args, format); - count = c99_ai_vsnprintf(outBuf, size, format, args); -// count = ::snprintf(outBuf, size, format, args); - va_end(args); - - return count; - }*/ - +# define ai_snprintf snprintf #endif -//} // Namespace Assimp - #endif // INCLUDED_AI_STRINGUTILS_H -- 2.7.4