libUPnP  1.14.19
UpnpGlobal.h
Go to the documentation of this file.
1 #ifndef UPNPGLOBAL_H
2 #define UPNPGLOBAL_H
3 
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  #if defined _MSC_VER || defined __BORLANDC__
24  #ifdef UPNP_STATIC_LIB
25  #define UPNP_EXPORT_SPEC
26  #else /* UPNP_STATIC_LIB */
27  #ifdef LIBUPNP_EXPORTS
28 
30  #define UPNP_EXPORT_SPEC __declspec(dllexport)
31  #else /* LIBUPNP_EXPORTS */
32  #define UPNP_EXPORT_SPEC __declspec(dllimport)
33  #endif /* LIBUPNP_EXPORTS */
34  #endif /* UPNP_STATIC_LIB */
35  #else /* _MSC_VER || __BORLANDC__ */
36  #define UPNP_EXPORT_SPEC
37  #endif /* _MSC_VER || __BORLANDC__ */
38 
39  /*
40  * UPNP_INLINE
41  * PRId64
42  * PRIzd
43  * PRIzu
44  * PRIzx
45  */
46  #ifdef UPNP_USE_MSVCPP
47  /* define some things the M$ VC++ doesn't know */
48  #define UPNP_INLINE _inline
49 typedef __int64 int64_t;
50  #define PRIzd "ld"
51  #define PRIzu "lu"
52  #define PRIzx "lx"
53  #endif /* UPNP_USE_MSVCPP */
54 
55  #ifdef UPNP_USE_BCBPP
56  /* define some things Borland Builder doesn't know */
57  /* inconsistency between the httpparser.h and the .c file
58  definition. Header is missing UPNP_INLINE prefix, so compiler
59  is confused ... better remove it #define UPNP_INLINE inline
60  */
61  #define UPNP_INLINE
62 typedef __int64 int64_t;
63  #warning The Borland C compiler is probably broken on PRId64,
64  #warning please someone provide a proper fix here
65  #define PRId64 "Ld"
66  #define PRIzd "ld"
67  #define PRIzu "lu"
68  #define PRIzx "lx"
69  #define SCNd64 "Ld"
70  #endif /* UPNP_USE_BCBPP */
71 
72  #ifdef __GNUC__
73  #define UPNP_INLINE inline
74  /* Note with PRIzu that in the case of Mingw32, it's the MS C
75  * runtime printf which ends up getting called, not the glibc
76  * printf, so it genuinely doesn't have "zu"
77  */
78  #define PRIzd "ld"
79  #define PRIzu "lu"
80  #define PRIzx "lx"
81  #endif /* __GNUC__ */
82 #else
83 
89  #ifdef UPNP_STATIC_LIB
90  #define UPNP_EXPORT_SPEC
91  #else /* UPNP_STATIC_LIB */
92  #ifdef LIBUPNP_EXPORTS
93 
95  #define UPNP_EXPORT_SPEC \
96  __attribute__((visibility("default")))
97  #else /* LIBUPNP_EXPORTS */
98  #define UPNP_EXPORT_SPEC
99  #endif /* LIBUPNP_EXPORTS */
100  #endif
101 
109  #ifdef __STRICT_ANSI__
110  #define UPNP_INLINE __inline__
111  #else
112  #define UPNP_INLINE inline
113  #endif
114 
120  /* #define PRId64 PRId64 */
121 
129  #define PRIzd "zd"
130  #define PRIzu "zu"
131  #define PRIzx "zx"
132 #endif
133 
134 /*
135  * Defining this macro here gives some interesting information about unused
136  * functions in the code. Of course, this should never go uncommented on a
137  * release.
138  */
139 /*#define inline*/
140 
141 #endif /* UPNPGLOBAL_H */