Eneboo - Documentación para desarrolladores
src/libmysql_std/include/my_attribute.h
Ir a la documentación de este archivo.
00001 /* Copyright (C) 2000-2003 MySQL AB
00002 
00003    This program is free software; you can redistribute it and/or modify
00004    it under the terms of the GNU General Public License as published by
00005    the Free Software Foundation; version 2 of the License.
00006 
00007    This program is distributed in the hope that it will be useful,
00008    but WITHOUT ANY WARRANTY; without even the implied warranty of
00009    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010    GNU General Public License for more details.
00011 
00012    You should have received a copy of the GNU General Public License
00013    along with this program; if not, write to the Free Software
00014    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
00015 
00016 /*
00017   Helper macros used for setting different __attributes__
00018   on functions in a portable fashion
00019 */
00020 
00021 #ifndef _my_attribute_h
00022 #define _my_attribute_h
00023 
00024 /*
00025   Disable __attribute__() on gcc < 2.7, g++ < 3.4, and non-gcc compilers.
00026   Some forms of __attribute__ are actually supported in earlier versions of
00027   g++, but we just disable them all because we only use them to generate
00028   compilation warnings.
00029 */
00030 #ifndef __attribute__
00031 # if !defined(__GNUC__)
00032 #  define __attribute__(A)
00033 # elif GCC_VERSION < 2008
00034 #  define __attribute__(A)
00035 # elif defined(__cplusplus) && GCC_VERSION < 3004
00036 #  define __attribute__(A)
00037 # endif
00038 #endif
00039 
00040 /*
00041   __attribute__((format(...))) is only supported in gcc >= 2.8 and g++ >= 3.4
00042   But that's already covered by the __attribute__ tests above, so this is
00043   just a convenience macro.
00044 */
00045 #ifndef ATTRIBUTE_FORMAT
00046 # define ATTRIBUTE_FORMAT(style, m, n) __attribute__((format(style, m, n)))
00047 #endif
00048 
00049 /*
00050 
00051    __attribute__((format(...))) on a function pointer is not supported
00052    until  gcc 3.1
00053 */
00054 #ifndef ATTRIBUTE_FORMAT_FPTR
00055 # if (GCC_VERSION >= 3001)
00056 #  define ATTRIBUTE_FORMAT_FPTR(style, m, n) ATTRIBUTE_FORMAT(style, m, n)
00057 # else
00058 #  define ATTRIBUTE_FORMAT_FPTR(style, m, n)
00059 # endif /* GNUC >= 3.1 */
00060 #endif
00061 
00062 
00063 #endif
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'