00001 /* vim: set sw=4 sts=4 et foldmethod=syntax : */ 00002 00003 /* 00004 * Copyright (c) 2005, 2006, 2007, 2008 Ciaran McCreesh 00005 * 00006 * This file is part of the Paludis package manager. Paludis is free software; 00007 * you can redistribute it and/or modify it under the terms of the GNU General 00008 * Public License version 2, as published by the Free Software Foundation. 00009 * 00010 * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY 00011 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 00012 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 00013 * details. 00014 * 00015 * You should have received a copy of the GNU General Public License along with 00016 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple 00017 * Place, Suite 330, Boston, MA 02111-1307 USA 00018 */ 00019 00020 #ifndef PALUDIS_GUARD_PALUDIS_ATTRIBUTES_HH 00021 #define PALUDIS_GUARD_PALUDIS_ATTRIBUTES_HH 1 00022 00023 /** \file 00024 * Declare the PALUDIS_ATTRIBUTE macros. 00025 * 00026 * \ingroup g_utils 00027 * 00028 * \section Examples 00029 * 00030 * - None at this time. 00031 */ 00032 00033 /** \def PALUDIS_ATTRIBUTE 00034 * If we're using a recent GCC or ICC, expands to __attribute__, otherwise 00035 * discards its arguments. 00036 * 00037 * \ingroup g_utils 00038 */ 00039 00040 /** \def PALUDIS_VISIBLE 00041 * Marker used to represent 'make visible', if visibility is enabled. 00042 * 00043 * \ingroup g_utils 00044 */ 00045 00046 /** \def PALUDIS_HIDDEN 00047 * Marker used to represent 'make hidden', if visibility is enabled. 00048 * 00049 * \ingroup g_utils 00050 */ 00051 00052 #if (defined(__GNUC__) && ! defined(DOXYGEN)) 00053 # if defined(__ICC) 00054 # define PALUDIS_ATTRIBUTE(x) 00055 # else 00056 # if ((__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) 00057 # define PALUDIS_ATTRIBUTE(x) __attribute__(x) 00058 # define PALUDIS_CAN_USE_ATTRIBUTE 1 00059 # else 00060 # define PALUDIS_ATTRIBUTE(x) 00061 # endif 00062 # endif 00063 #else 00064 # define PALUDIS_ATTRIBUTE(x) 00065 #endif 00066 00067 #if (defined(PALUDIS_ENABLE_VISIBILITY) && ! defined(DOXYGEN)) 00068 # define PALUDIS_VISIBLE PALUDIS_ATTRIBUTE((visibility("default"))) 00069 # define PALUDIS_HIDDEN PALUDIS_ATTRIBUTE((visibility("hidden"))) 00070 #else 00071 # define PALUDIS_VISIBLE 00072 # define PALUDIS_HIDDEN 00073 #endif 00074 00075 #define PALUDIS_TLS static __thread 00076 00077 #endif