Fix a 64bit function that was also being called when the environment is 32btis.

The function _localtime64 was being called inside a ifdef WIN32 which
makes it try to compile even when it's in a 32bti environment.
Now if it calls _localtime32 in that case.
Tested on Windows using Msys+mingw 32bit shell.

Signed-off-by: Samega 7Cattac <7Cattac@gmail.com>
This commit is contained in:
Samega 7Cattac 2021-01-30 17:35:11 +00:00
parent 50748b4011
commit e43af7c06e
No known key found for this signature in database
GPG Key ID: C1671793FC97871D

View File

@ -33,12 +33,19 @@
#include <cstdarg> #include <cstdarg>
#if defined(WIN32) || defined(_WIN32) #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) { struct tm* localtime_r(time_t *_clock, struct tm *_result) {
_localtime64_s(_result, _clock); _localtime64_s(_result, _clock);
return _result; 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 #endif
namespace oatpp { namespace base { namespace oatpp { namespace base {