williamr@2: /* -*- mode: C; c-file-style: "gnu" -*- */ williamr@2: /* dbus-macros.h generic macros williamr@2: * williamr@2: * Copyright (C) 2002 Red Hat Inc. williamr@2: * williamr@2: * Licensed under the Academic Free License version 2.1 williamr@2: * williamr@2: * This program is free software; you can redistribute it and/or modify williamr@2: * it under the terms of the GNU General Public License as published by williamr@2: * the Free Software Foundation; either version 2 of the License, or williamr@2: * (at your option) any later version. williamr@2: * williamr@2: * This program is distributed in the hope that it will be useful, williamr@2: * but WITHOUT ANY WARRANTY; without even the implied warranty of williamr@2: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the williamr@2: * GNU General Public License for more details. williamr@2: * williamr@2: * You should have received a copy of the GNU General Public License williamr@2: * along with this program; if not, write to the Free Software williamr@2: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA williamr@2: * williamr@2: */ williamr@2: #if !defined (DBUS_INSIDE_DBUS_H) && !defined (DBUS_COMPILATION) williamr@2: #error "Only can be included directly, this file may disappear or change contents." williamr@2: #endif williamr@2: williamr@2: #ifndef DBUS_MACROS_H williamr@2: #define DBUS_MACROS_H williamr@2: williamr@2: #ifdef __cplusplus williamr@2: # define DBUS_BEGIN_DECLS extern "C" { williamr@2: # define DBUS_END_DECLS } williamr@2: #else williamr@2: # define DBUS_BEGIN_DECLS williamr@2: # define DBUS_END_DECLS williamr@2: #endif williamr@2: williamr@2: #ifndef TRUE williamr@2: # define TRUE 1 williamr@2: #endif williamr@2: #ifndef FALSE williamr@2: # define FALSE 0 williamr@2: #endif williamr@2: williamr@2: #ifndef NULL williamr@2: # ifdef __cplusplus williamr@2: # define NULL (0L) williamr@2: # else /* !__cplusplus */ williamr@2: # define NULL ((void*) 0) williamr@2: # endif /* !__cplusplus */ williamr@2: #endif williamr@2: williamr@2: #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1) williamr@2: #define DBUS_GNUC_DEPRECATED __attribute__((__deprecated__)) williamr@2: #else williamr@2: #define DBUS_GNUC_DEPRECATED williamr@2: #endif williamr@2: williamr@2: /* Normally docs are in .c files, but there isn't a .c file for this. */ williamr@2: /** williamr@2: * @defgroup DBusMacros Utility macros williamr@2: * @ingroup DBus williamr@2: * @brief #TRUE, #FALSE, #NULL, and so on williamr@2: * williamr@2: * Utility macros. williamr@2: * williamr@2: * @{ williamr@2: */ williamr@2: williamr@2: /** williamr@2: * @def DBUS_BEGIN_DECLS williamr@2: * williamr@2: * Macro used prior to declaring functions in the D-Bus header williamr@2: * files. Expands to "extern "C"" when using a C++ compiler, williamr@2: * and expands to nothing when using a C compiler. williamr@2: * williamr@2: * Please don't use this in your own code, consider it williamr@2: * D-Bus internal. williamr@2: */ williamr@2: /** williamr@2: * @def DBUS_END_DECLS williamr@2: * williamr@2: * Macro used after declaring functions in the D-Bus header williamr@2: * files. Expands to "}" when using a C++ compiler, williamr@2: * and expands to nothing when using a C compiler. williamr@2: * williamr@2: * Please don't use this in your own code, consider it williamr@2: * D-Bus internal. williamr@2: */ williamr@2: /** williamr@2: * @def TRUE williamr@2: * williamr@2: * Expands to "1" williamr@2: */ williamr@2: /** williamr@2: * @def FALSE williamr@2: * williamr@2: * Expands to "0" williamr@2: */ williamr@2: /** williamr@2: * @def NULL williamr@2: * williamr@2: * A null pointer, defined appropriately for C or C++. williamr@2: */ williamr@2: /** williamr@2: * @def DBUS_GNUC_DEPRECATED williamr@2: * williamr@2: * Tells gcc to warn about a function or type if it's used. williamr@2: * Code marked in this way should also be enclosed in williamr@2: * @code williamr@2: * #ifndef DBUS_DISABLE_DEPRECATED williamr@2: * deprecated stuff here williamr@2: * #endif williamr@2: * @endcode williamr@2: * williamr@2: * Please don't use this in your own code, consider it williamr@2: * D-Bus internal. williamr@2: */ williamr@2: williamr@2: /** @} */ williamr@2: williamr@2: #endif /* DBUS_MACROS_H */