GDAL
cpl_port.h
Go to the documentation of this file.
1 /******************************************************************************
2  * $Id: cpl_port.h 29925 2015-08-30 12:05:05Z rouault $
3  *
4  * Project: CPL - Common Portability Library
5  * Author: Frank Warmerdam, warmerdam@pobox.com
6  * Purpose: Include file providing low level portability services for CPL.
7  * This should be the first include file for any CPL based code.
8  *
9  ******************************************************************************
10  * Copyright (c) 1998, 2005, Frank Warmerdam <warmerdam@pobox.com>
11  * Copyright (c) 2008-2013, Even Rouault <even dot rouault at mines-paris dot org>
12  *
13  * Permission is hereby granted, free of charge, to any person obtaining a
14  * copy of this software and associated documentation files (the "Software"),
15  * to deal in the Software without restriction, including without limitation
16  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
17  * and/or sell copies of the Software, and to permit persons to whom the
18  * Software is furnished to do so, subject to the following conditions:
19  *
20  * The above copyright notice and this permission notice shall be included
21  * in all copies or substantial portions of the Software.
22  *
23  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
29  * DEALINGS IN THE SOFTWARE.
30  ****************************************************************************/
31 
32 #ifndef CPL_BASE_H_INCLUDED
33 #define CPL_BASE_H_INCLUDED
34 
42 /* ==================================================================== */
43 /* We will use macos_pre10 to indicate compilation with MacOS */
44 /* versions before MacOS X. */
45 /* ==================================================================== */
46 #ifdef macintosh
47 # define macos_pre10
48 #endif
49 
50 /* ==================================================================== */
51 /* We will use WIN32 as a standard windows define. */
52 /* ==================================================================== */
53 #if defined(_WIN32) && !defined(WIN32) && !defined(_WIN32_WCE)
54 # define WIN32
55 #endif
56 
57 #if defined(_WINDOWS) && !defined(WIN32) && !defined(_WIN32_WCE)
58 # define WIN32
59 #endif
60 
61 /* ==================================================================== */
62 /* We will use WIN32CE as a standard Windows CE (Mobile) define. */
63 /* ==================================================================== */
64 #if defined(_WIN32_WCE)
65 # define WIN32CE
66 #endif
67 
68 /* -------------------------------------------------------------------- */
69 /* The following apparently allow you to use strcpy() and other */
70 /* functions judged "unsafe" by microsoft in VS 8 (2005). */
71 /* -------------------------------------------------------------------- */
72 #ifdef _MSC_VER
73 # ifndef _CRT_SECURE_NO_DEPRECATE
74 # define _CRT_SECURE_NO_DEPRECATE
75 # endif
76 # ifndef _CRT_NONSTDC_NO_DEPRECATE
77 # define _CRT_NONSTDC_NO_DEPRECATE
78 # endif
79 #endif
80 
81 #include "cpl_config.h"
82 
83 /* ==================================================================== */
84 /* A few sanity checks, mainly to detect problems that sometimes */
85 /* arise with bad configured cross-compilation. */
86 /* ==================================================================== */
87 
88 #if !defined(SIZEOF_INT) || SIZEOF_INT != 4
89 #error "Unexpected value for SIZEOF_INT"
90 #endif
91 
92 #if !defined(SIZEOF_UNSIGNED_LONG) || (SIZEOF_UNSIGNED_LONG != 4 && SIZEOF_UNSIGNED_LONG != 8)
93 #error "Unexpected value for SIZEOF_UNSIGNED_LONG"
94 #endif
95 
96 #if !defined(SIZEOF_VOIDP) || (SIZEOF_VOIDP != 4 && SIZEOF_VOIDP != 8)
97 #error "Unexpected value for SIZEOF_VOIDP"
98 #endif
99 
100 
101 /* ==================================================================== */
102 /* This will disable most WIN32 stuff in a Cygnus build which */
103 /* defines unix to 1. */
104 /* ==================================================================== */
105 
106 #ifdef unix
107 # undef WIN32
108 # undef WIN32CE
109 #endif
110 
111 #if defined(VSI_NEED_LARGEFILE64_SOURCE) && !defined(_LARGEFILE64_SOURCE)
112 # define _LARGEFILE64_SOURCE 1
113 #endif
114 
115 /* ==================================================================== */
116 /* If iconv() is available use extended recoding module. */
117 /* Stub implementation is always compiled in, because it works */
118 /* faster than iconv() for encodings it supports. */
119 /* ==================================================================== */
120 
121 #if defined(HAVE_ICONV)
122 # define CPL_RECODE_ICONV
123 #endif
124 
125 #define CPL_RECODE_STUB
126 
127 /* ==================================================================== */
128 /* MinGW stuff */
129 /* ==================================================================== */
130 
131 /* We need __MSVCRT_VERSION__ >= 0x0601 to have "struct __stat64" */
132 /* Latest versions of mingw32 define it, but with older ones, */
133 /* we need to define it manually */
134 #if defined(__MINGW32__)
135 #ifndef __MSVCRT_VERSION__
136 #define __MSVCRT_VERSION__ 0x0601
137 #endif
138 #endif
139 
140 /* ==================================================================== */
141 /* Standard include files. */
142 /* ==================================================================== */
143 
144 #include <stdio.h>
145 #include <stdlib.h>
146 #include <math.h>
147 #include <stdarg.h>
148 #include <string.h>
149 #include <ctype.h>
150 #include <limits.h>
151 
152 #if !defined(WIN32CE)
153 # include <time.h>
154 #else
155 # include <wce_time.h>
156 # include <wce_errno.h>
157 #endif
158 
159 
160 #if defined(HAVE_ERRNO_H)
161 # include <errno.h>
162 #endif
163 
164 #ifdef HAVE_LOCALE_H
165 # include <locale.h>
166 #endif
167 
168 #ifdef HAVE_DIRECT_H
169 # include <direct.h>
170 #endif
171 
172 #if !(defined(WIN32) || defined(WIN32CE))
173 # include <strings.h>
174 #endif
175 
176 #if defined(HAVE_LIBDBMALLOC) && defined(HAVE_DBMALLOC_H) && defined(DEBUG)
177 # define DBMALLOC
178 # include <dbmalloc.h>
179 #endif
180 
181 #if !defined(DBMALLOC) && defined(HAVE_DMALLOC_H)
182 # define USE_DMALLOC
183 # include <dmalloc.h>
184 #endif
185 
186 /* ==================================================================== */
187 /* Base portability stuff ... this stuff may need to be */
188 /* modified for new platforms. */
189 /* ==================================================================== */
190 
191 /*---------------------------------------------------------------------
192  * types for 16 and 32 bits integers, etc...
193  *--------------------------------------------------------------------*/
194 #if UINT_MAX == 65535
195 typedef long GInt32;
196 typedef unsigned long GUInt32;
197 #else
198 typedef int GInt32;
199 typedef unsigned int GUInt32;
200 #endif
201 
202 typedef short GInt16;
203 typedef unsigned short GUInt16;
204 typedef unsigned char GByte;
205 /* hack for PDF driver and poppler >= 0.15.0 that defines incompatible "typedef bool GBool" */
206 /* in include/poppler/goo/gtypes.h */
207 #ifndef CPL_GBOOL_DEFINED
208 #define CPL_GBOOL_DEFINED
209 typedef int GBool;
210 #endif
211 
212 /* -------------------------------------------------------------------- */
213 /* 64bit support */
214 /* -------------------------------------------------------------------- */
215 
216 #if defined(WIN32) && defined(_MSC_VER)
217 
218 #define VSI_LARGE_API_SUPPORTED
219 typedef __int64 GIntBig;
220 typedef unsigned __int64 GUIntBig;
221 
222 #define GINTBIG_MIN ((GIntBig)(0x80000000) << 32)
223 #define GINTBIG_MAX (((GIntBig)(0x7FFFFFFF) << 32) | 0xFFFFFFFFU)
224 
225 #elif HAVE_LONG_LONG
226 
227 typedef long long GIntBig;
228 typedef unsigned long long GUIntBig;
229 
230 #define GINTBIG_MIN ((GIntBig)(0x80000000) << 32)
231 #define GINTBIG_MAX (((GIntBig)(0x7FFFFFFF) << 32) | 0xFFFFFFFFU)
232 
233 #else
234 
235 typedef long GIntBig;
236 typedef unsigned long GUIntBig;
237 
238 #define GINTBIG_MIN INT_MIN
239 #define GINTBIG_MAX INT_MAX
240 #endif
241 
242 #if SIZEOF_VOIDP == 8
243 typedef GIntBig GPtrDiff_t;
244 #else
245 typedef int GPtrDiff_t;
246 #endif
247 
248 #if defined(__MSVCRT__) || (defined(WIN32) && defined(_MSC_VER))
249  #define CPL_FRMT_GB_WITHOUT_PREFIX "I64"
250 #elif HAVE_LONG_LONG
251  #define CPL_FRMT_GB_WITHOUT_PREFIX "ll"
252 #else
253  #define CPL_FRMT_GB_WITHOUT_PREFIX "l"
254 #endif
255 
256 #define CPL_FRMT_GIB "%" CPL_FRMT_GB_WITHOUT_PREFIX "d"
257 #define CPL_FRMT_GUIB "%" CPL_FRMT_GB_WITHOUT_PREFIX "u"
258 
259 /* Workaround VC6 bug */
260 #if defined(_MSC_VER) && (_MSC_VER <= 1200)
261 #define GUINTBIG_TO_DOUBLE(x) (double)(GIntBig)(x)
262 #else
263 #define GUINTBIG_TO_DOUBLE(x) (double)(x)
264 #endif
265 
266 /* ==================================================================== */
267 /* Other standard services. */
268 /* ==================================================================== */
269 #ifdef __cplusplus
270 # define CPL_C_START extern "C" {
271 # define CPL_C_END }
272 #else
273 # define CPL_C_START
274 # define CPL_C_END
275 #endif
276 
277 #ifndef CPL_DLL
278 #if defined(_MSC_VER) && !defined(CPL_DISABLE_DLL)
279 # define CPL_DLL __declspec(dllexport)
280 #else
281 # if defined(USE_GCC_VISIBILITY_FLAG)
282 # define CPL_DLL __attribute__ ((visibility("default")))
283 # else
284 # define CPL_DLL
285 # endif
286 #endif
287 #endif
288 
289 /* Should optional (normally private) interfaces be exported? */
290 #ifdef CPL_OPTIONAL_APIS
291 # define CPL_ODLL CPL_DLL
292 #else
293 # define CPL_ODLL
294 #endif
295 
296 #ifndef CPL_STDCALL
297 #if defined(_MSC_VER) && !defined(CPL_DISABLE_STDCALL)
298 # define CPL_STDCALL __stdcall
299 #else
300 # define CPL_STDCALL
301 #endif
302 #endif
303 
304 #ifdef _MSC_VER
305 # define FORCE_CDECL __cdecl
306 #else
307 # define FORCE_CDECL
308 #endif
309 
310 /* TODO : support for other compilers needed */
311 #if (defined(__GNUC__) && !defined(__NO_INLINE__)) || defined(_MSC_VER)
312 #define HAS_CPL_INLINE 1
313 #define CPL_INLINE __inline
314 #elif defined(__SUNPRO_CC)
315 #define HAS_CPL_INLINE 1
316 #define CPL_INLINE inline
317 #else
318 #define CPL_INLINE
319 #endif
320 
321 #ifndef NULL
322 # define NULL 0
323 #endif
324 
325 #ifndef FALSE
326 # define FALSE 0
327 #endif
328 
329 #ifndef TRUE
330 # define TRUE 1
331 #endif
332 
333 #ifndef MAX
334 # define MIN(a,b) ((a<b) ? a : b)
335 # define MAX(a,b) ((a>b) ? a : b)
336 #endif
337 
338 #ifndef ABS
339 # define ABS(x) ((x<0) ? (-1*(x)) : x)
340 #endif
341 
342 #ifndef M_PI
343 # define M_PI 3.14159265358979323846 /* pi */
344 #endif
345 
346 /* -------------------------------------------------------------------- */
347 /* Macro to test equality of two floating point values. */
348 /* We use fabs() function instead of ABS() macro to avoid side */
349 /* effects. */
350 /* -------------------------------------------------------------------- */
351 #ifndef CPLIsEqual
352 # define CPLIsEqual(x,y) (fabs((x) - (y)) < 0.0000000000001)
353 #endif
354 
355 /* -------------------------------------------------------------------- */
356 /* Provide macros for case insensitive string comparisons. */
357 /* -------------------------------------------------------------------- */
358 #ifndef EQUAL
359 # if defined(WIN32) || defined(WIN32CE)
360 # define STRCASECMP(a,b) (stricmp(a,b))
361 # define STRNCASECMP(a,b,n) (strnicmp(a,b,n))
362 # else
363 # define STRCASECMP(a,b) (strcasecmp(a,b))
364 # define STRNCASECMP(a,b,n) (strncasecmp(a,b,n))
365 # endif
366 # define EQUALN(a,b,n) (STRNCASECMP(a,b,n)==0)
367 # define EQUAL(a,b) (STRCASECMP(a,b)==0)
368 #endif
369 
370 #ifdef macos_pre10
371 int strcasecmp(char * str1, char * str2);
372 int strncasecmp(char * str1, char * str2, int len);
373 char * strdup (char *instr);
374 #endif
375 
376 #ifndef CPL_THREADLOCAL
377 # define CPL_THREADLOCAL
378 #endif
379 
380 /* -------------------------------------------------------------------- */
381 /* Handle isnan() and isinf(). Note that isinf() and isnan() */
382 /* are supposed to be macros according to C99, defined in math.h */
383 /* Some systems (ie. Tru64) don't have isinf() at all, so if */
384 /* the macro is not defined we just assume nothing is infinite. */
385 /* This may mean we have no real CPLIsInf() on systems with isinf()*/
386 /* function but no corresponding macro, but I can live with */
387 /* that since it isn't that important a test. */
388 /* -------------------------------------------------------------------- */
389 #ifdef _MSC_VER
390 # include <float.h>
391 # define CPLIsNan(x) _isnan(x)
392 # define CPLIsInf(x) (!_isnan(x) && !_finite(x))
393 # define CPLIsFinite(x) _finite(x)
394 #else
395 # define CPLIsNan(x) isnan(x)
396 # ifdef isinf
397 # define CPLIsInf(x) isinf(x)
398 # define CPLIsFinite(x) (!isnan(x) && !isinf(x))
399 # else
400 # define CPLIsInf(x) FALSE
401 # define CPLIsFinite(x) (!isnan(x))
402 # endif
403 #endif
404 
405 /*---------------------------------------------------------------------
406  * CPL_LSB and CPL_MSB
407  * Only one of these 2 macros should be defined and specifies the byte
408  * ordering for the current platform.
409  * This should be defined in the Makefile, but if it is not then
410  * the default is CPL_LSB (Intel ordering, LSB first).
411  *--------------------------------------------------------------------*/
412 #if defined(WORDS_BIGENDIAN) && !defined(CPL_MSB) && !defined(CPL_LSB)
413 # define CPL_MSB
414 #endif
415 
416 #if ! ( defined(CPL_LSB) || defined(CPL_MSB) )
417 #define CPL_LSB
418 #endif
419 
420 #if defined(CPL_LSB)
421 # define CPL_IS_LSB 1
422 #else
423 # define CPL_IS_LSB 0
424 #endif
425 
426 /*---------------------------------------------------------------------
427  * Little endian <==> big endian byte swap macros.
428  *--------------------------------------------------------------------*/
429 
430 #define CPL_SWAP16(x) \
431  ((GUInt16)( \
432  (((GUInt16)(x) & 0x00ffU) << 8) | \
433  (((GUInt16)(x) & 0xff00U) >> 8) ))
434 
435 #define CPL_SWAP16PTR(x) \
436 { \
437  GByte byTemp, *_pabyDataT = (GByte *) (x); \
438  \
439  byTemp = _pabyDataT[0]; \
440  _pabyDataT[0] = _pabyDataT[1]; \
441  _pabyDataT[1] = byTemp; \
442 }
443 
444 #define CPL_SWAP32(x) \
445  ((GUInt32)( \
446  (((GUInt32)(x) & (GUInt32)0x000000ffUL) << 24) | \
447  (((GUInt32)(x) & (GUInt32)0x0000ff00UL) << 8) | \
448  (((GUInt32)(x) & (GUInt32)0x00ff0000UL) >> 8) | \
449  (((GUInt32)(x) & (GUInt32)0xff000000UL) >> 24) ))
450 
451 #define CPL_SWAP32PTR(x) \
452 { \
453  GByte byTemp, *_pabyDataT = (GByte *) (x); \
454  \
455  byTemp = _pabyDataT[0]; \
456  _pabyDataT[0] = _pabyDataT[3]; \
457  _pabyDataT[3] = byTemp; \
458  byTemp = _pabyDataT[1]; \
459  _pabyDataT[1] = _pabyDataT[2]; \
460  _pabyDataT[2] = byTemp; \
461 }
462 
463 #define CPL_SWAP64PTR(x) \
464 { \
465  GByte byTemp, *_pabyDataT = (GByte *) (x); \
466  \
467  byTemp = _pabyDataT[0]; \
468  _pabyDataT[0] = _pabyDataT[7]; \
469  _pabyDataT[7] = byTemp; \
470  byTemp = _pabyDataT[1]; \
471  _pabyDataT[1] = _pabyDataT[6]; \
472  _pabyDataT[6] = byTemp; \
473  byTemp = _pabyDataT[2]; \
474  _pabyDataT[2] = _pabyDataT[5]; \
475  _pabyDataT[5] = byTemp; \
476  byTemp = _pabyDataT[3]; \
477  _pabyDataT[3] = _pabyDataT[4]; \
478  _pabyDataT[4] = byTemp; \
479 }
480 
481 
482 /* Until we have a safe 64 bits integer data type defined, we'll replace
483  * this version of the CPL_SWAP64() macro with a less efficient one.
484  */
485 /*
486 #define CPL_SWAP64(x) \
487  ((uint64)( \
488  (uint64)(((uint64)(x) & (uint64)0x00000000000000ffULL) << 56) | \
489  (uint64)(((uint64)(x) & (uint64)0x000000000000ff00ULL) << 40) | \
490  (uint64)(((uint64)(x) & (uint64)0x0000000000ff0000ULL) << 24) | \
491  (uint64)(((uint64)(x) & (uint64)0x00000000ff000000ULL) << 8) | \
492  (uint64)(((uint64)(x) & (uint64)0x000000ff00000000ULL) >> 8) | \
493  (uint64)(((uint64)(x) & (uint64)0x0000ff0000000000ULL) >> 24) | \
494  (uint64)(((uint64)(x) & (uint64)0x00ff000000000000ULL) >> 40) | \
495  (uint64)(((uint64)(x) & (uint64)0xff00000000000000ULL) >> 56) ))
496 */
497 
498 #define CPL_SWAPDOUBLE(p) CPL_SWAP64PTR(p)
499 
500 #ifdef CPL_MSB
501 # define CPL_MSBWORD16(x) (x)
502 # define CPL_LSBWORD16(x) CPL_SWAP16(x)
503 # define CPL_MSBWORD32(x) (x)
504 # define CPL_LSBWORD32(x) CPL_SWAP32(x)
505 # define CPL_MSBPTR16(x)
506 # define CPL_LSBPTR16(x) CPL_SWAP16PTR(x)
507 # define CPL_MSBPTR32(x)
508 # define CPL_LSBPTR32(x) CPL_SWAP32PTR(x)
509 # define CPL_MSBPTR64(x)
510 # define CPL_LSBPTR64(x) CPL_SWAP64PTR(x)
511 #else
512 # define CPL_LSBWORD16(x) (x)
513 # define CPL_MSBWORD16(x) CPL_SWAP16(x)
514 # define CPL_LSBWORD32(x) (x)
515 # define CPL_MSBWORD32(x) CPL_SWAP32(x)
516 # define CPL_LSBPTR16(x)
517 # define CPL_MSBPTR16(x) CPL_SWAP16PTR(x)
518 # define CPL_LSBPTR32(x)
519 # define CPL_MSBPTR32(x) CPL_SWAP32PTR(x)
520 # define CPL_LSBPTR64(x)
521 # define CPL_MSBPTR64(x) CPL_SWAP64PTR(x)
522 #endif
523 
525 #define CPL_LSBINT16PTR(x) ((*(GByte*)(x)) | (*(((GByte*)(x))+1) << 8))
526 
528 #define CPL_LSBINT32PTR(x) ((*(GByte*)(x)) | (*(((GByte*)(x))+1) << 8) | \
529  (*(((GByte*)(x))+2) << 16) | (*(((GByte*)(x))+3) << 24))
530 
532 #define CPL_LSBSINT16PTR(x) ((GInt16) CPL_LSBINT16PTR(x))
533 
535 #define CPL_LSBUINT16PTR(x) ((GUInt16)CPL_LSBINT16PTR(x))
536 
538 #define CPL_LSBSINT32PTR(x) ((GInt32) CPL_LSBINT32PTR(x))
539 
541 #define CPL_LSBUINT32PTR(x) ((GUInt32)CPL_LSBINT32PTR(x))
542 
543 
544 /* Utility macro to explicitly mark intentionally unreferenced parameters. */
545 #ifndef UNREFERENCED_PARAM
546 # ifdef UNREFERENCED_PARAMETER /* May be defined by Windows API */
547 # define UNREFERENCED_PARAM(param) UNREFERENCED_PARAMETER(param)
548 # else
549 # define UNREFERENCED_PARAM(param) ((void)param)
550 # endif /* UNREFERENCED_PARAMETER */
551 #endif /* UNREFERENCED_PARAM */
552 
553 /***********************************************************************
554  * Define CPL_CVSID() macro. It can be disabled during a build by
555  * defining DISABLE_CPLID in the compiler options.
556  *
557  * The cvsid_aw() function is just there to prevent reports of cpl_cvsid()
558  * being unused.
559  */
560 
561 #ifndef DISABLE_CVSID
562 #if defined(__GNUC__) && __GNUC__ >= 4
563 # define CPL_CVSID(string) static char cpl_cvsid[] __attribute__((used)) = string;
564 #else
565 # define CPL_CVSID(string) static char cpl_cvsid[] = string; \
566 static char *cvsid_aw() { return( cvsid_aw() ? ((char *) NULL) : cpl_cvsid ); }
567 #endif
568 #else
569 # define CPL_CVSID(string)
570 #endif
571 
572 /* Null terminated variadic */
573 #if defined(__GNUC__) && __GNUC__ >= 4 && !defined(DOXYGEN_SKIP)
574 # define CPL_NULL_TERMINATED __attribute__((__sentinel__))
575 #else
576 # define CPL_NULL_TERMINATED
577 #endif
578 
579 #if defined(__GNUC__) && __GNUC__ >= 3 && !defined(DOXYGEN_SKIP)
580 #define CPL_PRINT_FUNC_FORMAT( format_idx, arg_idx ) __attribute__((__format__ (__printf__, format_idx, arg_idx)))
581 #else
582 #define CPL_PRINT_FUNC_FORMAT( format_idx, arg_idx )
583 #endif
584 
585 #if defined(__GNUC__) && __GNUC__ >= 4 && !defined(DOXYGEN_SKIP)
586 #define CPL_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
587 #else
588 #define CPL_WARN_UNUSED_RESULT
589 #endif
590 
591 #if defined(__GNUC__) && __GNUC__ >= 4
592 # define CPL_UNUSED __attribute((__unused__))
593 #else
594 /* TODO: add cases for other compilers */
595 # define CPL_UNUSED
596 #endif
597 
598 #if defined(__GNUC__) && __GNUC__ >= 3 && !defined(DOXYGEN_SKIP)
599 #define CPL_NO_RETURN __attribute__((noreturn))
600 #else
601 #define CPL_NO_RETURN
602 #endif
603 
604 #if !defined(DOXYGEN_SKIP)
605 #if defined(__has_extension)
606  #if __has_extension(attribute_deprecated_with_message)
607  /* Clang extension */
608  #define CPL_WARN_DEPRECATED(x) __attribute__ ((deprecated(x)))
609  #else
610  #define CPL_WARN_DEPRECATED(x)
611  #endif
612 #elif defined(__GNUC__)
613  #define CPL_WARN_DEPRECATED(x) __attribute__ ((deprecated))
614 #else
615  #define CPL_WARN_DEPRECATED(x)
616 #endif
617 #endif
618 
619 #ifdef WARN_STANDARD_PRINTF
620 int vsnprintf(char *str, size_t size, const char* fmt, va_list args) CPL_WARN_DEPRECATED("Use CPLvsnprintf() instead");
621 int snprintf(char *str, size_t size, const char* fmt, ...) CPL_PRINT_FUNC_FORMAT(3,4) CPL_WARN_DEPRECATED("Use CPLsnprintf() instead");
622 int sprintf(char *str, const char* fmt, ...) CPL_PRINT_FUNC_FORMAT(2, 3) CPL_WARN_DEPRECATED("Use CPLsprintf() instead");
623 #endif
624 
625 #endif /* ndef CPL_BASE_H_INCLUDED */
int CPLsprintf(char *str, const char *fmt,...)
sprintf() wrapper that is not sensitive to LC_NUMERIC settings.
Definition: cpl_string.cpp:1343
int CPLsnprintf(char *str, size_t size, const char *fmt,...)
snprintf() wrapper that is not sensitive to LC_NUMERIC settings.
Definition: cpl_string.cpp:1316

Generated for GDAL by doxygen 1.8.11.