瀏覽代碼

Disable `mg_` reminders when NDEBUG is defined

Turiiya 1 年之前
父節點
當前提交
b95b7468f3
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      src/civetweb.c

+ 2 - 0
src/civetweb.c

@@ -1551,11 +1551,13 @@ static void mg_snprintf(const struct mg_connection *conn,
 #if defined(vsnprintf)
 #if defined(vsnprintf)
 #undef vsnprintf
 #undef vsnprintf
 #endif
 #endif
+#if !defined(NDEBUG)
 #define malloc DO_NOT_USE_THIS_FUNCTION__USE_mg_malloc
 #define malloc DO_NOT_USE_THIS_FUNCTION__USE_mg_malloc
 #define calloc DO_NOT_USE_THIS_FUNCTION__USE_mg_calloc
 #define calloc DO_NOT_USE_THIS_FUNCTION__USE_mg_calloc
 #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
+#endif
 #if defined(_WIN32)
 #if defined(_WIN32)
 /* vsnprintf must not be used in any system,
 /* vsnprintf must not be used in any system,
  * but this define only works well for Windows. */
  * but this define only works well for Windows. */