Main Page | Modules | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

gcc-attrs.h

Go to the documentation of this file.
00001 /*
00002 ** Copyright (C) 2004, 2005 by Kevin L. Mitchell <klmitch@mit.edu>
00003 **
00004 ** This program is free software; you can redistribute it and/or modify
00005 ** it under the terms of the GNU General Public License as published by
00006 ** the Free Software Foundation; either version 2 of the License, or
00007 ** (at your option) any later version.
00008 **
00009 ** This program is distributed in the hope that it will be useful,
00010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 ** GNU General Public License for more details.
00013 **
00014 ** You should have received a copy of the GNU General Public License
00015 ** along with this program; if not, write to the Free Software
00016 ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017 **
00018 ** @(#)$Id: gcc-attrs.h,v 1.5 2005/12/18 00:15:11 klmitch Exp $
00019 */
00027 #ifndef __include_event_gcc_attrs_h__
00028 #define __include_event_gcc_attrs_h__
00029 
00044 #undef _GCA_PREREQ
00045 #if defined(__GNUC__) && defined(__GNUC_MINOR__)
00046 # define _GCA_PREREQ(maj, min)                                                \
00047   ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
00048 #else
00049 # define _GCA_PREREQ(maj, min)          0
00050 #endif
00051 
00070 #undef _gca_noreturn
00071 #undef _gca_const
00072 #if _GCA_PREREQ(2, 5)
00073 # define _gca_noreturn          __attribute__((noreturn))
00074 # define _gca_const             __attribute__((const))
00075 #else
00076 # define _gca_noreturn
00077 # define _gca_const
00078 #endif
00079 
00090 #undef _gca_unused
00091 #if _GCA_PREREQ(2, 7)
00092 # define _gca_unused            __attribute__((unused))
00093 #else
00094 # define _gca_unused
00095 #endif
00096 
00105 #undef _gca_pure
00106 #if _GCA_PREREQ(2, 96)
00107 # define _gca_pure              __attribute__((pure))
00108 #else
00109 # define _gca_pure
00110 #endif
00111 
00112 /* define some handy function attributes for telling the user that he's
00113  * not doing it right ;)
00114  */
00149 #undef _gca_nonnull
00150 #undef _gca_deprecated
00151 #undef _gca_useresult
00152 #if _GCA_PREREQ(3, 0)
00153 # define _gca_nonnull(args)     __attribute__((nonnull args ))
00154 # define _gca_deprecated        __attribute__((deprecated))
00155 # define _gca_useresult         __attribute__((warn_unused_result))
00156 #else
00157 # define _gca_nonnull(args)
00158 # define _gca_deprecated
00159 # define _gca_useresult
00160 #endif
00161 
00162 #endif /* __include_gcc_attrs_h__ */

Generated on Wed Dec 28 23:36:56 2005 for event by  doxygen 1.4.4