You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

161 lines
4.5 KiB

  1. // -*- C++ -*-
  2. // Module: Log4CPLUS
  3. // File: config-win32.h
  4. // Created: 4/2003
  5. // Author: Tad E. Smith
  6. //
  7. //
  8. // Copyright 2003-2010 Tad E. Smith
  9. //
  10. // Licensed under the Apache License, Version 2.0 (the "License");
  11. // you may not use this file except in compliance with the License.
  12. // You may obtain a copy of the License at
  13. //
  14. // http://www.apache.org/licenses/LICENSE-2.0
  15. //
  16. // Unless required by applicable law or agreed to in writing, software
  17. // distributed under the License is distributed on an "AS IS" BASIS,
  18. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  19. // See the License for the specific language governing permissions and
  20. // limitations under the License.
  21. /** @file */
  22. #ifndef LOG4CPLUS_CONFIG_WIN32_HEADER_
  23. #define LOG4CPLUS_CONFIG_WIN32_HEADER_
  24. #if defined (LOG4CPLUS_HAVE_PRAGMA_ONCE)
  25. #pragma once
  26. #endif
  27. #ifdef _WIN32
  28. #if (defined (_MSC_VER) && _MSC_VER >= 1400) || defined (__MINGW32__)
  29. # define LOG4CPLUS_HAVE_INTRIN_H
  30. #endif
  31. // Time related functions and headers.
  32. #define LOG4CPLUS_HAVE_TIME_H
  33. #define LOG4CPLUS_HAVE_SYS_TIMEB_H
  34. #define LOG4CPLUS_HAVE_FTIME
  35. #if defined (_MSC_VER) || defined (__BORLANDC__)
  36. #define LOG4CPLUS_HAVE_GMTIME_S
  37. #endif
  38. // Use Winsock on Windows.
  39. #define LOG4CPLUS_USE_WINSOCK
  40. // Enable Win32DebugAppender
  41. #define LOG4CPLUS_HAVE_OUTPUTDEBUGSTRING
  42. // Enable Win32ConsoleAppender.
  43. #define LOG4CPLUS_HAVE_WIN32_CONSOLE
  44. #define LOG4CPLUS_HAVE_SYS_TYPES_H
  45. #define LOG4CPLUS_HAVE_SYS_LOCKING_H
  46. #define LOG4CPLUS_HAVE_FCNTL_H
  47. #define LOG4CPLUS_HAVE_IO_H
  48. #define LOG4CPLUS_HAVE_STDIO_H
  49. #define LOG4CPLUS_HAVE_WCHAR_H
  50. #define LOG4CPLUS_HAVE_STDARG_H
  51. #define LOG4CPLUS_HAVE_STDLIB_H
  52. #define LOG4CPLUS_HAVE_ERRNO_H
  53. #define LOG4CPLUS_HAVE_SYS_STAT_H
  54. #define LOG4CPLUS_HAVE_TIME_H
  55. #define LOG4CPLUS_HAVE_STDLIB_H
  56. // MSVC has both and so does MinGW.
  57. #define LOG4CPLUS_HAVE_VSNPRINTF
  58. #define LOG4CPLUS_HAVE__VSNPRINTF
  59. #if defined (_MSC_VER) || defined (__MINGW32__)
  60. // MS secure versions of vprintf().
  61. # define LOG4CPLUS_HAVE_VSPRINTF_S
  62. # define LOG4CPLUS_HAVE_VSWPRINTF_S
  63. // MS secure versions of vfprintf().
  64. # define LOG4CPLUS_HAVE_VFPRINTF_S
  65. # define LOG4CPLUS_HAVE_VFWPRINTF_S
  66. // MS secure versions of vsnprintf().
  67. # define LOG4CPLUS_HAVE_VSNPRINTF_S
  68. # define LOG4CPLUS_HAVE__VSNPRINTF_S
  69. # define LOG4CPLUS_HAVE__VSNWPRINTF_S
  70. #endif
  71. #define LOG4CPLUS_DLLMAIN_HINSTANCE HINSTANCE
  72. #define LOG4CPLUS_HAVE_NT_EVENT_LOG
  73. // log4cplus_EXPORTS is used by the CMake build system. DLL_EXPORT is
  74. // used by the autotools build system.
  75. #if (defined (log4cplus_EXPORTS) || defined (log4cplusU_EXPORTS) \
  76. || defined (DLL_EXPORT)) \
  77. && ! defined (LOG4CPLUS_STATIC)
  78. # undef LOG4CPLUS_BUILD_DLL
  79. # define LOG4CPLUS_BUILD_DLL
  80. #endif
  81. #if ! defined (LOG4CPLUS_BUILD_DLL)
  82. # undef LOG4CPLUS_STATIC
  83. # define LOG4CPLUS_STATIC
  84. #endif
  85. #if defined (LOG4CPLUS_STATIC) && defined (LOG4CPLUS_BUILD_DLL)
  86. # error LOG4CPLUS_STATIC and LOG4CPLUS_BUILD_DLL cannot be defined both.
  87. #endif
  88. #if defined (LOG4CPLUS_BUILD_DLL)
  89. # if defined (INSIDE_LOG4CPLUS)
  90. # define LOG4CPLUS_EXPORT __declspec(dllexport)
  91. # else
  92. # define LOG4CPLUS_EXPORT __declspec(dllimport)
  93. # endif
  94. #else
  95. # define LOG4CPLUS_EXPORT
  96. #endif
  97. #ifndef LOG4CPLUS_SINGLE_THREADED
  98. # define LOG4CPLUS_USE_WIN32_THREADS
  99. #endif
  100. #if defined (_WIN32_WINNT) && _WIN32_WINNT < 0x0600
  101. # define LOG4CPLUS_POOR_MANS_SHAREDMUTEX
  102. #endif
  103. #if defined(_MSC_VER)
  104. // Warning about: identifier was truncated to '255' characters in the debug information
  105. # pragma warning( disable : 4786 )
  106. // Warning about: <type1> needs to have dll-interface to be used by clients of class <type2>
  107. # pragma warning( disable : 4251 )
  108. # define LOG4CPLUS_INLINES_ARE_EXPORTED
  109. # if _MSC_VER >= 1400
  110. # define LOG4CPLUS_WORKING_LOCALE
  111. # define LOG4CPLUS_HAVE_FUNCTION_MACRO
  112. # define LOG4CPLUS_HAVE_FUNCSIG_MACRO
  113. # define LOG4CPLUS_HAVE_C99_VARIADIC_MACROS
  114. # endif
  115. #endif
  116. #if defined (__GNUC__)
  117. # undef LOG4CPLUS_INLINES_ARE_EXPORTED
  118. # if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
  119. # define LOG4CPLUS_INLINES_ARE_EXPORTED
  120. # define LOG4CPLUS_HAVE___SYNC_SUB_AND_FETCH
  121. # define LOG4CPLUS_HAVE___SYNC_ADD_AND_FETCH
  122. # endif
  123. # define LOG4CPLUS_HAVE_FUNCTION_MACRO
  124. # define LOG4CPLUS_HAVE_GNU_VARIADIC_MACROS
  125. # define LOG4CPLUS_HAVE_C99_VARIADIC_MACROS
  126. # if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
  127. # define LOG4CPLUS_HAVE_PRETTY_FUNCTION_MACRO
  128. # endif
  129. # if defined (__MINGW32__)
  130. # define LOG4CPLUS_WORKING_C_LOCALE
  131. # endif
  132. #endif
  133. #endif // _WIN32
  134. #endif // LOG4CPLUS_CONFIG_WIN32_HEADER_