diff options
| author | Andree Buschmann <AndreeBuschmann@t-online.de> | 2011-08-31 19:19:49 +0000 |
|---|---|---|
| committer | Andree Buschmann <AndreeBuschmann@t-online.de> | 2011-08-31 19:19:49 +0000 |
| commit | 13cbade08a07296d92e7a7d3e20475de0032cba1 (patch) | |
| tree | 731a1a4a99d86632a719ae49e3b3d2a12e764a3a /apps/codecs/libgme/blargg_source.h | |
| parent | d089e104034fdf5562bea125d2cacf4ee486782a (diff) | |
| download | rockbox-13cbade08a07296d92e7a7d3e20475de0032cba1.zip rockbox-13cbade08a07296d92e7a7d3e20475de0032cba1.tar.gz rockbox-13cbade08a07296d92e7a7d3e20475de0032cba1.tar.bz2 rockbox-13cbade08a07296d92e7a7d3e20475de0032cba1.tar.xz | |
Update libgme to Blargg's Game_Music_Emu 0.6-pre.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30397 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/libgme/blargg_source.h')
| -rw-r--r-- | apps/codecs/libgme/blargg_source.h | 39 |
1 files changed, 22 insertions, 17 deletions
diff --git a/apps/codecs/libgme/blargg_source.h b/apps/codecs/libgme/blargg_source.h index 4bea02a..ab8e1b0 100644 --- a/apps/codecs/libgme/blargg_source.h +++ b/apps/codecs/libgme/blargg_source.h @@ -2,16 +2,13 @@ #ifndef BLARGG_SOURCE_H #define BLARGG_SOURCE_H -// If debugging is enabled, abort program if expr is false. Meant for checking -// internal state and consistency. A failed assertion indicates a bug in the module. -// void assert( bool expr ); -#include <assert.h> - // If debugging is enabled and expr is false, abort program. Meant for checking // caller-supplied parameters and operations that are outside the control of the // module. A failed requirement indicates a bug outside the module. // void require( bool expr ); #if defined(ROCKBOX) +#undef assert +#define assert( expr ) #undef require #define require( expr ) #else @@ -36,28 +33,36 @@ static inline void blargg_dprintf_( const char* fmt, ... ) { } #undef check #define check( expr ) ((void) 0) -// If expr yields error string, return it from current function, otherwise continue. -#undef RETURN_ERR -#define RETURN_ERR( expr ) do { \ - blargg_err_t blargg_return_err_ = (expr); \ - if ( blargg_return_err_ ) return blargg_return_err_; \ +/* If expr yields non-NULL error string, returns it from current function, +otherwise continues normally. */ +#undef RETURN_ERR +#define RETURN_ERR( expr ) \ + do {\ + blargg_err_t blargg_return_err_ = (expr);\ + if ( blargg_return_err_ )\ + return blargg_return_err_;\ } while ( 0 ) -// If ptr is 0, return out of memory error string. -#undef CHECK_ALLOC -#define CHECK_ALLOC( ptr ) do { if ( (ptr) == 0 ) return "Out of memory"; } while ( 0 ) +/* If ptr is NULL, returns out-of-memory error, otherwise continues normally. */ +#undef CHECK_ALLOC +#define CHECK_ALLOC( ptr ) \ + do {\ + if ( !(ptr) )\ + return "Out of memory";\ + } while ( 0 ) #ifndef max #define max(a,b) (((a) > (b)) ? (a) : (b)) #endif + #ifndef min #define min(a,b) (((a) < (b)) ? (a) : (b)) #endif -// TODO: good idea? bad idea? -#undef byte -#define byte byte_ -typedef unsigned char byte; +// typedef unsigned char byte; +typedef unsigned char blargg_byte; +#undef byte +#define byte blargg_byte // deprecated #define BLARGG_CHECK_ALLOC CHECK_ALLOC |