diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2020-11-20 22:28:38 -0500 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2020-11-20 22:28:38 -0500 |
commit | 5e458dff3bcc832b0b28d83bd3ef482174d1dc09 (patch) | |
tree | 28ac081edae5d36aad5df5b2e53848034dc2b99c /base.h | |
parent | c3fd9dfa23969c842991da4cd852330288889463 (diff) |
more text rendering
Diffstat (limited to 'base.h')
-rw-r--r-- | base.h | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -1,6 +1,10 @@ #ifndef BASE_H_ #define BASE_H_ +#ifndef DEBUG +#define NDEBUG 1 +#endif + #include <stdbool.h> #include <stdint.h> #include <stdio.h> @@ -34,4 +38,22 @@ typedef unsigned long ulong; #define no_warn_end #endif +#if DEBUG +#if __unix__ +#define debug_println printf +#else // __unix__ +static void debug_println(char const *fmt, ...) { + char buf[256]; + va_list args; + va_start(args, fmt); + vsprintf_s(buf, sizeof buf, fmt, args); + va_end(args); + OutputDebugStringA(buf); + OutputDebugStringA("\n"); +} +#endif // __unix__ +#else // DEBUG +#define debug_println(...) +#endif + #endif |