1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
3 * Copyright (C) 2006 Brent Smith <gnome@nextreality.net>
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation; either version 2 of the
8 * License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
15 * You should have received a copy of the GNU General Public
16 * License along with this program; if not, see <http://www.gnu.org/licenses/>.
19 #ifndef __YELP_DEBUG_H__
20 #define __YELP_DEBUG_H__
39 #if defined(__STDC_VERSION__) && __STDC_VERSION__ < 199901L
41 # define __func__ __FUNCTION__
43 # define __func__ "<unknown>"
47 /* __VA_ARGS__ is C99 compliant but may not work on older versions of cpp,
48 * so we provide a fallback */
50 # if defined(__STDC_VERSION__) && __STDC_VERSION__ < 199901L
51 # define debug_print(format, args...) yelp_debug (__FILE__, __LINE__, __func__, format, args)
53 # define debug_print(format, ...) yelp_debug (__FILE__, __LINE__, __func__, format, __VA_ARGS__)
56 # if defined(__STDC_VERSION__) && __STDC_VERSION__ < 199901L
57 # define debug_print(format, args...)
59 # define debug_print(format, ...)
69 void yelp_debug (const gchar
*file
, guint line
,
70 const gchar
*function
, guint flags
, const gchar
*format
, ...);
74 #endif /* __YELP_DEBUG_H__ */