Go to the documentation of this file.00001 #ifndef __DEBUG_H__
00002 #define __DEBUG_H__
00003
00004 #include <stdio.h>
00005 #include <assert.h>
00006 #include <errno.h>
00007
00008 #ifdef WIN32
00009 #ifdef DEBUG
00010 # define trace(fmt, ...) \
00011 fprintf(stderr, "%s:%d: " fmt "\n", __FUNCTION__, __LINE__, __VA_ARGS__)
00012 #else
00013 # define trace(fmt, ...)
00014 #endif
00015 #define error(fmt, ...) \
00016 fprintf(stderr, "E:%s:%d: " fmt "\n", __FUNCTION__, __LINE__, __VA_ARGS__)
00017
00018 #else
00019 #ifdef DEBUG
00020 # define trace(fmt, args...) \
00021 fprintf(stderr, "%s:%d: " fmt "\n", __FUNCTION__, __LINE__, ##args)
00022 # define debugonly( arg ) arg
00023 #else
00024 # define trace( fmt, args...)
00025 # define debugonly( arg )
00026 #endif
00027
00028 #define error( fmt, args...) \
00029 fprintf(stderr, "E:%s:%d: " fmt "\n", __FUNCTION__, __LINE__, ##args)
00030
00031 #endif
00032
00033 #endif // __DEBUG_H__
00034