浏览代码

Add #ifdef _WIN32 for vsnprintf blocking define again

bel 10 年之前
父节点
当前提交
ad746c8365
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      src/civetweb.c

+ 3 - 0
src/civetweb.c

@@ -754,7 +754,10 @@ static void mg_snprintf(const struct mg_connection *conn,
 #define realloc DO_NOT_USE_THIS_FUNCTION__USE_mg_realloc
 #define realloc DO_NOT_USE_THIS_FUNCTION__USE_mg_realloc
 #define free DO_NOT_USE_THIS_FUNCTION__USE_mg_free
 #define free DO_NOT_USE_THIS_FUNCTION__USE_mg_free
 #define snprintf DO_NOT_USE_THIS_FUNCTION__USE_mg_snprintf
 #define snprintf DO_NOT_USE_THIS_FUNCTION__USE_mg_snprintf
+#ifdef _WIN32 /* vsnprintf must not be used in any system, *                   \
+               * but this define only works well for Windows. */
 #define vsnprintf DO_NOT_USE_THIS_FUNCTION__USE_mg_vsnprintf
 #define vsnprintf DO_NOT_USE_THIS_FUNCTION__USE_mg_vsnprintf
+#endif
 
 
 #define MD5_STATIC static
 #define MD5_STATIC static
 #include "md5.inl"
 #include "md5.inl"