Leptonica  1.82.0
Image processing and image analysis suite
environ.h
1 /*====================================================================*
2  - Copyright (C) 2001 Leptonica. All rights reserved.
3  -
4  - Redistribution and use in source and binary forms, with or without
5  - modification, are permitted provided that the following conditions
6  - are met:
7  - 1. Redistributions of source code must retain the above copyright
8  - notice, this list of conditions and the following disclaimer.
9  - 2. Redistributions in binary form must reproduce the above
10  - copyright notice, this list of conditions and the following
11  - disclaimer in the documentation and/or other materials
12  - provided with the distribution.
13  -
14  - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
15  - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
16  - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
17  - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANY
18  - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19  - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
20  - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
21  - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
22  - OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
23  - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24  - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25  *====================================================================*/
26 
27 #ifndef LEPTONICA_ENVIRON_H
28 #define LEPTONICA_ENVIRON_H
29 
30 /*------------------------------------------------------------------------*
31  * Defines and includes differ for Unix and Windows. Also for Windows, *
32  * differentiate between conditionals based on platform and compiler. *
33  * For platforms: *
34  * _WIN32 => Windows, 32- or 64-bit *
35  * _WIN64 => Windows, 64-bit only *
36  * __CYGWIN__ => Cygwin *
37  * For compilers: *
38  * __GNUC__ => gcc *
39  * _MSC_VER => msvc *
40  *------------------------------------------------------------------------*/
41 
42 /* MS VC++ does not provide stdint.h, so define the missing types here */
43 
44 
45 #ifndef _MSC_VER
46 #include <stdint.h>
47 
48 #else
49 /* Note that _WIN32 is defined for both 32 and 64 bit applications,
50  whereas _WIN64 is defined only for the latter */
51 
52 #ifdef _WIN64
53 typedef __int64 intptr_t;
54 typedef unsigned __int64 uintptr_t;
55 #else
56 typedef int intptr_t;
57 typedef unsigned int uintptr_t;
58 #endif
59 
60 /* VC++6 doesn't seem to have powf, expf. */
61 #if (_MSC_VER < 1400)
62 #define powf(x, y) (float)pow((double)(x), (double)(y))
63 #define expf(x) (float)exp((double)(x))
64 #endif
65 
66 #endif /* _MSC_VER */
67 
68 #ifndef LEPT_DLL
69  /* Windows specifics */
70  #ifdef _WIN32
71  /* DLL EXPORTS and IMPORTS */
72  #if defined(LIBLEPT_EXPORTS)
73  #define LEPT_DLL __declspec(dllexport)
74  #elif defined(LIBLEPT_IMPORTS)
75  #define LEPT_DLL __declspec(dllimport)
76  #else
77  #define LEPT_DLL
78  #endif
79  #else /* non-Windows specifics */
80  #define LEPT_DLL
81  #endif /* _WIN32 */
82 #endif /* LEPT_DLL */
83 
84 #ifndef _WIN32 /* non-Windows specifics */
85  #include <stdint.h>
86 #endif /* _WIN32 */
87 
88 typedef intptr_t l_intptr_t;
89 typedef uintptr_t l_uintptr_t;
90 
91 
92 /*--------------------------------------------------------------------*
93  * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*
94  * USER CONFIGURABLE *
95  * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*
96  * Environment variables with I/O libraries *
97  * Manual Configuration Only: NOT AUTO_CONF *
98  *--------------------------------------------------------------------*/
99 /*
100  * Leptonica provides interfaces to link to several external image
101  * I/O libraries, plus zlib. Setting any of these to 0 here causes
102  * non-functioning stubs to be linked.
103  */
104 #if !defined(HAVE_CONFIG_H) && !defined(ANDROID_BUILD) && !defined(OS_IOS)
105 
106  #if !defined(HAVE_LIBJPEG)
107  #define HAVE_LIBJPEG 1
108  #endif
109  #if !defined(HAVE_LIBTIFF)
110  #define HAVE_LIBTIFF 1
111  #endif
112  #if !defined(HAVE_LIBPNG)
113  #define HAVE_LIBPNG 1
114  #endif
115  #if !defined(HAVE_LIBZ)
116  #define HAVE_LIBZ 1
117  #endif
118  #if !defined(HAVE_LIBGIF)
119  #define HAVE_LIBGIF 0
120  #endif
121  #if !defined(HAVE_LIBUNGIF)
122  #define HAVE_LIBUNGIF 0
123  #endif
124  #if !defined(HAVE_LIBWEBP)
125  #define HAVE_LIBWEBP 0
126  #endif
127  #if !defined(HAVE_LIBWEBP_ANIM)
128  #define HAVE_LIBWEBP_ANIM 0
129  #endif
130  #if !defined(HAVE_LIBJP2K)
131  #define HAVE_LIBJP2K 0
132  #endif
133 
134 
135  /*-----------------------------------------------------------------------*
136  * Leptonica supports OpenJPEG 2.0+. If you have a version of openjpeg *
137  * (HAVE_LIBJP2K == 1) that is >= 2.0, set the path to the openjpeg.h *
138  * header in angle brackets here. *
139  *-----------------------------------------------------------------------*/
140  #define LIBJP2K_HEADER <openjpeg-2.3/openjpeg.h>
141 
142 #endif /* ! HAVE_CONFIG_H etc. */
143 
144 /*--------------------------------------------------------------------*
145  * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*
146  * USER CONFIGURABLE *
147  * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*
148  * Environ variables for image I/O without external libraries *
149  *--------------------------------------------------------------------*/
150 /*
151  * Leptonica supplies I/O support without using external libraries for:
152  * * image read/write for bmp, pnm
153  * * header read for jp2k
154  * * image wrapping write for pdf and ps.
155  * Setting any of these to 0 causes non-functioning stubs to be linked.
156  */
157 #define USE_BMPIO 1
158 #define USE_PNMIO 1
159 #define USE_JP2KHEADER 1
160 #define USE_PDFIO 1
161 #define USE_PSIO 1
162 
163 
164 /*-------------------------------------------------------------------------*
165  * On linux systems, you can do I/O between Pix and memory. Specifically,
166  * you can compress (write compressed data to memory from a Pix) and
167  * uncompress (read from compressed data in memory to a Pix).
168  * For jpeg, png, jp2k, gif, pnm and bmp, these use the non-posix GNU
169  * functions fmemopen() and open_memstream(). These functions are not
170  * available on other systems.
171  * To use these functions in linux, you must define HAVE_FMEMOPEN to 1.
172  * To use them on MacOS, which does not support these functions, set it to 0.
173  *-------------------------------------------------------------------------*/
174 #if !defined(HAVE_CONFIG_H) && !defined(ANDROID_BUILD) && !defined(OS_IOS) && \
175  !defined(_WIN32)
176 #define HAVE_FMEMOPEN 1
177 #endif /* ! HAVE_CONFIG_H etc. */
178 
179 /*-------------------------------------------------------------------------*
180  * fstatat() is defined by POSIX, but some systems do not support it. *
181  * One example is older macOS systems (pre-10.10). *
182  * Play it safe and set the default value to 0. *
183  *-------------------------------------------------------------------------*/
184 #if !defined(HAVE_CONFIG_H)
185 #define HAVE_FSTATAT 0
186 #endif /* ! HAVE_CONFIG_H */
187 
188 /*--------------------------------------------------------------------*
189  * It is desirable on Windows to have all temp files written to the same
190  * subdirectory of the Windows <Temp> directory, because files under <Temp>
191  * persist after reboot, and the regression tests write a lot of files.
192  * We write all test files to /tmp/lept or subdirectories of /tmp/lept.
193  * Windows temp files are specified as in unix, but have the translation
194  * /tmp/lept/xxx --> <Temp>/lept/xxx
195  *--------------------------------------------------------------------*/
196 
197 
198 /*--------------------------------------------------------------------*
199  * Built-in types *
200  *--------------------------------------------------------------------*/
201 typedef int l_ok;
202 typedef signed char l_int8;
203 typedef unsigned char l_uint8;
204 typedef short l_int16;
205 typedef unsigned short l_uint16;
206 typedef int l_int32;
207 typedef unsigned int l_uint32;
208 typedef float l_float32;
209 typedef double l_float64;
210 #ifdef COMPILER_MSVC
211 typedef __int64 l_int64;
212 typedef unsigned __int64 l_uint64;
213 #else
214 typedef long long l_int64;
215 typedef unsigned long long l_uint64;
216 #endif /* COMPILER_MSVC */
217 
218 
219 /*-------------------------------------------------------------------------*
220  * For security, the library is distributed in a configuration that does *
221  * not permit (1) forking with 'system', which is used for displaying *
222  * images and generating gnuplots, and (2) writing files with specified *
223  * compiled-in file names. All such writes are with functions such as *
224  * pixWriteDebug() where the "Debug" is appended to the usual name. *
225  * Whether the "Debug" version defaults to the standard version or is a *
226  * no-op depends on the value of this global variable. The default value *
227  * of LeptDebugOK is 0, and it is set in writefile.c. This value can be *
228  * over-ridden, for development and debugging, by setLeptDebugOK(). *
229  *-------------------------------------------------------------------------*/
230 LEPT_DLL extern l_int32 LeptDebugOK; /* default is 0 */
231 
232 
233 /*------------------------------------------------------------------------*
234  * Standard macros *
235  *------------------------------------------------------------------------*/
236 #ifndef L_MIN
237 
238 #define L_MIN(x, y) (((x) < (y)) ? (x) : (y))
239 #endif
240 
241 #ifndef L_MAX
242 
243 #define L_MAX(x, y) (((x) > (y)) ? (x) : (y))
244 #endif
245 
246 #ifndef L_ABS
247 
248 #define L_ABS(x) (((x) < 0) ? (-1 * (x)) : (x))
249 #endif
250 
251 #ifndef L_SIGN
252 
253 #define L_SIGN(x) (((x) < 0) ? -1 : 1)
254 #endif
255 
256 #ifndef UNDEF
257 
258 #define UNDEF -1
259 #endif
260 
261 #ifndef NULL
262 
263 #define NULL 0
264 #endif
265 
266 #ifndef TRUE
267 
268 #define TRUE 1
269 #endif
270 
271 #ifndef FALSE
272 
273 #define FALSE 0
274 #endif
275 
276 
277 /*--------------------------------------------------------------------*
278  * Environment variables for endian dependence *
279  *--------------------------------------------------------------------*/
280 /*
281  * To control conditional compilation, one of two variables
282  *
283  * L_LITTLE_ENDIAN (e.g., for Intel X86)
284  * L_BIG_ENDIAN (e.g., for Sun SPARC, Mac Power PC)
285  *
286  * is defined when the GCC compiler is invoked.
287  * All code should compile properly for both hardware architectures.
288  */
289 
290 
291 /*------------------------------------------------------------------------*
292  * Simple search state variables *
293  *------------------------------------------------------------------------*/
295 enum {
296  L_NOT_FOUND = 0,
297  L_FOUND = 1
298 };
299 
300 
301 /*------------------------------------------------------------------------*
302  * Path separator conversion *
303  *------------------------------------------------------------------------*/
305 enum {
306  UNIX_PATH_SEPCHAR = 0,
307  WIN_PATH_SEPCHAR = 1
308 };
309 
310 
311 /*------------------------------------------------------------------------*
312  * Timing structs *
313  *------------------------------------------------------------------------*/
314 typedef void *L_TIMER;
315 
317 struct L_WallTimer {
318  l_int32 start_sec;
319  l_int32 start_usec;
320  l_int32 stop_sec;
321  l_int32 stop_usec;
322 };
323 typedef struct L_WallTimer L_WALLTIMER;
324 
325 
326 /*------------------------------------------------------------------------*
327  * Standard memory allocation *
328  * *
329  * All default heap allocation is through the system malloc and free. *
330  * *
331  * Leptonica also provides non-default allocation in two situations: *
332  * *
333  * (1) A special allocator/deallocator pair can be provided for the *
334  * pix image data array. This might be useful to prevent memory *
335  * fragmentation when large images are repeatedly allocated and *
336  * freed. See the PixMemoryManager in pix1.c for details, *
337  * where the default is defined. *
338  * *
339  * (2) Special allocator/deallocators can be provided for ALL heap *
340  * allocation if required, for example, for embedded systems. *
341  * For such builds, define LEPTONICA_INTERCEPT_ALLOC, and provide *
342  * custom leptonica_{malloc, calloc, realloc, free} functions. *
343  *------------------------------------------------------------------------*/
344 #ifdef LEPTONICA_INTERCEPT_ALLOC
345  #define LEPT_MALLOC(blocksize) leptonica_malloc(blocksize)
346  #define LEPT_CALLOC(numelem, elemsize) leptonica_calloc(numelem, elemsize)
347  #define LEPT_REALLOC(ptr, blocksize) leptonica_realloc(ptr, blocksize)
348  #define LEPT_FREE(ptr) leptonica_free(ptr)
349  void *leptonica_malloc(size_t blocksize);
350  void *leptonica_calloc(size_t numelem, size_t elemsize);
351  void *leptonica_realloc(void *ptr, size_t blocksize);
352  void leptonica_free(void *ptr);
353 #else
354  #define LEPT_MALLOC(blocksize) malloc(blocksize)
355  #define LEPT_CALLOC(numelem, elemsize) calloc(numelem, elemsize)
356  #define LEPT_REALLOC(ptr, blocksize) realloc(ptr, blocksize)
357  #define LEPT_FREE(ptr) free(ptr)
358 #endif /* LEPTONICA_INTERCEPT_ALLOC */
359 
360 /*------------------------------------------------------------------------*
361  * Control printing of error, warning, and info messages *
362  * *
363  * Leptonica never sends output to stdout. By default, all messages *
364  * go to stderr. However, we provide a mechanism for runtime *
365  * redirection of output, using a custom stderr handler defined *
366  * by the user. See utils1.c for details and examples. *
367  * *
368  * To omit all messages to stderr, simply define NO_CONSOLE_IO on the *
369  * command line. For finer grained control, we have a mechanism *
370  * based on the message severity level. The following assumes that *
371  * NO_CONSOLE_IO is not defined. *
372  * *
373  * Messages are printed if the message severity is greater than or equal *
374  * to the current severity threshold. The current severity threshold *
375  * is the greater of the compile-time severity, which is the minimum *
376  * severity that can be reported, and the run-time severity, which is *
377  * the severity threshold at the moment. *
378  * *
379  * The compile-time threshold determines which messages are compiled *
380  * into the library for potential printing. Messages below the *
381  * compile-time threshold are omitted and can never be printed. The *
382  * default compile-time threshold is L_SEVERITY_INFO, but this may be *
383  * overridden by defining MINIMUM_SEVERITY to the desired enumeration *
384  * identifier on the compiler command line. Defining NO_CONSOLE_IO on *
385  * the command line is the same as setting MINIMUM_SEVERITY to *
386  * L_SEVERITY_NONE. *
387  * *
388  * The run-time threshold determines which messages are printed during *
389  * library execution. It defaults to the compile-time threshold but *
390  * may be changed either statically by defining DEFAULT_SEVERITY to *
391  * the desired enumeration identifier on the compiler command line, or *
392  * dynamically by calling setMsgSeverity() to specify a new threshold. *
393  * The run-time threshold may also be set from the value of the *
394  * environment variable LEPT_MSG_SEVERITY by calling setMsgSeverity() *
395  * and specifying L_SEVERITY_EXTERNAL. *
396  * *
397  * In effect, the compile-time threshold setting says, "Generate code *
398  * to permit messages of equal or greater severity than this to be *
399  * printed, if desired," whereas the run-time threshold setting says, *
400  * "Print messages that have an equal or greater severity than this." *
401  *------------------------------------------------------------------------*/
402 
405 enum {
406  L_SEVERITY_EXTERNAL = 0, /* Get the severity from the environment */
407  L_SEVERITY_ALL = 1, /* Lowest severity: print all messages */
408  L_SEVERITY_DEBUG = 2, /* Print debugging and higher messages */
409  L_SEVERITY_INFO = 3, /* Print informational and higher messages */
410  L_SEVERITY_WARNING = 4, /* Print warning and higher messages */
411  L_SEVERITY_ERROR = 5, /* Print error and higher messages */
412  L_SEVERITY_NONE = 6 /* Highest severity: print no messages */
413 };
414 
415 /* No message less than the compile-time threshold will ever be
416  * reported, regardless of the current run-time threshold. This allows
417  * selection of the set of messages to include in the library. For
418  * example, setting the threshold to L_SEVERITY_WARNING eliminates all
419  * informational messages from the library. With that setting, both
420  * warning and error messages would be printed unless setMsgSeverity()
421  * was called, or DEFAULT_SEVERITY was redefined, to set the run-time
422  * severity to L_SEVERITY_ERROR. In that case, only error messages
423  * would be printed.
424  *
425  * This mechanism makes the library smaller and faster, by eliminating
426  * undesired message reporting and the associated run-time overhead for
427  * message threshold checking, because code for messages whose severity
428  * is lower than MINIMUM_SEVERITY won't be generated.
429  *
430  * A production library might typically permit ERROR messages to be
431  * generated, and a development library might permit DEBUG and higher.
432  * The actual messages printed (as opposed to generated) would depend
433  * on the current run-time severity threshold.
434  *
435  * This is a complex mechanism and a few examples may help.
436  * (1) No output permitted under any circumstances.
437  * Use: -DNO_CONSOLE_IO or -DMINIMUM_SEVERITY=6
438  * (2) Suppose you want to only allow error messages, and you don't
439  * want to permit info or warning messages at runtime.
440  * Use: -DMINIMUM_SEVERITY=5
441  * (3) Suppose you want to only allow error messages by default,
442  * but you will permit this to be over-ridden at runtime.
443  * Use: -DDEFAULT_SEVERITY=5
444  * and to allow info and warning override:
445  * setMsgSeverity(L_SEVERITY_INFO);
446  */
447 
448 #ifdef NO_CONSOLE_IO
449  #undef MINIMUM_SEVERITY
450  #undef DEFAULT_SEVERITY
451 
452  #define MINIMUM_SEVERITY L_SEVERITY_NONE
453  #define DEFAULT_SEVERITY L_SEVERITY_NONE
455 #else
456  #ifndef MINIMUM_SEVERITY
457  #define MINIMUM_SEVERITY L_SEVERITY_INFO
458  #endif
459 
460  #ifndef DEFAULT_SEVERITY
461  #define DEFAULT_SEVERITY MINIMUM_SEVERITY
462  #endif
463 #endif
464 
465 
467 LEPT_DLL extern l_int32 LeptMsgSeverity;
468 
469 /*
470  * <pre>
471  * Usage
472  * =====
473  * Messages are of two types.
474  *
475  * (1) The messages
476  * ERROR_INT(a,b,c) : returns l_int32
477  * ERROR_FLOAT(a,b,c) : returns l_float32
478  * ERROR_PTR(a,b,c) : returns void*
479  * are used to return from functions and take a fixed set of parameters:
480  * a : <message string>
481  * b : procName
482  * c : <return value from function>
483  * where procName is the name of the local variable naming the function.
484  *
485  * (2) The purely informational L_* messages
486  * L_ERROR(a,...)
487  * L_WARNING(a,...)
488  * L_INFO(a,...)
489  * do not take a return value, but they take at least two parameters:
490  * a : <message string> with optional format conversions
491  * v1 : procName (this must be included as the first vararg)
492  * v2, ... : optional varargs to match format converters in the message
493  *
494  * To return an error from a function that returns void, use:
495  * L_ERROR(<message string>, procName, [...])
496  * return;
497  *
498  * Implementation details
499  * ======================
500  * Messages are defined with the IF_SEV macro. The first parameter is
501  * the message severity, the second is the function to call if the
502  * message is to be printed, and the third is the return value if the
503  * message is to be suppressed. For example, we might have an
504  * informational message defined as:
505  *
506  * IF_SEV(L_SEVERITY_INFO, fprintf(.......), 0)
507  *
508  * The macro expands into a conditional. Because the first comparison
509  * is between two constants, an optimizing compiler will remove either
510  * the comparison (if it's true) or the entire macro expansion (if it
511  * is false). This means that there is no run-time overhead for
512  * messages whose severity falls below the minimum specified at compile
513  * time, and for others the overhead is one (not two) comparisons.
514  *
515  * The L_nnn() macros below do not return a value, but because the
516  * conditional operator requires one for the false condition, we
517  * specify a void expression.
518  * </pre>
519  */
520 
521 #ifdef NO_CONSOLE_IO
522 
523  #define PROCNAME(name)
524  #define ERROR_INT(a, b, c) ((l_int32)(c))
525  #define ERROR_FLOAT(a, b, c) ((l_float32)(c))
526  #define ERROR_PTR(a, b, c) ((void *)(c))
527  #define L_ERROR(a, ...)
528  #define L_WARNING(a, ...)
529  #define L_INFO(a, ...)
530 
531 #else
532 
533  #define PROCNAME(name) static const char procName[] = name
534  #define IF_SEV(l, t, f) \
535  ((l) >= MINIMUM_SEVERITY && (l) >= LeptMsgSeverity ? (t) : (f))
536 
537  #define ERROR_INT(a, b, c) \
538  IF_SEV(L_SEVERITY_ERROR, returnErrorInt((a), (b), (c)), (l_int32)(c))
539  #define ERROR_FLOAT(a, b, c) \
540  IF_SEV(L_SEVERITY_ERROR, returnErrorFloat((a), (b), (c)), (l_float32)(c))
541  #define ERROR_PTR(a, b, c) \
542  IF_SEV(L_SEVERITY_ERROR, returnErrorPtr((a), (b), (c)), (void *)(c))
543 
544  #define L_ERROR(a, ...) \
545  IF_SEV(L_SEVERITY_ERROR, \
546  (void)lept_stderr("Error in %s: " a, __VA_ARGS__), \
547  (void)0)
548  #define L_WARNING(a, ...) \
549  IF_SEV(L_SEVERITY_WARNING, \
550  (void)lept_stderr("Warning in %s: " a, __VA_ARGS__), \
551  (void)0)
552  #define L_INFO(a, ...) \
553  IF_SEV(L_SEVERITY_INFO, \
554  (void)lept_stderr("Info in %s: " a, __VA_ARGS__), \
555  (void)0)
556 
557 #if 0 /* Alternative method for controlling L_* message output */
558  #define L_ERROR(a, ...) \
559  { if (L_SEVERITY_ERROR >= MINIMUM_SEVERITY && \
560  L_SEVERITY_ERROR >= LeptMsgSeverity) \
561  lept_stderr("Error in %s: " a, __VA_ARGS__) \
562  }
563  #define L_WARNING(a, ...) \
564  { if (L_SEVERITY_WARNING >= MINIMUM_SEVERITY && \
565  L_SEVERITY_WARNING >= LeptMsgSeverity) \
566  lept_stderr("Warning in %s: " a, __VA_ARGS__) \
567  }
568  #define L_INFO(a, ...) \
569  { if (L_SEVERITY_INFO >= MINIMUM_SEVERITY && \
570  L_SEVERITY_INFO >= LeptMsgSeverity) \
571  lept_stderr("Info in %s: " a, __VA_ARGS__) \
572  }
573 #endif
574 
575 #endif /* NO_CONSOLE_IO */
576 
577 
578 /*------------------------------------------------------------------------*
579  * snprintf() renamed in MSVC (pre-VS2015) *
580  *------------------------------------------------------------------------*/
581 #if defined _MSC_VER && _MSC_VER < 1900
582 #define snprintf(buf, size, ...) _snprintf_s(buf, size, _TRUNCATE, __VA_ARGS__)
583 #endif
584 
585 
586 #endif /* LEPTONICA_ENVIRON_H */
LEPT_DLL l_int32 LeptMsgSeverity
Definition: utils1.c:119