OSDN Git Service

Fixed DEBUG configuration.
authorlordmulder <mulder2@gmx.de>
Sun, 20 Apr 2014 19:23:14 +0000 (21:23 +0200)
committerlordmulder <mulder2@gmx.de>
Sun, 20 Apr 2014 19:23:14 +0000 (21:23 +0200)
src/global.cpp
src/global.h

index 9da66d0..2a62153 100644 (file)
@@ -2283,6 +2283,23 @@ void x264_fatal_exit(const wchar_t* exitMessage, const char* errorBoxMessage)
 }
 
 /*
+ * Output string to debugger [debug only]
+ */
+void x264_dbg_output_string(const char* format, ...)
+{
+#if X264_DEBUG
+       char buffer[256];
+       va_list args;
+       va_start (args, format);
+       vsnprintf_s(buffer, 256, _TRUNCATE, format, args);
+       OutputDebugStringA(buffer);
+       va_end(args);
+#else
+       THROW("Cannot call this function in a non-debug build!");
+#endif //LAMEXP_DEBUG
+}
+
+/*
  * Entry point checks
  */
 static DWORD x264_entry_check(void);
index 8510741..f52edff 100644 (file)
@@ -139,6 +139,7 @@ bool x264_change_process_priority(const int priority);
 bool x264_change_process_priority(void *hProcess, const int priority);
 QDate x264_current_date_safe(void);
 const QString &x264_data_path(void);
+void x264_dbg_output_string(const char* format, ...);
 size_t x264_dbg_private_bytes(void);
 x264_cpu_t x264_detect_cpu_features(const int argc, char **argv);
 bool x264_enable_close_button(const QWidget *win, const bool bEnable);
@@ -219,7 +220,7 @@ while(0)
                RETV = FUNC(__VA_ARGS__); \
                size_t _privateBytesLeak = (x264_dbg_private_bytes() - _privateBytesBefore) / 1024; \
                if(_privateBytesLeak > 0) { \
-                       x264_dbg_dbg_output_string("\nMemory leak: Lost %u KiloBytes of PrivateUsage memory!\n\n", _privateBytesLeak); \
+                       x264_dbg_output_string("\nMemory leak: Lost %u KiloBytes of PrivateUsage memory!\n\n", _privateBytesLeak); \
                } \
        } \
        while(0)