comparison src/portable.h @ 55:3b3750063786 noffle

[svn] * src/portable.h: Added file. This #defines some macros, so the code uses __snprintf() and __vsnprintf if snprintf and vsnprintf aren't available. This is the case on SunOS, for example.
author uh1763
date Tue, 09 May 2000 23:32:33 +0100
parents
children c7df2cc65cc1
comparison
equal deleted inserted replaced
54:125d79c9e586 55:3b3750063786
1 /*
2 portable.h
3
4 Compatibility checks and fallback-functions.
5
6 $Id: portable.h 61 2000-05-09 22:32:33Z uh1763 $
7 */
8
9 #ifndef PORTABLE_H
10 #define PORTABLE_H /* To stop multiple inclusions. */
11
12
13 #if HAVE_CONFIG_H
14 #include <config.h>
15 #endif
16
17 #if !defined(HAVE_VSNPRINTF) && defined(HAVE___VSNPRINTF)
18 #undef vsnprintf
19 #define vsnprintf __vsnprintf
20 #define HAVE_VSNPRINTF
21 #endif
22
23 /* This is *not* good, because vsprintf() doesn't do any bounds-checking */
24 #if !defined(HAVE_VSNPRINTF) && !defined(HAVE___VSNPRINTF)
25 #define vsnprintf(c, len, fmt, args) vsprintf(c, fmt, args)
26 #define HAVE_VSNPRINTF
27 #endif
28
29 #if !defined(HAVE_SNPRINTF) && defined(HAVE___SNPRINTF)
30 #undef snprintf
31 #define snprintf __snprintf
32 #define HAVE_SNPRINTF
33 #endif
34
35
36 #endif
37