ROHC compression/decompression library
rohc_debug.h
Go to the documentation of this file.
00001 /*
00002  * This program is free software; you can redistribute it and/or modify
00003  * it under the terms of the GNU General Public License as published by
00004  * the Free Software Foundation; either version 2 of the License, or
00005  * (at your option) any later version.
00006  *
00007  * This program is distributed in the hope that it will be useful,
00008  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00009  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010  * GNU General Public License for more details.
00011  *
00012  * You should have received a copy of the GNU General Public License
00013  * along with this program; if not, write to the Free Software
00014  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00015  */
00016 
00017 /**
00018  * @file   rohc_debug.h
00019  * @brief  ROHC debug utils
00020  * @author Didier Barvaux <didier.barvaux@toulouse.viveris.com>
00021  * @author Didier Barvaux <didier@barvaux.org>
00022  */
00023 
00024 #ifndef ROHC_DEBUG_H
00025 #define ROHC_DEBUG_H
00026 
00027 /*
00028  * Includes
00029  */
00030 
00031 #include <stdlib.h> /* for free(3) */
00032 #include "config.h" /* for ROHC_DEBUG_LEVEL definition */
00033 
00034 
00035 /*
00036  * Debug macros
00037  */
00038 
00039 #if ROHC_DEBUG_LEVEL > 0
00040 
00041 /** Free a pointer plus set it to NULL to avoid hidden bugs */
00042 #define zfree(pointer) \
00043         do { \
00044                 free(pointer); \
00045                 pointer = NULL; \
00046         } while(0)
00047 
00048 #else /* not ROHC_DEBUG */
00049 
00050 #define zfree(pointer) \
00051         do { \
00052                 free(pointer); \
00053         } while(0)
00054 
00055 #endif
00056 
00057 
00058 #endif
00059