log4cplus  1.1.0
win32.h
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 // Module:  Log4CPLUS
00003 // File:    config-win32.h
00004 // Created: 4/2003
00005 // Author:  Tad E. Smith
00006 //
00007 //
00008 // Copyright 2003-2010 Tad E. Smith
00009 //
00010 // Licensed under the Apache License, Version 2.0 (the "License");
00011 // you may not use this file except in compliance with the License.
00012 // You may obtain a copy of the License at
00013 //
00014 //     http://www.apache.org/licenses/LICENSE-2.0
00015 //
00016 // Unless required by applicable law or agreed to in writing, software
00017 // distributed under the License is distributed on an "AS IS" BASIS,
00018 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00019 // See the License for the specific language governing permissions and
00020 // limitations under the License.
00021 
00024 #ifndef LOG4CPLUS_CONFIG_WIN32_HEADER_
00025 #define LOG4CPLUS_CONFIG_WIN32_HEADER_
00026 
00027 #if defined (LOG4CPLUS_HAVE_PRAGMA_ONCE)
00028 #pragma once
00029 #endif
00030 
00031 #if defined (__MINGW32__)  || defined (__MINGW64__)
00032 #  include <_mingw.h>
00033 #endif
00034 
00035 #ifdef _WIN32
00036 
00037 #if (defined (_MSC_VER) && _MSC_VER >= 1400) \
00038     || (defined (__MINGW64_VERSION_MAJOR) && __MINGW64_VERSION_MAJOR >= 3)
00039 #  define LOG4CPLUS_HAVE_INTRIN_H
00040 #endif
00041 
00042 // Time related functions and headers.
00043 #define LOG4CPLUS_HAVE_TIME_H
00044 #define LOG4CPLUS_HAVE_SYS_TIMEB_H
00045 #define LOG4CPLUS_HAVE_FTIME
00046 #if defined (_MSC_VER) || defined (__BORLANDC__) 
00047 #define LOG4CPLUS_HAVE_GMTIME_S
00048 #endif
00049 
00050 // Use Winsock on Windows.
00051 #define LOG4CPLUS_USE_WINSOCK
00052 
00053 // Enable Win32DebugAppender
00054 #define LOG4CPLUS_HAVE_OUTPUTDEBUGSTRING
00055 
00056 // Enable Win32ConsoleAppender.
00057 #define LOG4CPLUS_HAVE_WIN32_CONSOLE
00058 
00059 #define LOG4CPLUS_HAVE_SYS_TYPES_H
00060 #define LOG4CPLUS_HAVE_SYS_LOCKING_H
00061 #define LOG4CPLUS_HAVE_FCNTL_H
00062 #define LOG4CPLUS_HAVE_IO_H
00063 #define LOG4CPLUS_HAVE_STDIO_H
00064 #define LOG4CPLUS_HAVE_WCHAR_H
00065 #define LOG4CPLUS_HAVE_STDARG_H
00066 #define LOG4CPLUS_HAVE_STDLIB_H
00067 #define LOG4CPLUS_HAVE_ERRNO_H
00068 #define LOG4CPLUS_HAVE_SYS_STAT_H
00069 #define LOG4CPLUS_HAVE_TIME_H
00070 #define LOG4CPLUS_HAVE_STDLIB_H
00071 
00072 // MSVC has both and so does MinGW.
00073 #define LOG4CPLUS_HAVE_VSNPRINTF
00074 #define LOG4CPLUS_HAVE__VSNPRINTF
00075 #define LOG4CPLUS_HAVE__VSNWPRINTF
00076 
00077 #if defined (_MSC_VER) \
00078     || (defined (__MINGW64_VERSION_MAJOR) && __MINGW64_VERSION_MAJOR >= 3)
00079 // MS secure versions of vprintf().
00080 #  define LOG4CPLUS_HAVE_VSPRINTF_S
00081 #  define LOG4CPLUS_HAVE_VSWPRINTF_S
00082 
00083 // MS secure versions of vfprintf().
00084 #  define LOG4CPLUS_HAVE_VFPRINTF_S
00085 #  define LOG4CPLUS_HAVE_VFWPRINTF_S
00086 
00087 // MS secure versions of vsnprintf().
00088 #  define LOG4CPLUS_HAVE_VSNPRINTF_S
00089 #  define LOG4CPLUS_HAVE__VSNPRINTF_S
00090 #  define LOG4CPLUS_HAVE__VSNWPRINTF_S
00091 
00092 // MS printf-like functions supporting positional parameters.
00093 #  define LOG4CPLUS_HAVE__VSPRINTF_P
00094 #  define LOG4CPLUS_HAVE__VSWPRINTF_P
00095 
00096 // MS secure version of _tsopen().
00097 #  define LOG4CPLUS_HAVE__TSOPEN_S
00098 #endif
00099 
00100 #define LOG4CPLUS_HAVE__TSOPEN
00101 
00102 #define LOG4CPLUS_DLLMAIN_HINSTANCE HINSTANCE
00103 #define LOG4CPLUS_HAVE_NT_EVENT_LOG
00104 
00105 // log4cplus_EXPORTS is used by the CMake build system.  DLL_EXPORT is
00106 // used by the autotools build system.
00107 #if (defined (log4cplus_EXPORTS) || defined (log4cplusU_EXPORTS) \
00108      || defined (DLL_EXPORT))                                    \
00109     && ! defined (LOG4CPLUS_STATIC)
00110 #  undef LOG4CPLUS_BUILD_DLL
00111 #  define LOG4CPLUS_BUILD_DLL
00112 #endif
00113 
00114 #if ! defined (LOG4CPLUS_BUILD_DLL)
00115 #  undef LOG4CPLUS_STATIC
00116 #  define LOG4CPLUS_STATIC
00117 #endif
00118 
00119 #if defined (LOG4CPLUS_STATIC) && defined (LOG4CPLUS_BUILD_DLL)
00120 #  error LOG4CPLUS_STATIC and LOG4CPLUS_BUILD_DLL cannot be defined both.
00121 #endif
00122 
00123 #if defined (LOG4CPLUS_BUILD_DLL)
00124 #  if defined (INSIDE_LOG4CPLUS)
00125 #    define LOG4CPLUS_EXPORT __declspec(dllexport)
00126 #  else
00127 #    define LOG4CPLUS_EXPORT __declspec(dllimport)
00128 #  endif
00129 #else
00130 #  define LOG4CPLUS_EXPORT
00131 #endif
00132 
00133 #ifndef LOG4CPLUS_SINGLE_THREADED
00134 #  define LOG4CPLUS_USE_WIN32_THREADS
00135 #endif
00136 
00137 #if defined (_WIN32_WINNT) && _WIN32_WINNT < 0x0600
00138 #  define LOG4CPLUS_POOR_MANS_SHAREDMUTEX
00139 #endif
00140 
00141 #if defined(_MSC_VER)
00142   // Warning about: identifier was truncated to '255' characters in the debug information
00143 #  pragma warning( disable : 4786 )
00144   // Warning about: <type1> needs to have dll-interface to be used by clients of class <type2>
00145 #  pragma warning( disable : 4251 )
00146 
00147 #  define LOG4CPLUS_INLINES_ARE_EXPORTED
00148 
00149 #  if _MSC_VER >= 1400
00150 #    define LOG4CPLUS_WORKING_LOCALE
00151 #    define LOG4CPLUS_HAVE_FUNCTION_MACRO
00152 #    define LOG4CPLUS_HAVE_FUNCSIG_MACRO
00153 #    define LOG4CPLUS_HAVE_C99_VARIADIC_MACROS
00154 #    define LOG4CPLUS_ATTRIBUTE_NORETURN __declspec(noreturn)
00155 #  endif
00156 #  if _MSC_VER >= 1700
00157 #    define LOG4CPLUS_HAVE_CXX11_ATOMICS
00158 #  endif
00159 #endif
00160 
00161 #if defined (__GNUC__)
00162 #  undef LOG4CPLUS_INLINES_ARE_EXPORTED
00163 #  if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
00164 #    define LOG4CPLUS_HAVE_PRETTY_FUNCTION_MACRO
00165 #    define LOG4CPLUS_HAVE_FUNC_SYMBOL
00166 #  endif
00167 #  if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
00168 #    if defined (__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4)
00169 #      define LOG4CPLUS_HAVE___SYNC_SUB_AND_FETCH
00170 #      define LOG4CPLUS_HAVE___SYNC_ADD_AND_FETCH
00171 #    endif
00172 #  endif
00173 #  if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7)
00174 #    if defined (__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4)
00175 #      define LOG4CPLUS_HAVE___ATOMIC_ADD_FETCH
00176 #      define LOG4CPLUS_HAVE___ATOMIC_SUB_FETCH
00177 #    endif
00178 #    define LOG4CPLUS_INLINES_ARE_EXPORTED
00179 #  endif
00180 #  define LOG4CPLUS_HAVE_FUNCTION_MACRO
00181 #  define LOG4CPLUS_HAVE_GNU_VARIADIC_MACROS
00182 #  define LOG4CPLUS_HAVE_C99_VARIADIC_MACROS
00183 #  if defined (__MINGW32__)
00184 #    define LOG4CPLUS_WORKING_C_LOCALE
00185 #  endif
00186 #endif
00187 
00188 #if defined (__BORLANDC__) && __BORLANDC__ >= 0x0650
00189 #  define LOG4CPLUS_HAVE_FUNCTION_MACRO
00190 #  define LOG4CPLUS_HAVE_C99_VARIADIC_MACROS
00191 #endif // __BORLANDC__
00192 
00193 
00194 #endif // _WIN32
00195 #endif // LOG4CPLUS_CONFIG_WIN32_HEADER_