Explorar o código

Merge pull request #386 from oncontroltech/master

Fix a 64bit function that was also being called when the environment …
Leonid Stryzhevskyi %!s(int64=3) %!d(string=hai) anos
pai
achega
b43355c001
Modificáronse 1 ficheiros con 8 adicións e 1 borrados
  1. 8 1
      src/oatpp/core/base/Environment.cpp

+ 8 - 1
src/oatpp/core/base/Environment.cpp

@@ -33,12 +33,19 @@
 #include <cstdarg>
 
 #if defined(WIN32) || defined(_WIN32)
-#include <WinSock2.h>
+	#include <WinSock2.h>
+#endif
 
+#if (defined(WIN32) || defined(_WIN32)) && defined(_WIN64)
 struct tm* localtime_r(time_t *_clock, struct tm *_result) {
     _localtime64_s(_result, _clock);
     return _result;
 }
+#elif (defined(WIN32) || defined(_WIN32)) && not defined(_WIN64)
+struct tm* localtime_r(time_t *_clock, struct tm *_result) {
+    _localtime32_s(_result, _clock);
+    return _result;
+}
 #endif
 
 namespace oatpp { namespace base {