Author: tschoening
Date: Thu Oct  8 14:18:44 2015
New Revision: 1707547

URL: http://svn.apache.org/viewvc?rev=1707547&view=rev
Log:
LOGCXX-426: Let APR deal with windows.h and WIN32_LEAN_AND_MEAN and that stuff. 
If we define WINSOCK here, aAPR will itself include windows.h anyways, but 
without winsock, which results in socklen_t being not available, but used in 
apr.h.

Modified:
    incubator/log4cxx/trunk/src/main/cpp/nteventlogappender.cpp

Modified: incubator/log4cxx/trunk/src/main/cpp/nteventlogappender.cpp
URL: 
http://svn.apache.org/viewvc/incubator/log4cxx/trunk/src/main/cpp/nteventlogappender.cpp?rev=1707547&r1=1707546&r2=1707547&view=diff
==============================================================================
--- incubator/log4cxx/trunk/src/main/cpp/nteventlogappender.cpp (original)
+++ incubator/log4cxx/trunk/src/main/cpp/nteventlogappender.cpp Thu Oct  8 
14:18:44 2015
@@ -17,9 +17,8 @@
 
 #if (defined(WIN32) || defined(_WIN32)) && !defined(_WIN32_WCE)
 
-#define _WINSOCKAPI_
-#include <windows.h>
-#undef ERROR
+#include <apr_strings.h>
+
 #include <log4cxx/nt/nteventlogappender.h>
 #include <log4cxx/spi/loggingevent.h>
 #include <log4cxx/helpers/loglog.h>
@@ -27,7 +26,6 @@
 #include <log4cxx/helpers/stringhelper.h>
 #include <log4cxx/helpers/transcoder.h>
 #include <log4cxx/helpers/pool.h>
-#include <apr_strings.h>
 
 using namespace log4cxx;
 using namespace log4cxx::spi;
@@ -234,15 +232,15 @@ void NTEventLogAppender::addRegistryInfo
             DWORD modlen = GetModuleFileNameW(hmodule, modpath, _MAX_PATH - 1);
             if (modlen > 0) {
                 modpath[modlen] = 0;
-                RegSetValueExW(hkey, L"EventMessageFile", 0, REG_SZ, 
+                RegSetValueExW(hkey, L"EventMessageFile", 0, REG_SZ,
                         (LPBYTE) modpath, wcslen(modpath) * sizeof(wchar_t));
-                RegSetValueExW(hkey, L"CategoryMessageFile", 0, REG_SZ, 
+                RegSetValueExW(hkey, L"CategoryMessageFile", 0, REG_SZ,
                         (LPBYTE) modpath, wcslen(modpath) * sizeof(wchar_t));
                     DWORD typesSupported = 7;
                     DWORD categoryCount = 6;
-                RegSetValueExW(hkey, L"TypesSupported", 0, REG_DWORD, 
+                RegSetValueExW(hkey, L"TypesSupported", 0, REG_DWORD,
                            (LPBYTE)&typesSupported, sizeof(DWORD));
-                RegSetValueExW(hkey, L"CategoryCount", 0, REG_DWORD, 
+                RegSetValueExW(hkey, L"CategoryCount", 0, REG_DWORD,
                            (LPBYTE)&categoryCount, sizeof(DWORD));
             }
         }


Reply via email to