libUPnP 2.0.1
UpnpGlobal.h
Go to the documentation of this file.
1#ifndef UPNPGLOBAL_H
2#define UPNPGLOBAL_H
3
10
11#if defined UPNP_LARGEFILE_SENSITIVE && _FILE_OFFSET_BITS + 0 != 64
12 #if defined __GNUC__
13 #warning libupnp requires largefile mode - use AC_SYS_LARGEFILE
14 #elif !defined _WIN32
15 #error libupnp requires largefile mode - use AC_SYS_LARGEFILE
16 #endif
17#endif
18
19#ifdef _WIN32
20 /*
21 * UPNP_EXPORT_SPEC
22 */
23 #ifdef UPNP_STATIC_LIB
24 #define UPNP_EXPORT_SPEC
25 #else /* UPNP_STATIC_LIB */
26 #ifdef LIBUPNP_EXPORTS
29 #define UPNP_EXPORT_SPEC __declspec(dllexport)
30 #else /* LIBUPNP_EXPORTS */
31 #define UPNP_EXPORT_SPEC __declspec(dllimport)
32 #endif /* LIBUPNP_EXPORTS */
33 #endif /* UPNP_STATIC_LIB */
34
35 /*
36 * UPNP_INLINE
37 * PRId64
38 * PRIzd
39 * PRIzu
40 * PRIzx
41 */
42 #ifdef UPNP_USE_MSVCPP
43 #if _MSC_VER > 1900
44 #define UPNP_INLINE inline
45 #define PRIzd "zd"
46 #define PRIzu "zu"
47 #define PRIzx "zx"
48 #else
49 /* define some things the M$ VC++ doesn't know */
50 #define UPNP_INLINE _inline
51typedef __int64 int64_t;
52 #define PRIzd "ld"
53 #define PRIzu "lu"
54 #define PRIzx "lx"
55 #endif
56 #endif /* UPNP_USE_MSVCPP */
57
58 #ifdef UPNP_USE_BCBPP
59 /* define some things Borland Builder doesn't know */
60 /* inconsistency between the httpparser.h and the .c file
61 definition. Header is missing UPNP_INLINE prefix, so compiler
62 is confused ... better remove it #define UPNP_INLINE inline
63 */
64 #define UPNP_INLINE
65typedef __int64 int64_t;
66 #warning The Borland C compiler is probably broken on PRId64,
67 #warning please someone provide a proper fix here
68 #define PRId64 "Ld"
69 #define PRIzd "ld"
70 #define PRIzu "lu"
71 #define PRIzx "lx"
72 #define SCNd64 "Ld"
73 #endif /* UPNP_USE_BCBPP */
74
75 #ifdef __GNUC__
76 #define UPNP_INLINE inline
77 /* Note with PRIzu that in the case of Mingw32, it's the MS C
78 * runtime printf which ends up getting called, not the glibc
79 * printf, so it genuinely doesn't have "zu"
80 */
81 #define PRIzd "ld"
82 #define PRIzu "lu"
83 #define PRIzx "lx"
84 #endif /* __GNUC__ */
85#else
92 #ifdef UPNP_STATIC_LIB
93 #define UPNP_EXPORT_SPEC
94 #else /* UPNP_STATIC_LIB */
95 #ifdef LIBUPNP_EXPORTS
98 #define UPNP_EXPORT_SPEC \
99 __attribute__((visibility("default")))
100 #else /* LIBUPNP_EXPORTS */
101 #define UPNP_EXPORT_SPEC
102 #endif /* LIBUPNP_EXPORTS */
103 #endif
104
112 #ifdef __STRICT_ANSI__
113 #define UPNP_INLINE __inline__
114 #else
115 #define UPNP_INLINE inline
116 #endif
117
123 /* #define PRId64 PRId64 */
124
132 #define PRIzd "zd"
133 #define PRIzu "zu"
134 #define PRIzx "zx"
135#endif
136
137/*
138 * Defining this macro here gives some interesting information about unused
139 * functions in the code. Of course, this should never go uncommented on a
140 * release.
141 */
142/*#define inline*/
143
144#endif /* UPNPGLOBAL_H */