apu.hw 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. /* Copyright 2000-2005 The Apache Software Foundation or its licensors, as
  2. * applicable.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. /*
  17. * Note: This is a Windows specific version of apu.h. It is renamed to
  18. * apu.h at the start of a Windows build.
  19. */
  20. /* @file apu.h
  21. * @brief APR-Utility main file
  22. */
  23. #ifdef WIN32
  24. #ifndef APU_H
  25. #define APU_H
  26. /**
  27. * @defgroup APR_Util APR Utility Functions
  28. * @{
  29. */
  30. /**
  31. * APU_DECLARE_EXPORT is defined when building the APR-UTIL dynamic library,
  32. * so that all public symbols are exported.
  33. *
  34. * APU_DECLARE_STATIC is defined when including the APR-UTIL public headers,
  35. * to provide static linkage when the dynamic library may be unavailable.
  36. *
  37. * APU_DECLARE_STATIC and APU_DECLARE_EXPORT are left undefined when
  38. * including the APR-UTIL public headers, to import and link the symbols from
  39. * the dynamic APR-UTIL library and assure appropriate indirection and calling
  40. * conventions at compile time.
  41. */
  42. #if defined(DOXYGEN) || !defined(WIN32)
  43. /**
  44. * The public APR-UTIL functions are declared with APU_DECLARE(), so they may
  45. * use the most appropriate calling convention. Public APR functions with
  46. * variable arguments must use APU_DECLARE_NONSTD().
  47. *
  48. * @deffunc APU_DECLARE(rettype) apr_func(args);
  49. */
  50. #define APU_DECLARE(type) type
  51. /**
  52. * The public APR-UTIL functions using variable arguments are declared with
  53. * APU_DECLARE_NONSTD(), as they must use the C language calling convention.
  54. *
  55. * @deffunc APU_DECLARE_NONSTD(rettype) apr_func(args, ...);
  56. */
  57. #define APU_DECLARE_NONSTD(type) type
  58. /**
  59. * The public APR-UTIL variables are declared with APU_DECLARE_DATA.
  60. * This assures the appropriate indirection is invoked at compile time.
  61. *
  62. * @deffunc APU_DECLARE_DATA type apr_variable;
  63. * @tip extern APU_DECLARE_DATA type apr_variable; syntax is required for
  64. * declarations within headers to properly import the variable.
  65. */
  66. #define APU_DECLARE_DATA
  67. #elif defined(APU_DECLARE_STATIC)
  68. #define APU_DECLARE(type) type __stdcall
  69. #define APU_DECLARE_NONSTD(type) type __cdecl
  70. #define APU_DECLARE_DATA
  71. #elif defined(APU_DECLARE_EXPORT)
  72. #define APU_DECLARE(type) __declspec(dllexport) type __stdcall
  73. #define APU_DECLARE_NONSTD(type) __declspec(dllexport) type __cdecl
  74. #define APU_DECLARE_DATA __declspec(dllexport)
  75. #else
  76. #define APU_DECLARE(type) __declspec(dllimport) type __stdcall
  77. #define APU_DECLARE_NONSTD(type) __declspec(dllimport) type __cdecl
  78. #define APU_DECLARE_DATA __declspec(dllimport)
  79. #endif
  80. /** @} */
  81. /*
  82. * we always have SDBM (it's in our codebase)
  83. */
  84. #define APU_HAVE_SDBM 1
  85. #define APU_HAVE_GDBM 0
  86. /* Allow external override */
  87. #if !defined(APU_HAVE_DB)
  88. #define APU_HAVE_DB 0
  89. #endif
  90. #define APU_HAVE_APR_ICONV 0
  91. #define APU_HAVE_ICONV 0
  92. #define APR_HAS_XLATE (APU_HAVE_APR_ICONV || APU_HAVE_ICONV)
  93. #if !defined(APU_HAVE_PGSQL)
  94. #define APU_HAVE_PGSQL 0
  95. #endif
  96. #if !defined(APU_HAVE_SQLITE2)
  97. #define APU_HAVE_SQLITE2 0
  98. #endif
  99. #if !defined(APU_HAVE_SQLITE3)
  100. #define APU_HAVE_SQLITE3 0
  101. #endif
  102. #endif /* APU_H */
  103. #endif /* WIN32 */