3
* Part of the NV Virtual Buffer Library
4
* This library is copyright 2007, 2008 NV Virtual Buffer Library Contributors
5
* This library is licensed under the GNU Lesser General Public Licence. See license.txt which is included with this library, or see
6
* http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html
14
extern std::wostream* _debugFile;
16
//initialization and termination functions
17
void debug_start(std::wostream* s);
23
#define __PRETTY_FUNCTION__ __FUNCTION__
26
#define __STR2WSTR(x) L##x
27
#define _STR2WSTR(x) __STR2WSTR(x)
31
#define DEBUG_MSG(messageArg) {\
32
if(_debugFile!=NULL) {\
33
wchar_t* __WFUNCTION__=(wchar_t*)malloc(sizeof(wchar_t)*1024);\
34
mbstowcs(__WFUNCTION__,__PRETTY_FUNCTION__,1023);\
35
(*_debugFile)<<L"debug "<<__WFUNCTION__<<L", line "<<__LINE__<<L" of file "<<_STR2WSTR(__FILE__)<<L":\n"<<messageArg<<std::endl<<std::flush;\
42
#define DEBUG_MSG(messageArg)