Bug 769124 - Australian (GMT-10) OFX transactions imported have previous days date.

Fix on Windows, where the test failed to build.
This commit is contained in:
John Ralls
2016-10-20 10:40:18 -07:00
parent c68452a497
commit 6695ef9585
2 changed files with 15 additions and 5 deletions

View File

@@ -292,8 +292,12 @@ ENDIF (WITH_AQBANKING)
IF (WITH_OFX)
GNC_PKG_CHECK_MODULES (LIBOFX REQUIRED libofx)
INCLUDE(CheckCXXSourceRuns)
SET(CMAKE_REQUIRED_LIBRARIES "-lofx")
CHECK_CXX_SOURCE_RUNS("
IF (WIN32)
SET(CMAKE_REQUIRED_LIBRARIES "-L ${CMAKE_PREFIX_PATH}/libofx/lib -lofx")
ELSE (WIN32)
SET(CMAKE_REQUIRED_LIBRARIES "-lofx")
ENDIF (WIN32)
CHECK_CXX_SOURCE_RUNS("
#include <time.h>
#include <stdlib.h>
#include <string>
@@ -306,8 +310,11 @@ int main(int argc, char** argv)
ts.tm_year = 116;
ts.tm_mon = 2;
ts.tm_mday = 19;
setenv(\"TZ\", \"PST 08 PDT 07 M 4.1.0, M 10.6.0\", 1);
#ifdef _WIN32
putenv(\"TZ=PST-8PDT-7,M 4.1.0/0,M 10.6.0/0\");
#else
setenv(\"TZ\", \"PST 08P DT 07 M 4.1.0, M 10.6.0\", 1);
#endif
time_t t = ofxdate_to_time_t(timestr);
if (t == mktime(&ts))
exit(1);

View File

@@ -808,8 +808,11 @@ struct tm ts;
ts.tm_year = 116;
ts.tm_mon = 2;
ts.tm_mday = 19;
#ifdef _WIN32
putenv(\"TZ=PST-8PDT-7,M 4.1.0/0,M 10.6.0/0\");
#else
setenv("TZ", "PST 08 PDT 07 M 4.1.0, M 10.6.0", 1);
#endif
time_t t = ofxdate_to_time_t(timestr);
if (t == mktime(&ts))
exit(0);