st/nine: Enable debug info if NDEBUG is not set
We want to have debug info as well if using meson's debugoptimized when ndebug is off. v2: use u_debug functions that do something even if DEBUG is not set. Signed-off-by: Axel Davy <davyaxel0@gmail.com>
This commit is contained in:
@@ -28,7 +28,7 @@
|
||||
#include "cubetexture9.h"
|
||||
#include "volumetexture9.h"
|
||||
|
||||
#ifdef DEBUG
|
||||
#if defined(DEBUG) || !defined(NDEBUG)
|
||||
#include "nine_pipe.h"
|
||||
#include "nine_dump.h"
|
||||
#endif
|
||||
@@ -605,7 +605,7 @@ NineBaseTexture9_UnLoad( struct NineBaseTexture9 *This )
|
||||
BASETEX_REGISTER_UPDATE(This);
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
#if defined(DEBUG) || !defined(NDEBUG)
|
||||
void
|
||||
NineBaseTexture9_Dump( struct NineBaseTexture9 *This )
|
||||
{
|
||||
@@ -620,4 +620,4 @@ NineBaseTexture9_Dump( struct NineBaseTexture9 *This )
|
||||
This->base.info.array_size, This->base.info.last_level,
|
||||
This->managed.lod, This->managed.lod_resident);
|
||||
}
|
||||
#endif /* DEBUG */
|
||||
#endif /* DEBUG || !NDEBUG */
|
||||
|
@@ -150,7 +150,7 @@ NineBindTextureToDevice( struct NineDevice9 *device,
|
||||
nine_bind(slot, tex);
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
#if defined(DEBUG) || !defined(NDEBUG)
|
||||
void
|
||||
NineBaseTexture9_Dump( struct NineBaseTexture9 *This );
|
||||
#else
|
||||
|
@@ -93,18 +93,18 @@ _nine_debug_printf( unsigned long flag,
|
||||
for (func += 4; func != f; ++func) { *ptr++ = tolower(*func); }
|
||||
*ptr = '\0';
|
||||
if (tid)
|
||||
debug_printf("nine:0x%08lx:%s:%s: ", tid, klass, ++f);
|
||||
_debug_printf("nine:0x%08lx:%s:%s: ", tid, klass, ++f);
|
||||
else
|
||||
debug_printf("nine:%s:%s: ", klass, ++f);
|
||||
_debug_printf("nine:%s:%s: ", klass, ++f);
|
||||
} else if (func) {
|
||||
if (tid)
|
||||
debug_printf("nine:0x%08lx:%s ", tid, func);
|
||||
_debug_printf("nine:0x%08lx:%s ", tid, func);
|
||||
else
|
||||
debug_printf("nine:%s ", func);
|
||||
_debug_printf("nine:%s ", func);
|
||||
}
|
||||
|
||||
va_start(ap, fmt);
|
||||
debug_vprintf(fmt, ap);
|
||||
_debug_vprintf(fmt, ap);
|
||||
va_end(ap);
|
||||
}
|
||||
}
|
||||
@@ -116,5 +116,5 @@ _nine_stub( const char *file,
|
||||
{
|
||||
const char *r = strrchr(file, '/');
|
||||
if (r == NULL) { r = strrchr(file, '\\'); }
|
||||
debug_printf("nine:%s:%d: %s STUB!\n", r ? ++r : file, line, func);
|
||||
_debug_printf("nine:%s:%d: %s STUB!\n", r ? ++r : file, line, func);
|
||||
}
|
||||
|
@@ -33,7 +33,7 @@ _nine_debug_printf( unsigned long flag,
|
||||
|
||||
#define ERR(fmt, ...) _nine_debug_printf(DBG_ERROR, __FUNCTION__, fmt, ## __VA_ARGS__)
|
||||
|
||||
#ifdef DEBUG
|
||||
#if defined(DEBUG) || !defined(NDEBUG)
|
||||
#define WARN(fmt, ...) _nine_debug_printf(DBG_WARN, __FUNCTION__, fmt, ## __VA_ARGS__)
|
||||
#define WARN_ONCE(fmt, ...) \
|
||||
do { \
|
||||
@@ -48,7 +48,7 @@ _nine_debug_printf( unsigned long flag,
|
||||
#define WARN_ONCE(fmt, ...)
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG
|
||||
#if defined(DEBUG) || !defined(NDEBUG)
|
||||
#define DBG_FLAG(flag, fmt, ...) \
|
||||
_nine_debug_printf(flag, __FUNCTION__, fmt, ## __VA_ARGS__)
|
||||
#else
|
||||
@@ -90,7 +90,7 @@ _nine_stub( const char *file,
|
||||
const char *func,
|
||||
unsigned line );
|
||||
|
||||
#ifdef DEBUG
|
||||
#if defined(DEBUG) || !defined(NDEBUG)
|
||||
#define STUB(ret) \
|
||||
do { \
|
||||
_nine_stub(__FILE__, __FUNCTION__, __LINE__); \
|
||||
@@ -104,7 +104,7 @@ _nine_stub( const char *file,
|
||||
* macro is designed to be used in conditionals ala
|
||||
* if (user_error(required condition)) { assertion failed }
|
||||
* It also prints debug message if the assertion fails. */
|
||||
#ifdef DEBUG
|
||||
#if defined(DEBUG) || !defined(NDEBUG)
|
||||
#define user_error(x) \
|
||||
(!(x) ? (DBG_FLAG(DBG_USER, "User assertion failed: `%s'\n", #x), TRUE) \
|
||||
: FALSE)
|
||||
@@ -112,7 +112,7 @@ _nine_stub( const char *file,
|
||||
#define user_error(x) (!(x) ? TRUE : FALSE)
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG
|
||||
#if defined(DEBUG) || !defined(NDEBUG)
|
||||
#define user_warn(x) \
|
||||
if ((x)) { DBG_FLAG(DBG_USER, "User warning: `%s'\n", #x); }
|
||||
#else
|
||||
|
@@ -8,7 +8,7 @@
|
||||
|
||||
#include "nine_dump.h"
|
||||
|
||||
#ifdef DEBUG
|
||||
#if defined(DEBUG) || !defined(NDEBUG)
|
||||
|
||||
static char __thread tls[128];
|
||||
|
||||
@@ -810,4 +810,4 @@ nine_dump_D3DCAPS9(unsigned ch, const D3DCAPS9 *caps)
|
||||
FREE(s);
|
||||
}
|
||||
|
||||
#endif /* DEBUG */
|
||||
#endif /* DEBUG || !NDEBUG */
|
||||
|
@@ -16,7 +16,7 @@ const char *nine_D3DPRESENTFLAG_to_str(DWORD);
|
||||
const char *nine_D3DLOCK_to_str(DWORD);
|
||||
const char *nine_D3DSAMP_to_str(DWORD);
|
||||
|
||||
#ifdef DEBUG
|
||||
#if defined(DEBUG) || !defined(NDEBUG)
|
||||
|
||||
void
|
||||
nine_dump_D3DADAPTER_IDENTIFIER9(unsigned, const D3DADAPTER_IDENTIFIER9 *);
|
||||
@@ -29,7 +29,7 @@ nine_dump_D3DMATERIAL9(unsigned, const D3DMATERIAL9 *);
|
||||
void
|
||||
nine_dump_D3DTSS_value(unsigned, D3DTEXTURESTAGESTATETYPE, DWORD);
|
||||
|
||||
#else /* !DEBUG */
|
||||
#else /* !DEBUG && NDEBUG */
|
||||
|
||||
static inline void
|
||||
nine_dump_D3DADAPTER_IDENTIFIER9(unsigned ch, const D3DADAPTER_IDENTIFIER9 *id)
|
||||
@@ -47,6 +47,6 @@ static inline void
|
||||
nine_dump_D3DTSS_value(unsigned ch, D3DTEXTURESTAGESTATETYPE tss, DWORD value)
|
||||
{ }
|
||||
|
||||
#endif /* DEBUG */
|
||||
#endif /* DEBUG || !NDEBUG */
|
||||
|
||||
#endif /* _NINE_DUMP_H_H_ */
|
||||
|
@@ -2491,7 +2491,7 @@ nine_d3d_matrix_inverse(D3DMATRIX *D, const D3DMATRIX *M)
|
||||
for (k = 0; k < 4; k++)
|
||||
D->m[i][k] *= det;
|
||||
|
||||
#ifdef DEBUG
|
||||
#if defined(DEBUG) || !defined(NDEBUG)
|
||||
{
|
||||
D3DMATRIX I;
|
||||
|
||||
|
@@ -157,7 +157,7 @@ nine_csmt_create( struct NineDevice9 *This )
|
||||
(void) mtx_init(&ctx->thread_running, mtx_plain);
|
||||
(void) mtx_init(&ctx->thread_resume, mtx_plain);
|
||||
|
||||
#if DEBUG
|
||||
#if defined(DEBUG) || !defined(NDEBUG)
|
||||
u_thread_setname("Main thread");
|
||||
#endif
|
||||
|
||||
|
@@ -272,7 +272,7 @@ NineSurface9_CreatePipeSurfaces( struct NineSurface9 *This )
|
||||
assert(This->surface[1]);
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
#if defined(DEBUG) || !defined(NDEBUG)
|
||||
void
|
||||
NineSurface9_Dump( struct NineSurface9 *This )
|
||||
{
|
||||
@@ -300,7 +300,7 @@ NineSurface9_Dump( struct NineSurface9 *This )
|
||||
NineUnknown_Release(NineUnknown(tex));
|
||||
}
|
||||
}
|
||||
#endif /* DEBUG */
|
||||
#endif /* DEBUG || !NDEBUG */
|
||||
|
||||
HRESULT NINE_WINAPI
|
||||
NineSurface9_GetContainer( struct NineSurface9 *This,
|
||||
|
@@ -139,7 +139,7 @@ NineSurface9_IsOffscreenPlain (struct NineSurface9 *This )
|
||||
return This->base.usage == 0 && !This->texture;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
#if defined(DEBUG) || !defined(NDEBUG)
|
||||
void
|
||||
NineSurface9_Dump( struct NineSurface9 *This );
|
||||
#else
|
||||
|
@@ -186,7 +186,7 @@ static inline void
|
||||
NineVolume9_MarkContainerDirty( struct NineVolume9 *This )
|
||||
{
|
||||
struct NineBaseTexture9 *tex;
|
||||
#ifdef DEBUG
|
||||
#if defined(DEBUG) || !defined(NDEBUG)
|
||||
/* This is always contained by a NineVolumeTexture9. */
|
||||
GUID id = IID_IDirect3DVolumeTexture9;
|
||||
REFIID ref = &id;
|
||||
|
Reference in New Issue
Block a user