Chris@0: /* Chris@0: * libid3tag - ID3 tag manipulation library Chris@0: * Copyright (C) 2000-2004 Underbit Technologies, Inc. Chris@0: * Chris@0: * This program is free software; you can redistribute it and/or modify Chris@0: * it under the terms of the GNU General Public License as published by Chris@0: * the Free Software Foundation; either version 2 of the License, or Chris@0: * (at your option) any later version. Chris@0: * Chris@0: * This program is distributed in the hope that it will be useful, Chris@0: * but WITHOUT ANY WARRANTY; without even the implied warranty of Chris@0: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Chris@0: * GNU General Public License for more details. Chris@0: * Chris@0: * You should have received a copy of the GNU General Public License Chris@0: * along with this program; if not, write to the Free Software Chris@0: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Chris@0: * Chris@0: * $Id: global.h,v 1.9 2004/01/23 09:41:32 rob Exp $ Chris@0: */ Chris@0: Chris@0: # ifndef LIBID3TAG_GLOBAL_H Chris@0: # define LIBID3TAG_GLOBAL_H Chris@0: Chris@0: /* conditional debugging */ Chris@0: Chris@0: # if defined(DEBUG) && defined(NDEBUG) Chris@0: # error "cannot define both DEBUG and NDEBUG" Chris@0: # endif Chris@0: Chris@0: # if defined(DEBUG) Chris@0: # include Chris@0: # include "debug.h" Chris@0: # define malloc(sz) id3_debug_malloc(sz, __FILE__, __LINE__) Chris@0: # define calloc(n, sz) id3_debug_calloc(n, sz, __FILE__, __LINE__) Chris@0: # define realloc(ptr, sz) id3_debug_realloc(ptr, sz, __FILE__, __LINE__) Chris@0: # define free(ptr) id3_debug_free(ptr, __FILE__, __LINE__) Chris@0: # define release(ptr) id3_debug_release(ptr, __FILE__, __LINE__) Chris@0: # else Chris@0: # define release(ptr) (ptr) Chris@0: # endif Chris@0: Chris@0: /* conditional features */ Chris@0: Chris@0: # if !defined(HAVE_ASSERT_H) Chris@0: # if defined(NDEBUG) Chris@0: # define assert(x) /* nothing */ Chris@0: # else Chris@0: # define assert(x) do { if (!(x)) abort(); } while (0) Chris@0: # endif Chris@0: # endif Chris@0: Chris@0: # endif