2003-03-02 11:38:34 +00:00
|
|
|
/*
|
2002-11-01 16:12:00 +00:00
|
|
|
* Debug macros for the Midi Kit
|
|
|
|
*
|
2003-03-02 11:38:34 +00:00
|
|
|
* Copyright (c) 2002-2003 Matthijs Hollemans
|
2002-11-01 16:12:00 +00:00
|
|
|
*/
|
2002-10-31 08:50:49 +00:00
|
|
|
|
|
|
|
#ifndef MIDI_DEBUG_H
|
|
|
|
#define MIDI_DEBUG_H
|
|
|
|
|
2002-12-31 14:25:02 +00:00
|
|
|
#include <OS.h>
|
2002-10-31 08:50:49 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
|
2002-12-31 14:25:02 +00:00
|
|
|
#define WARN(args) { fprintf(stderr, "[midi] WARNING: %s\n", args); }
|
|
|
|
#define UNIMPLEMENTED { fprintf(stderr, "[midi] UNIMPLEMENTED %s\n",__PRETTY_FUNCTION__); }
|
2002-10-31 08:50:49 +00:00
|
|
|
|
2002-12-31 14:25:02 +00:00
|
|
|
#ifdef DEBUG
|
|
|
|
|
|
|
|
#define TRACE(args) { printf("[midi] "); printf args; printf("\n"); }
|
|
|
|
|
|
|
|
#define ASSERT(expr) \
|
|
|
|
if (!(expr))\
|
|
|
|
{\
|
|
|
|
char buf[1024];\
|
|
|
|
sprintf(\
|
|
|
|
buf, "%s(%d) : Assertion \"%s\" failed!",\
|
|
|
|
__FILE__, __LINE__, #expr);\
|
|
|
|
debugger(buf);\
|
|
|
|
}\
|
2002-10-31 08:50:49 +00:00
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
#define TRACE(args)
|
2002-12-31 14:25:02 +00:00
|
|
|
#define ASSERT(expr)
|
2002-10-31 08:50:49 +00:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif // MIDI_DEBUG_H
|