/* Debug.cpp */
#ifdef _DEBUG
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <stdio.h>
#include "Debug.h"
/************************
デバッグ出力
************************/
void DebugPrint(const char* str, ...) {
va_list argp;
char szBuf[256];
va_start(argp, str);
vsprintf(szBuf, str, argp);
va_end(argp);
OutputDebugString(szBuf);
}
#endif
|
/* Debug.h */
///////////////////////////////////////////
//
// デバッグ用マクロ定義
//
#ifndef _H_DEBUG_
#define _H_DEBUG_
#ifdef _DEBUG
void DebugPrint(const char* str, ...);
#define TRACE DebugPrint
#else
#define TRACE // _noop
#endif // _DEBUG
#endif // _H_DEBUG_
|