#define BU_TRACE #include "bu/trace.h" void Bu::__tracer( const char *pf ) { printf("trace: %s\n", pf ); } template<> void Bu::__tracer_format( const int8_t &v ) { printf("%hhd", v ); } template<> void Bu::__tracer_format( const uint8_t &v ) { printf("%hhu", v ); } template<> void Bu::__tracer_format( const int16_t &v ) { printf("%hd", v ); } template<> void Bu::__tracer_format( const uint16_t &v ) { printf("%hu", v ); } template<> void Bu::__tracer_format( const int32_t &v ) { printf("%d", v ); } template<> void Bu::__tracer_format( const uint32_t &v ) { printf("%u", v ); } template<> void Bu::__tracer_format( const int64_t &v ) { printf("%lld", v ); } template<> void Bu::__tracer_format( const uint64_t &v ) { printf("%llu", v ); } template<> void Bu::__tracer_format( const bool &v ) { if( v ) printf("true"); else printf("false"); } template<> void Bu::__tracer_format( const char &v ) { printf("%hhd", v ); } template<> void Bu::__tracer_format( const long &v ) { printf("%ld", v ); } template<> void Bu::__tracer_format( const unsigned long &v ) { printf("%lu", v ); } template<> void Bu::__tracer_format( const float &v ) { printf("%f", v ); } template<> void Bu::__tracer_format( const double &v ) { printf("%f", v ); } template<> void Bu::__tracer_format( void * const &v ) { printf("0x%08X", (unsigned int)v ); } template<> void Bu::__tracer_format( char * const &v ) { printf("\"%s\"", v ); } template<> void Bu::__tracer_format( char ** const &v ) { printf("["); for( int j = 0; v[j]; j++ ) printf("\"%s\"", v[j] ); printf("]"); } template<> void Bu::__tracer_format( void const * const &v ) { printf("0x%08X", (unsigned int)v ); } template<> void Bu::__tracer_format( char const * const &v ) { printf("\"%s\"", v ); } template<> void Bu::__tracer_format( char const ** const &v ) { printf("["); for( int j = 0; v[j]; j++ ) printf("\"%s\"", v[j] ); printf("]"); }