2 * Supplemental include file for config.h of libcaptive
3 * Copyright (C) 2003 Jan Kratochvil <project-captive@jankratochvil.net>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; exactly version 2 of June 1991 is required
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 #ifndef _CAPTIVE_CONFIG2_H
21 #define _CAPTIVE_CONFIG2_H 1
24 /* Prevent: /usr/include/libbonobo-2.0/bonobo/bonobo-i18n.h:47:1: warning: "_" redefined */
25 /* #undef's need to be out of AH_BOTTOM() of 'configure.ac' to not to be commented out. */
26 #ifdef CAPTIVE_USING_GNOMEUI
27 # include <bonobo/bonobo-i18n.h>
32 # undef bindtextdomain
33 # undef bind_textdomain_codeset
36 #endif /* CAPTIVE_USING_GNOMEUI */
38 /* <libintl.h> is taken from "$(top_srcdir)/intl" if system doesn't provide intl */
41 # define _(String) dgettext (PACKAGE,String)
43 # define _(String) gettext (String)
44 #endif /* LIBCAPTIVE */
46 # define N_(String) gettext_noop (String)
48 # define N_(String) (String)
50 #else /* !ENABLE_NLS */
51 /* Stubs that do something close enough. */
52 # define textdomain(String) (String)
53 # define gettext(String) (String)
54 # define dgettext(Domain,Message) (Message)
55 # define dcgettext(Domain,Message,Type) (Message)
56 # define bindtextdomain(Domain,Directory) (Domain)
57 # define _(String) (String)
58 # define N_(String) (String)
59 #endif /* !ENABLE_NLS */
61 #include <glib/gtypes.h> /* for 'gchar' */
62 /* Prevent: /usr/include/glib-2.0/glib/gmessages.h:123:1: warning: this is the location of the previous definition */
64 #define G_LOG_DOMAIN ((const gchar *)"Captive")
66 /* Ensure we have proper -I options: */
67 #if defined(CAPTIVE_USE_GNOME_VFS_MODULE) || defined(CAPTIVE_USE_GNOME_VFS)
68 #ifndef HAVE_GNOME_VFS_READ_ENTIRE_FILE
69 #include <libgnomevfs/gnome-vfs-result.h>
70 GnomeVFSResult gnome_vfs_read_entire_file(const char *uri,int *file_size,char **file_contents);
74 /* We need to redefine it here as any '#undef' in config.h gets commented
75 * out during 'config.h.in' -> 'config.h' pass.
77 #if defined(__GNUC__) && (__GNUC__ >= 3)
78 #include <glib/gmacros.h> /* for 'G_STRLOC' */
80 /* '__func__' does not string-concatenate! */
81 # define G_STRLOC __func__
85 /* g_log() and g_logv() acceleration */
87 #include <glib/gmessages.h> /* for g_log() */
88 #include <glib/gtypes.h> /* for 'gboolean' */
89 extern gboolean captive_debug_messages_disabled;
90 #define g_log(log_domain,log_level,format,args...) ({ \
91 GLogLevelFlags _captive_g_log_log_level=(log_level); \
92 if ((_captive_g_log_log_level&~(G_LOG_LEVEL_MESSAGE|G_LOG_LEVEL_INFO|G_LOG_LEVEL_DEBUG)) \
93 || !captive_debug_messages_disabled) \
94 g_log((log_domain),_captive_g_log_log_level,(format) , ## args); \
96 #define g_logv(log_domain,log_level,format,args) ({ \
97 GLogLevelFlags _captive_g_logv_log_level=(log_level); \
98 if ((_captive_g_logv_log_level&~(G_LOG_LEVEL_MESSAGE|G_LOG_LEVEL_INFO|G_LOG_LEVEL_DEBUG)) \
99 || !captive_debug_messages_disabled) \
100 g_logv((log_domain),_captive_g_logv_log_level,(format),(args)); \
102 #endif /* LIBCAPTIVE */
105 #endif /* _CAPTIVE_CONFIG2_H */