UpnpGlobal.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. #ifndef UPNPGLOBAL_H
  2. #define UPNPGLOBAL_H
  3. /*!
  4. * \file
  5. *
  6. * \brief Defines constants that for some reason are not defined on some systems.
  7. */
  8. #if defined MYLIB_LARGEFILE_SENSITIVE && _FILE_OFFSET_BITS+0 != 64
  9. #if defined __GNUC__
  10. #warning libupnp requires largefile mode - use AC_SYS_LARGEFILE
  11. #else
  12. #error libupnp requires largefile mode - use AC_SYS_LARGEFILE
  13. #endif
  14. #endif
  15. #ifdef WIN32
  16. /*
  17. * EXPORT_SPEC
  18. */
  19. #ifdef UPNP_STATIC_LIB
  20. #define EXPORT_SPEC
  21. #else /* UPNP_STATIC_LIB */
  22. #ifdef LIBUPNP_EXPORTS
  23. /*! set up declspec for dll export to make functions
  24. * visible to library users */
  25. #define EXPORT_SPEC __declspec(dllexport)
  26. #else /* LIBUPNP_EXPORTS */
  27. #define EXPORT_SPEC __declspec(dllimport)
  28. #endif /* LIBUPNP_EXPORTS */
  29. #endif /* UPNP_STATIC_LIB */
  30. /*
  31. * UPNP_INLINE
  32. * PRId64
  33. * PRIzd
  34. * PRIzu
  35. * PRIzx
  36. */
  37. #ifdef UPNP_USE_MSVCPP
  38. /* define some things the M$ VC++ doesn't know */
  39. #define UPNP_INLINE _inline
  40. typedef __int64 int64_t;
  41. #define PRId64 "I64d"
  42. #define PRIzd "ld"
  43. #define PRIzu "lu"
  44. #define PRIzx "lx"
  45. #endif /* UPNP_USE_MSVCPP */
  46. #ifdef UPNP_USE_BCBPP
  47. /* define some things Borland Builder doesn't know */
  48. #define UPNP_INLINE inline
  49. typedef __int64 int64_t;
  50. #warning The Borland C compiler is probably broken on PRId64,
  51. #warning please someone provide a proper fix here
  52. #define PRId64 "I64d"
  53. #define PRIzd "zd"
  54. #define PRIzu "zu"
  55. #define PRIzx "zx"
  56. #endif /* UPNP_USE_BCBPP */
  57. #ifdef __GNUC__
  58. #define UPNP_INLINE inline
  59. /* Note with PRIzu that in the case of Mingw32, it's the MS C
  60. * runtime printf which ends up getting called, not the glibc
  61. * printf, so it genuinely doesn't have "zu"
  62. */
  63. #define PRIzd "ld"
  64. #define PRIzu "lu"
  65. #define PRIzx "lx"
  66. #endif /* __GNUC__ */
  67. #else
  68. /*!
  69. * \brief Export functions on WIN32 DLLs.
  70. *
  71. * Every funtion that belongs to the library API must use this
  72. * definition upon declaration or it will not be exported on WIN32
  73. * DLLs.
  74. */
  75. #define EXPORT_SPEC
  76. /*!
  77. * \brief Declares an inline function.
  78. *
  79. * Surprisingly, there are some compilers that do not understand the
  80. * inline keyword. This definition makes the use of this keyword
  81. * portable to these systems.
  82. */
  83. #ifdef __STRICT_ANSI__
  84. #define UPNP_INLINE __inline__
  85. #else
  86. #define UPNP_INLINE inline
  87. #endif
  88. /*!
  89. * \brief Supply the PRId64 printf() macro.
  90. *
  91. * MSVC still does not know about this.
  92. */
  93. /* #define PRId64 PRId64 */
  94. /*!
  95. * \brief Supply the PRIz* printf() macros.
  96. *
  97. * These macros were invented so that we can live a little longer with
  98. * MSVC lack of C99. "z" is the correct printf() size specifier for
  99. * the size_t type.
  100. */
  101. #define PRIzd "zd"
  102. #define PRIzu "zu"
  103. #define PRIzx "zx"
  104. #endif
  105. /*
  106. * Defining this macro here gives some interesting information about unused
  107. * functions in the code. Of course, this should never go uncommented on a
  108. * release.
  109. */
  110. /*#define inline*/
  111. #endif /* UPNPGLOBAL_H */