From: Peter Åstrand Date: Fri, 12 Dec 2008 14:05:23 +0000 (+0000) Subject: MinGW fix: If vsnprintf if defined before MinGWs stdio.h, things will X-Git-Tag: v0.0.90~285 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=1306c56d1d762ebce3a86308193135364eb19841;p=tigervnc.git MinGW fix: If vsnprintf if defined before MinGWs stdio.h, things will break: MinGW will misinterpret the invocation of vsnprintf in Exception.cc as a definition of vsnprintf, and the rest of vncviewer will call this function, resulting in a runtime hang. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@3398 3789f03b-4d11-0410-bbf8-ca57d06f2519 --- diff --git a/common/common-config.win.h b/common/common-config.win.h index b984fb40..2f84e9cd 100644 --- a/common/common-config.win.h +++ b/common/common-config.win.h @@ -1,7 +1,11 @@ /* common-config.win.h - Platform-specific definitions for Windows */ #define HAVE_VSNPRINTF 1 +#ifdef _MSC_VER +/* Older versions of MSVC lacks vsnprintf. MinGW has it, and if this + macro is defined before stdio.h is included, things will break. */ #define vsnprintf _vsnprintf +#endif #define HAVE_SNPRINTF 1 #define snprintf _snprintf