ZBar bar code reader . http://zbar.sourceforge.net/ ZBar is licensed under the GNU LGPL 2.1 to enable development of both open source and commercial projects.
Dependents: GR-PEACH_Camera_in_barcode levkov_ov7670
zbar_debug.h
00001 /*------------------------------------------------------------------------ 00002 * Copyright 2007-2009 (c) Jeff Brown <spadix@users.sourceforge.net> 00003 * 00004 * This file is part of the ZBar Bar Code Reader. 00005 * 00006 * The ZBar Bar Code Reader is free software; you can redistribute it 00007 * and/or modify it under the terms of the GNU Lesser Public License as 00008 * published by the Free Software Foundation; either version 2.1 of 00009 * the License, or (at your option) any later version. 00010 * 00011 * The ZBar Bar Code Reader is distributed in the hope that it will be 00012 * useful, but WITHOUT ANY WARRANTY; without even the implied warranty 00013 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU Lesser Public License for more details. 00015 * 00016 * You should have received a copy of the GNU Lesser Public License 00017 * along with the ZBar Bar Code Reader; if not, write to the Free 00018 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, 00019 * Boston, MA 02110-1301 USA 00020 * 00021 * http://sourceforge.net/projects/zbar 00022 *------------------------------------------------------------------------*/ 00023 00024 /* varargs variations on compile time debug spew */ 00025 00026 #ifndef DEBUG_LEVEL 00027 00028 # ifdef __GNUC__ 00029 /* older versions of gcc (< 2.95) require a named varargs parameter */ 00030 # define dprintf(args...) 00031 # else 00032 /* unfortunately named vararg parameter is a gcc-specific extension */ 00033 # define dprintf(...) 00034 # endif 00035 00036 #else 00037 00038 # include <stdio.h> 00039 00040 # ifdef __GNUC__ 00041 # define dprintf(level, args...) \ 00042 if((level) <= DEBUG_LEVEL) \ 00043 fprintf(stderr, args) 00044 # else 00045 # define dprintf(level, ...) \ 00046 if((level) <= DEBUG_LEVEL) \ 00047 fprintf(stderr, __VA_ARGS__) 00048 # endif 00049 00050 #endif /* DEBUG_LEVEL */ 00051 00052 /* spew warnings for non-fatal assertions. 00053 * returns specified error code if assertion fails. 00054 * NB check/return is still performed for NDEBUG 00055 * only the message is inhibited 00056 * FIXME don't we need varargs hacks here? 00057 */ 00058 #ifndef NDEBUG 00059 00060 # include <stdio.h> 00061 00062 #if __STDC_VERSION__ < 199901L && !defined(__func__) 00063 # if __GNUC__ >= 2 00064 # define __func__ __FUNCTION__ 00065 # else 00066 # define __func__ "<unknown>" 00067 # endif 00068 #endif 00069 00070 # define zassert(condition, retval, format, ...) do { \ 00071 if(!(condition)) { \ 00072 fprintf(stderr, "WARNING: %s:%d: %s:" \ 00073 " Assertion \"%s\" failed.\n\t" format, \ 00074 __FILE__, __LINE__, __func__, #condition , \ 00075 ##__VA_ARGS__); \ 00076 return(retval); \ 00077 } \ 00078 } while(0) 00079 00080 #else 00081 00082 # define zassert(condition, retval, format, ...) do { \ 00083 if(!(condition)) \ 00084 return(retval); \ 00085 } while(0) 00086 00087 #endif 00088
Generated on Tue Jul 12 2022 18:54:12 by 1.7.2