--- a/include/log4cpp/Portability.hh +++ b/include/log4cpp/Portability.hh @@ -35,11 +35,7 @@ #if defined(__OPENVMS__) # include #else -# if defined(__MINGW32__) -# include -# else -# include -# endif +# include #endif #endif --- a/include/log4cpp/Priority.hh +++ b/include/log4cpp/Priority.hh @@ -14,6 +14,10 @@ #include #include +#ifdef WIN32 +#define LOG4CPP_FIX_ERROR_COLLISION +#endif + /* * Optionally work around rudeness in windows.h on Win32. */ --- a/include/log4cpp/RemoteSyslogAppender.hh +++ b/include/log4cpp/RemoteSyslogAppender.hh @@ -21,6 +21,10 @@ #include #endif +#ifdef WIN32 +typedef u_long in_addr_t; +#endif + #ifdef LOG4CPP_HAVE_SYSLOG #include #else --- a/src/DailyRollingFileAppender.cpp +++ b/src/DailyRollingFileAppender.cpp @@ -31,6 +31,8 @@ #ifndef WIN32 // only available on Win32 #include +#else +#include #endif namespace log4cpp { --- a/src/Makefile.am +++ b/src/Makefile.am @@ -64,4 +64,4 @@ liblog4cpp_la_SOURCES += SmtpAppender.cpp endif -liblog4cpp_la_LDFLAGS = -version-info @LT_VERSION@ +liblog4cpp_la_LDFLAGS = -no-undefined -version-info @LT_VERSION@ --- a/src/PThreads.cpp +++ b/src/PThreads.cpp @@ -4,6 +4,7 @@ * See the COPYING file for the terms of usage and distribution. */ +#define _GNU_SOURCE #include #include --- a/src/StringUtil.cpp +++ b/src/StringUtil.cpp @@ -9,6 +9,10 @@ #include #include +#ifdef __MINGW32__ +#define LOG4CPP_HAVE_SNPRINTF +#endif + #if defined(_MSC_VER) #define VSNPRINTF _vsnprintf #else