libUPnP  1.14.0
UpnpGlobal.h
Go to the documentation of this file.
1 #ifndef UPNPGLOBAL_H
2 #define UPNPGLOBAL_H
3 
10 #if defined UPNP_LARGEFILE_SENSITIVE && _FILE_OFFSET_BITS+0 != 64
11  #if defined __GNUC__
12  #warning libupnp requires largefile mode - use AC_SYS_LARGEFILE
13  #elif !defined _WIN32
14  #error libupnp requires largefile mode - use AC_SYS_LARGEFILE
15  #endif
16 #endif
17 
18 #ifdef _WIN32
19  /*
20  * EXPORT_SPEC
21  */
22  #if defined _MSC_VER || defined __BORLANDC__
23  #ifdef UPNP_STATIC_LIB
24  #define EXPORT_SPEC
25  #else /* UPNP_STATIC_LIB */
26  #ifdef LIBUPNP_EXPORTS
27 
29  #define EXPORT_SPEC __declspec(dllexport)
30  #else /* LIBUPNP_EXPORTS */
31  #define EXPORT_SPEC __declspec(dllimport)
32  #endif /* LIBUPNP_EXPORTS */
33  #endif /* UPNP_STATIC_LIB */
34  #else /* _MSC_VER || __BORLANDC__ */
35  #define EXPORT_SPEC
36  #endif /* _MSC_VER || __BORLANDC__ */
37 
38  /*
39  * UPNP_INLINE
40  * PRId64
41  * PRIzd
42  * PRIzu
43  * PRIzx
44  */
45  #ifdef UPNP_USE_MSVCPP
46  /* define some things the M$ VC++ doesn't know */
47  #define UPNP_INLINE _inline
48  typedef __int64 int64_t;
49  #define PRId64 "I64d"
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 definition.
58  Header is missing UPNP_INLINE prefix, so compiler is confused ...
59  better remove it
60  #define UPNP_INLINE inline
61  */
62  #define UPNP_INLINE
63  typedef __int64 int64_t;
64  #warning The Borland C compiler is probably broken on PRId64,
65  #warning please someone provide a proper fix here
66  #define PRId64 "Ld"
67  #define PRIzd "ld"
68  #define PRIzu "lu"
69  #define PRIzx "lx"
70  #define SCNd64 "Ld"
71  #endif /* UPNP_USE_BCBPP */
72 
73  #ifdef __GNUC__
74  #define UPNP_INLINE inline
75  /* Note with PRIzu that in the case of Mingw32, it's the MS C
76  * runtime printf which ends up getting called, not the glibc
77  * printf, so it genuinely doesn't have "zu"
78  */
79  #define PRIzd "ld"
80  #define PRIzu "lu"
81  #define PRIzx "lx"
82  #endif /* __GNUC__ */
83 #else
84 
91  #define EXPORT_SPEC
92 
100  #ifdef __STRICT_ANSI__
101  #define UPNP_INLINE __inline__
102  #else
103  #define UPNP_INLINE inline
104  #endif
105 
111  /* #define PRId64 PRId64 */
112 
120  #define PRIzd "zd"
121  #define PRIzu "zu"
122  #define PRIzx "zx"
123 #endif
124 
125 /*
126  * Defining this macro here gives some interesting information about unused
127  * functions in the code. Of course, this should never go uncommented on a
128  * release.
129  */
130 /*#define inline*/
131 
132 #endif /* UPNPGLOBAL_H */