cpl_port.h

Go to the documentation of this file.
00001 /******************************************************************************
00002  * $Id: cpl_port.h 25450 2013-01-04 23:15:38Z rouault $
00003  *
00004  * Project:  CPL - Common Portability Library
00005  * Author:   Frank Warmerdam, warmerdam@pobox.com
00006  * Purpose:  Include file providing low level portability services for CPL.  
00007  *           This should be the first include file for any CPL based code.  
00008  *
00009  ******************************************************************************
00010  * Copyright (c) 1998, 2005, Frank Warmerdam <warmerdam@pobox.com>
00011  *
00012  * Permission is hereby granted, free of charge, to any person obtaining a
00013  * copy of this software and associated documentation files (the "Software"),
00014  * to deal in the Software without restriction, including without limitation
00015  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
00016  * and/or sell copies of the Software, and to permit persons to whom the
00017  * Software is furnished to do so, subject to the following conditions:
00018  *
00019  * The above copyright notice and this permission notice shall be included
00020  * in all copies or substantial portions of the Software.
00021  *
00022  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
00023  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00024  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
00025  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
00026  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
00027  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
00028  * DEALINGS IN THE SOFTWARE.
00029  ****************************************************************************/
00030 
00031 #ifndef CPL_BASE_H_INCLUDED
00032 #define CPL_BASE_H_INCLUDED
00033 
00041 /* ==================================================================== */
00042 /*      We will use macos_pre10 to indicate compilation with MacOS      */
00043 /*      versions before MacOS X.                                        */
00044 /* ==================================================================== */
00045 #ifdef macintosh
00046 #  define macos_pre10
00047 #endif
00048 
00049 /* ==================================================================== */
00050 /*      We will use WIN32 as a standard windows define.                 */
00051 /* ==================================================================== */
00052 #if defined(_WIN32) && !defined(WIN32) && !defined(_WIN32_WCE)
00053 #  define WIN32
00054 #endif
00055 
00056 #if defined(_WINDOWS) && !defined(WIN32) && !defined(_WIN32_WCE)
00057 #  define WIN32
00058 #endif
00059 
00060 /* ==================================================================== */
00061 /*      We will use WIN32CE as a standard Windows CE (Mobile) define.   */
00062 /* ==================================================================== */
00063 #if defined(_WIN32_WCE)
00064 #  define WIN32CE
00065 #endif
00066 
00067 /* -------------------------------------------------------------------- */
00068 /*      The following apparently allow you to use strcpy() and other    */
00069 /*      functions judged "unsafe" by microsoft in VS 8 (2005).          */
00070 /* -------------------------------------------------------------------- */
00071 #ifdef _MSC_VER
00072 #  ifndef _CRT_SECURE_NO_DEPRECATE
00073 #    define _CRT_SECURE_NO_DEPRECATE
00074 #  endif
00075 #  ifndef _CRT_NONSTDC_NO_DEPRECATE
00076 #    define _CRT_NONSTDC_NO_DEPRECATE
00077 #  endif
00078 #endif
00079 
00080 #include "cpl_config.h"
00081 
00082 /* ==================================================================== */
00083 /*      A few sanity checks, mainly to detect problems that sometimes   */
00084 /*      arise with bad configured cross-compilation.                    */
00085 /* ==================================================================== */
00086 
00087 #if !defined(SIZEOF_INT) || SIZEOF_INT != 4
00088 #error "Unexpected value for SIZEOF_INT"
00089 #endif
00090 
00091 #if !defined(SIZEOF_UNSIGNED_LONG) || (SIZEOF_UNSIGNED_LONG != 4 && SIZEOF_UNSIGNED_LONG != 8)
00092 #error "Unexpected value for SIZEOF_UNSIGNED_LONG"
00093 #endif
00094 
00095 #if !defined(SIZEOF_VOIDP) || (SIZEOF_VOIDP != 4 && SIZEOF_VOIDP != 8)
00096 #error "Unexpected value for SIZEOF_VOIDP"
00097 #endif
00098 
00099 
00100 /* ==================================================================== */
00101 /*      This will disable most WIN32 stuff in a Cygnus build which      */
00102 /*      defines unix to 1.                                              */
00103 /* ==================================================================== */
00104 
00105 #ifdef unix
00106 #  undef WIN32
00107 #  undef WIN32CE
00108 #endif
00109 
00110 #if defined(VSI_NEED_LARGEFILE64_SOURCE) && !defined(_LARGEFILE64_SOURCE)
00111 #  define _LARGEFILE64_SOURCE 1
00112 #endif
00113 
00114 /* ==================================================================== */
00115 /*      If iconv() is available use extended recoding module.           */
00116 /*      Stub implementation is always compiled in, because it works     */
00117 /*      faster than iconv() for encodings it supports.                  */
00118 /* ==================================================================== */
00119 
00120 #if defined(HAVE_ICONV)
00121 #  define CPL_RECODE_ICONV
00122 #endif
00123 
00124 #define CPL_RECODE_STUB
00125 
00126 /* ==================================================================== */
00127 /*      MinGW stuff                                                     */
00128 /* ==================================================================== */
00129 
00130 /* We need __MSVCRT_VERSION__ >= 0x0601 to have "struct __stat64" */
00131 /* Latest versions of mingw32 define it, but with older ones, */
00132 /* we need to define it manually */
00133 #if defined(__MINGW32__)
00134 #ifndef __MSVCRT_VERSION__
00135 #define __MSVCRT_VERSION__ 0x0601
00136 #endif
00137 #endif
00138 
00139 /* ==================================================================== */
00140 /*      Standard include files.                                         */
00141 /* ==================================================================== */
00142 
00143 #include <stdio.h>
00144 #include <stdlib.h>
00145 #include <math.h>
00146 #include <stdarg.h>
00147 #include <string.h>
00148 #include <ctype.h>
00149 #include <limits.h>
00150 
00151 #if !defined(WIN32CE)
00152 #  include <time.h>
00153 #else
00154 #  include <wce_time.h>
00155 #  include <wce_errno.h>
00156 #endif
00157 
00158 
00159 #if defined(HAVE_ERRNO_H)
00160 #  include <errno.h>
00161 #endif 
00162 
00163 #ifdef HAVE_LOCALE_H
00164 #  include <locale.h>
00165 #endif
00166 
00167 #ifdef HAVE_DIRECT_H
00168 #  include <direct.h>
00169 #endif
00170 
00171 #ifdef _AIX
00172 #  include <strings.h>
00173 #endif
00174 
00175 #if defined(HAVE_LIBDBMALLOC) && defined(HAVE_DBMALLOC_H) && defined(DEBUG)
00176 #  define DBMALLOC
00177 #  include <dbmalloc.h>
00178 #endif
00179 
00180 #if !defined(DBMALLOC) && defined(HAVE_DMALLOC_H)
00181 #  define USE_DMALLOC
00182 #  include <dmalloc.h>
00183 #endif
00184 
00185 /* ==================================================================== */
00186 /*      Base portability stuff ... this stuff may need to be            */
00187 /*      modified for new platforms.                                     */
00188 /* ==================================================================== */
00189 
00190 /*---------------------------------------------------------------------
00191  *        types for 16 and 32 bits integers, etc...
00192  *--------------------------------------------------------------------*/
00193 #if UINT_MAX == 65535
00194 typedef long            GInt32;
00195 typedef unsigned long   GUInt32;
00196 #else
00197 typedef int             GInt32;
00198 typedef unsigned int    GUInt32;
00199 #endif
00200 
00201 typedef short           GInt16;
00202 typedef unsigned short  GUInt16;
00203 typedef unsigned char   GByte;
00204 /* hack for PDF driver and poppler >= 0.15.0 that defines incompatible "typedef bool GBool" */
00205 /* in include/poppler/goo/gtypes.h */
00206 #ifndef CPL_GBOOL_DEFINED
00207 #define CPL_GBOOL_DEFINED
00208 typedef int             GBool;
00209 #endif
00210 
00211 /* -------------------------------------------------------------------- */
00212 /*      64bit support                                                   */
00213 /* -------------------------------------------------------------------- */
00214 
00215 #if defined(WIN32) && defined(_MSC_VER)
00216 
00217 #define VSI_LARGE_API_SUPPORTED
00218 typedef __int64          GIntBig;
00219 typedef unsigned __int64 GUIntBig;
00220 
00221 #elif HAVE_LONG_LONG
00222 
00223 typedef long long        GIntBig;
00224 typedef unsigned long long GUIntBig;
00225 
00226 #else
00227 
00228 typedef long             GIntBig;
00229 typedef unsigned long    GUIntBig;
00230 
00231 #endif
00232 
00233 #if defined(__MSVCRT__) || (defined(WIN32) && defined(_MSC_VER))
00234   #define CPL_FRMT_GB_WITHOUT_PREFIX     "I64"
00235 #elif HAVE_LONG_LONG
00236   #define CPL_FRMT_GB_WITHOUT_PREFIX     "ll"
00237 #else
00238   #define CPL_FRMT_GB_WITHOUT_PREFIX     "l"
00239 #endif
00240 
00241 #define CPL_FRMT_GIB     "%" CPL_FRMT_GB_WITHOUT_PREFIX "d"
00242 #define CPL_FRMT_GUIB    "%" CPL_FRMT_GB_WITHOUT_PREFIX "u"
00243 
00244 /* Workaround VC6 bug */
00245 #if defined(_MSC_VER) && (_MSC_VER <= 1200)
00246 #define GUINTBIG_TO_DOUBLE(x) (double)(GIntBig)(x)
00247 #else
00248 #define GUINTBIG_TO_DOUBLE(x) (double)(x)
00249 #endif
00250 
00251 /* ==================================================================== */
00252 /*      Other standard services.                                        */
00253 /* ==================================================================== */
00254 #ifdef __cplusplus
00255 #  define CPL_C_START           extern "C" {
00256 #  define CPL_C_END             }
00257 #else
00258 #  define CPL_C_START
00259 #  define CPL_C_END
00260 #endif
00261 
00262 #ifndef CPL_DLL
00263 #if defined(_MSC_VER) && !defined(CPL_DISABLE_DLL)
00264 #  define CPL_DLL     __declspec(dllexport)
00265 #else
00266 #  if defined(USE_GCC_VISIBILITY_FLAG)
00267 #    define CPL_DLL     __attribute__ ((visibility("default")))
00268 #  else
00269 #    define CPL_DLL
00270 #  endif
00271 #endif
00272 #endif
00273 
00274 /* Should optional (normally private) interfaces be exported? */
00275 #ifdef CPL_OPTIONAL_APIS
00276 #  define CPL_ODLL CPL_DLL
00277 #else
00278 #  define CPL_ODLL
00279 #endif
00280 
00281 #ifndef CPL_STDCALL
00282 #if defined(_MSC_VER) && !defined(CPL_DISABLE_STDCALL)
00283 #  define CPL_STDCALL     __stdcall
00284 #else
00285 #  define CPL_STDCALL
00286 #endif
00287 #endif
00288 
00289 #ifdef _MSC_VER
00290 #  define FORCE_CDECL  __cdecl
00291 #else
00292 #  define FORCE_CDECL 
00293 #endif
00294 
00295 /* TODO : support for other compilers needed */
00296 #if defined(__GNUC__) || defined(_MSC_VER)
00297 #define HAS_CPL_INLINE  1
00298 #define CPL_INLINE __inline
00299 #elif defined(__SUNPRO_CC)
00300 #define HAS_CPL_INLINE  1
00301 #define CPL_INLINE inline
00302 #else
00303 #define CPL_INLINE
00304 #endif
00305 
00306 #ifndef NULL
00307 #  define NULL  0
00308 #endif
00309 
00310 #ifndef FALSE
00311 #  define FALSE 0
00312 #endif
00313 
00314 #ifndef TRUE
00315 #  define TRUE  1
00316 #endif
00317 
00318 #ifndef MAX
00319 #  define MIN(a,b)      ((a<b) ? a : b)
00320 #  define MAX(a,b)      ((a>b) ? a : b)
00321 #endif
00322 
00323 #ifndef ABS
00324 #  define ABS(x)        ((x<0) ? (-1*(x)) : x)
00325 #endif
00326 
00327 #ifndef M_PI
00328 # define M_PI           3.14159265358979323846  /* pi */
00329 #endif
00330 
00331 /* -------------------------------------------------------------------- */
00332 /*      Macro to test equality of two floating point values.            */
00333 /*      We use fabs() function instead of ABS() macro to avoid side     */
00334 /*      effects.                                                        */
00335 /* -------------------------------------------------------------------- */
00336 #ifndef CPLIsEqual
00337 #  define CPLIsEqual(x,y) (fabs((x) - (y)) < 0.0000000000001)
00338 #endif
00339 
00340 /* -------------------------------------------------------------------- */
00341 /*      Provide macros for case insensitive string comparisons.         */
00342 /* -------------------------------------------------------------------- */
00343 #ifndef EQUAL
00344 #  if defined(WIN32) || defined(WIN32CE)
00345 #    define STRCASECMP(a,b)         (stricmp(a,b))
00346 #    define STRNCASECMP(a,b,n)      (strnicmp(a,b,n))
00347 #  else
00348 #    define STRCASECMP(a,b)         (strcasecmp(a,b))
00349 #    define STRNCASECMP(a,b,n)      (strncasecmp(a,b,n))
00350 #  endif
00351 #  define EQUALN(a,b,n)           (STRNCASECMP(a,b,n)==0)
00352 #  define EQUAL(a,b)              (STRCASECMP(a,b)==0)
00353 #endif
00354 
00355 #ifdef macos_pre10
00356 int strcasecmp(char * str1, char * str2);
00357 int strncasecmp(char * str1, char * str2, int len);
00358 char * strdup (char *instr);
00359 #endif
00360 
00361 #ifndef CPL_THREADLOCAL
00362 #  define CPL_THREADLOCAL
00363 #endif
00364 
00365 /* -------------------------------------------------------------------- */
00366 /*      Handle isnan() and isinf().  Note that isinf() and isnan()      */
00367 /*      are supposed to be macros according to C99, defined in math.h   */
00368 /*      Some systems (ie. Tru64) don't have isinf() at all, so if       */
00369 /*      the macro is not defined we just assume nothing is infinite.    */
00370 /*      This may mean we have no real CPLIsInf() on systems with isinf()*/
00371 /*      function but no corresponding macro, but I can live with        */
00372 /*      that since it isn't that important a test.                      */
00373 /* -------------------------------------------------------------------- */
00374 #ifdef _MSC_VER
00375 #  include <float.h>
00376 #  define CPLIsNan(x) _isnan(x)
00377 #  define CPLIsInf(x) (!_isnan(x) && !_finite(x))
00378 #  define CPLIsFinite(x) _finite(x)
00379 #else
00380 #  define CPLIsNan(x) isnan(x)
00381 #  ifdef isinf 
00382 #    define CPLIsInf(x) isinf(x)
00383 #    define CPLIsFinite(x) (!isnan(x) && !isinf(x))
00384 #  else
00385 #    define CPLIsInf(x)    FALSE
00386 #    define CPLIsFinite(x) (!isnan(x))
00387 #  endif
00388 #endif
00389 
00390 /*---------------------------------------------------------------------
00391  *                         CPL_LSB and CPL_MSB
00392  * Only one of these 2 macros should be defined and specifies the byte 
00393  * ordering for the current platform.  
00394  * This should be defined in the Makefile, but if it is not then
00395  * the default is CPL_LSB (Intel ordering, LSB first).
00396  *--------------------------------------------------------------------*/
00397 #if defined(WORDS_BIGENDIAN) && !defined(CPL_MSB) && !defined(CPL_LSB)
00398 #  define CPL_MSB
00399 #endif
00400 
00401 #if ! ( defined(CPL_LSB) || defined(CPL_MSB) )
00402 #define CPL_LSB
00403 #endif
00404 
00405 #if defined(CPL_LSB)
00406 #  define CPL_IS_LSB 1
00407 #else
00408 #  define CPL_IS_LSB 0
00409 #endif
00410 
00411 /*---------------------------------------------------------------------
00412  *        Little endian <==> big endian byte swap macros.
00413  *--------------------------------------------------------------------*/
00414 
00415 #define CPL_SWAP16(x) \
00416         ((GUInt16)( \
00417             (((GUInt16)(x) & 0x00ffU) << 8) | \
00418             (((GUInt16)(x) & 0xff00U) >> 8) ))
00419 
00420 #define CPL_SWAP16PTR(x) \
00421 {                                                                 \
00422     GByte       byTemp, *_pabyDataT = (GByte *) (x);              \
00423                                                                   \
00424     byTemp = _pabyDataT[0];                                       \
00425     _pabyDataT[0] = _pabyDataT[1];                                \
00426     _pabyDataT[1] = byTemp;                                       \
00427 }                                                                    
00428                                                             
00429 #define CPL_SWAP32(x) \
00430         ((GUInt32)( \
00431             (((GUInt32)(x) & (GUInt32)0x000000ffUL) << 24) | \
00432             (((GUInt32)(x) & (GUInt32)0x0000ff00UL) <<  8) | \
00433             (((GUInt32)(x) & (GUInt32)0x00ff0000UL) >>  8) | \
00434             (((GUInt32)(x) & (GUInt32)0xff000000UL) >> 24) ))
00435 
00436 #define CPL_SWAP32PTR(x) \
00437 {                                                                 \
00438     GByte       byTemp, *_pabyDataT = (GByte *) (x);              \
00439                                                                   \
00440     byTemp = _pabyDataT[0];                                       \
00441     _pabyDataT[0] = _pabyDataT[3];                                \
00442     _pabyDataT[3] = byTemp;                                       \
00443     byTemp = _pabyDataT[1];                                       \
00444     _pabyDataT[1] = _pabyDataT[2];                                \
00445     _pabyDataT[2] = byTemp;                                       \
00446 }                                                                    
00447                                                             
00448 #define CPL_SWAP64PTR(x) \
00449 {                                                                 \
00450     GByte       byTemp, *_pabyDataT = (GByte *) (x);              \
00451                                                                   \
00452     byTemp = _pabyDataT[0];                                       \
00453     _pabyDataT[0] = _pabyDataT[7];                                \
00454     _pabyDataT[7] = byTemp;                                       \
00455     byTemp = _pabyDataT[1];                                       \
00456     _pabyDataT[1] = _pabyDataT[6];                                \
00457     _pabyDataT[6] = byTemp;                                       \
00458     byTemp = _pabyDataT[2];                                       \
00459     _pabyDataT[2] = _pabyDataT[5];                                \
00460     _pabyDataT[5] = byTemp;                                       \
00461     byTemp = _pabyDataT[3];                                       \
00462     _pabyDataT[3] = _pabyDataT[4];                                \
00463     _pabyDataT[4] = byTemp;                                       \
00464 }                                                                    
00465                                                             
00466 
00467 /* Until we have a safe 64 bits integer data type defined, we'll replace
00468  * this version of the CPL_SWAP64() macro with a less efficient one.
00469  */
00470 /*
00471 #define CPL_SWAP64(x) \
00472         ((uint64)( \
00473             (uint64)(((uint64)(x) & (uint64)0x00000000000000ffULL) << 56) | \
00474             (uint64)(((uint64)(x) & (uint64)0x000000000000ff00ULL) << 40) | \
00475             (uint64)(((uint64)(x) & (uint64)0x0000000000ff0000ULL) << 24) | \
00476             (uint64)(((uint64)(x) & (uint64)0x00000000ff000000ULL) << 8) | \
00477             (uint64)(((uint64)(x) & (uint64)0x000000ff00000000ULL) >> 8) | \
00478             (uint64)(((uint64)(x) & (uint64)0x0000ff0000000000ULL) >> 24) | \
00479             (uint64)(((uint64)(x) & (uint64)0x00ff000000000000ULL) >> 40) | \
00480             (uint64)(((uint64)(x) & (uint64)0xff00000000000000ULL) >> 56) ))
00481 */
00482 
00483 #define CPL_SWAPDOUBLE(p) CPL_SWAP64PTR(p)
00484 
00485 #ifdef CPL_MSB
00486 #  define CPL_MSBWORD16(x)      (x)
00487 #  define CPL_LSBWORD16(x)      CPL_SWAP16(x)
00488 #  define CPL_MSBWORD32(x)      (x)
00489 #  define CPL_LSBWORD32(x)      CPL_SWAP32(x)
00490 #  define CPL_MSBPTR16(x)       
00491 #  define CPL_LSBPTR16(x)       CPL_SWAP16PTR(x)
00492 #  define CPL_MSBPTR32(x)       
00493 #  define CPL_LSBPTR32(x)       CPL_SWAP32PTR(x)
00494 #  define CPL_MSBPTR64(x)       
00495 #  define CPL_LSBPTR64(x)       CPL_SWAP64PTR(x)
00496 #else
00497 #  define CPL_LSBWORD16(x)      (x)
00498 #  define CPL_MSBWORD16(x)      CPL_SWAP16(x)
00499 #  define CPL_LSBWORD32(x)      (x)
00500 #  define CPL_MSBWORD32(x)      CPL_SWAP32(x)
00501 #  define CPL_LSBPTR16(x)       
00502 #  define CPL_MSBPTR16(x)       CPL_SWAP16PTR(x)
00503 #  define CPL_LSBPTR32(x)       
00504 #  define CPL_MSBPTR32(x)       CPL_SWAP32PTR(x)
00505 #  define CPL_LSBPTR64(x)       
00506 #  define CPL_MSBPTR64(x)       CPL_SWAP64PTR(x)
00507 #endif
00508 
00510 #define CPL_LSBINT16PTR(x)    ((*(GByte*)(x)) | ((*(GByte*)((x)+1)) << 8))
00511 
00513 #define CPL_LSBINT32PTR(x)    ((*(GByte*)(x)) | ((*(GByte*)((x)+1)) << 8) | \
00514                               ((*(GByte*)((x)+2)) << 16) | ((*(GByte*)((x)+3)) << 24))
00515 
00517 #define CPL_LSBSINT16PTR(x) ((GInt16) CPL_LSBINT16PTR(x))
00518 
00520 #define CPL_LSBUINT16PTR(x) ((GUInt16)CPL_LSBINT16PTR(x))
00521 
00523 #define CPL_LSBSINT32PTR(x) ((GInt32) CPL_LSBINT32PTR(x))
00524 
00526 #define CPL_LSBUINT32PTR(x) ((GUInt32)CPL_LSBINT32PTR(x))
00527 
00528 
00529 /* Utility macro to explicitly mark intentionally unreferenced parameters. */
00530 #ifndef UNREFERENCED_PARAM 
00531 #  ifdef UNREFERENCED_PARAMETER /* May be defined by Windows API */
00532 #    define UNREFERENCED_PARAM(param) UNREFERENCED_PARAMETER(param)
00533 #  else
00534 #    define UNREFERENCED_PARAM(param) ((void)param)
00535 #  endif /* UNREFERENCED_PARAMETER */
00536 #endif /* UNREFERENCED_PARAM */
00537 
00538 /***********************************************************************
00539  * Define CPL_CVSID() macro.  It can be disabled during a build by
00540  * defining DISABLE_CPLID in the compiler options.
00541  *
00542  * The cvsid_aw() function is just there to prevent reports of cpl_cvsid()
00543  * being unused.
00544  */
00545 
00546 #ifndef DISABLE_CVSID
00547 #if defined(__GNUC__) && __GNUC__ >= 4
00548 #  define CPL_CVSID(string)     static char cpl_cvsid[] __attribute__((used)) = string;
00549 #else
00550 #  define CPL_CVSID(string)     static char cpl_cvsid[] = string; \
00551 static char *cvsid_aw() { return( cvsid_aw() ? ((char *) NULL) : cpl_cvsid ); }
00552 #endif
00553 #else
00554 #  define CPL_CVSID(string)
00555 #endif
00556 
00557 #if defined(__GNUC__) && __GNUC__ >= 3 && !defined(DOXYGEN_SKIP)
00558 #define CPL_PRINT_FUNC_FORMAT( format_idx, arg_idx )  __attribute__((__format__ (__printf__, format_idx, arg_idx)))
00559 #else
00560 #define CPL_PRINT_FUNC_FORMAT( format_idx, arg_idx )
00561 #endif
00562 
00563 #if defined(__GNUC__) && __GNUC__ >= 4 && !defined(DOXYGEN_SKIP)
00564 #define CPL_WARN_UNUSED_RESULT                        __attribute__((warn_unused_result))
00565 #else
00566 #define CPL_WARN_UNUSED_RESULT
00567 #endif
00568 
00569 #if defined(__GNUC__) && __GNUC__ >= 3 && !defined(DOXYGEN_SKIP)
00570 #define CPL_NO_RETURN                                __attribute__((noreturn))
00571 #else
00572 #define CPL_NO_RETURN
00573 #endif
00574 
00575 #if !defined(DOXYGEN_SKIP)
00576 #if defined(__has_extension)
00577   #if __has_extension(attribute_deprecated_with_message)
00578     /* Clang extension */
00579     #define CPL_WARN_DEPRECATED(x)                       __attribute__ ((deprecated(x)))
00580   #else
00581     #define CPL_WARN_DEPRECATED(x)
00582   #endif
00583 #elif defined(__GNUC__)
00584     #define CPL_WARN_DEPRECATED(x)                       __attribute__ ((deprecated))
00585 #else
00586   #define CPL_WARN_DEPRECATED(x)
00587 #endif
00588 #endif
00589 
00590 #endif /* ndef CPL_BASE_H_INCLUDED */

Generated for GDAL by doxygen 1.6.1.