libUPnP  1.14.20
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
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  #if _MSC_VER > 1900
48  #define UPNP_INLINE inline
49  #define PRIzd "zd"
50  #define PRIzu "zu"
51  #define PRIzx "zx"
52  #else
53  /* define some things the M$ VC++ doesn't know */
54  #define UPNP_INLINE _inline
55 typedef __int64 int64_t;
56  #define PRIzd "ld"
57  #define PRIzu "lu"
58  #define PRIzx "lx"
59  #endif
60  #endif /* UPNP_USE_MSVCPP */
61 
62  #ifdef UPNP_USE_BCBPP
63  /* define some things Borland Builder doesn't know */
64  /* inconsistency between the httpparser.h and the .c file
65  definition. Header is missing UPNP_INLINE prefix, so compiler
66  is confused ... better remove it #define UPNP_INLINE inline
67  */
68  #define UPNP_INLINE
69 typedef __int64 int64_t;
70  #warning The Borland C compiler is probably broken on PRId64,
71  #warning please someone provide a proper fix here
72  #define PRId64 "Ld"
73  #define PRIzd "ld"
74  #define PRIzu "lu"
75  #define PRIzx "lx"
76  #define SCNd64 "Ld"
77  #endif /* UPNP_USE_BCBPP */
78 
79  #ifdef __GNUC__
80  #define UPNP_INLINE inline
81  /* Note with PRIzu that in the case of Mingw32, it's the MS C
82  * runtime printf which ends up getting called, not the glibc
83  * printf, so it genuinely doesn't have "zu"
84  */
85  #define PRIzd "ld"
86  #define PRIzu "lu"
87  #define PRIzx "lx"
88  #endif /* __GNUC__ */
89 #else
96  #ifdef UPNP_STATIC_LIB
97  #define UPNP_EXPORT_SPEC
98  #else /* UPNP_STATIC_LIB */
99  #ifdef LIBUPNP_EXPORTS
102  #define UPNP_EXPORT_SPEC \
103  __attribute__((visibility("default")))
104  #else /* LIBUPNP_EXPORTS */
105  #define UPNP_EXPORT_SPEC
106  #endif /* LIBUPNP_EXPORTS */
107  #endif
108 
116  #ifdef __STRICT_ANSI__
117  #define UPNP_INLINE __inline__
118  #else
119  #define UPNP_INLINE inline
120  #endif
121 
127  /* #define PRId64 PRId64 */
128 
136  #define PRIzd "zd"
137  #define PRIzu "zu"
138  #define PRIzx "zx"
139 #endif
140 
141 /*
142  * Defining this macro here gives some interesting information about unused
143  * functions in the code. Of course, this should never go uncommented on a
144  * release.
145  */
146 /*#define inline*/
147 
148 #endif /* UPNPGLOBAL_H */