Переглянути джерело

Merge pull request #1261 from ttytm/ndebug-reminders

Disable `mg_` reminders when `NDEBUG` is defined
bel2125 10 місяців тому
батько
коміт
54a4574c9d
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)
 #undef vsnprintf
 #endif
+#if !defined(NDEBUG)
 #define malloc DO_NOT_USE_THIS_FUNCTION__USE_mg_malloc
 #define calloc DO_NOT_USE_THIS_FUNCTION__USE_mg_calloc
 #define realloc DO_NOT_USE_THIS_FUNCTION__USE_mg_realloc
 #define free DO_NOT_USE_THIS_FUNCTION__USE_mg_free
 #define snprintf DO_NOT_USE_THIS_FUNCTION__USE_mg_snprintf
+#endif
 #if defined(_WIN32)
 /* vsnprintf must not be used in any system,
  * but this define only works well for Windows. */