From 2b4137c5660dfcfda504a1a7b0acd3784f96abda Mon Sep 17 00:00:00 2001 From: John Ralls Date: Tue, 14 Mar 2017 21:23:12 -0700 Subject: [PATCH] Fix up building on MinGW with autotools. --- configure.ac | 11 +++++++++-- src/libqof/qof/gnc-timezone.cpp | 2 +- src/libqof/qof/qofsession.cpp | 4 +++- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index eeda116e64..54ccef9de3 100644 --- a/configure.ac +++ b/configure.ac @@ -70,7 +70,7 @@ AM_PROG_CC_C_O AC_GNU_SOURCE AC_PROG_INTLTOOL # Ensure the compiler supports C++ 11: -AX_CXX_COMPILE_STDCXX_11(noext) +AX_CXX_COMPILE_STDCXX_11(ext) AC_PROG_CC_C99 AC_SUBST(GNUCASH_MAJOR_VERSION) @@ -196,7 +196,7 @@ oldcflags="$CFLAGS" CFLAGS= AC_LANG_PUSH([C++]) oldcxxflags="$CXXFLAGS" -CXXFLAGS="-Werror -std=c++11 $BOOST_CPPFLAGS" +CXXFLAGS="-Werror -std=gnu++11 $BOOST_CPPFLAGS" AC_MSG_CHECKING([boost/date_time/local_time/custom_time_zone.hpp]) AC_COMPILE_IFELSE([ AC_LANG_SOURCE([ @@ -1634,6 +1634,13 @@ then else warnFLAGS=none fi +# Workaround for bug in gtest on mingw, see +# https://github.com/google/googletest/issues/893 +# https://github.com/google/googletest/issues/920 +case $host_os in + mingw*) + AM_CXXFLAGS="${AM_CXXFLAGS} -DWINVER=0x0500 -D_EMULATE_GLIBC=0" +esac AC_SUBST(AM_CFLAGS) AC_SUBST(AM_CXXFLAGS) AC_MSG_RESULT($warnFLAGS) diff --git a/src/libqof/qof/gnc-timezone.cpp b/src/libqof/qof/gnc-timezone.cpp index 4a8ecff469..40c943c46c 100644 --- a/src/libqof/qof/gnc-timezone.cpp +++ b/src/libqof/qof/gnc-timezone.cpp @@ -173,7 +173,7 @@ zone_from_regtzi (const RegTZI& regtzi, time_zone_names names) } catch (boost::gregorian::bad_month& err) { - PWARN("Caught Bad Month Exception. Daylight Bias: %d " + PWARN("Caught Bad Month Exception. Daylight Bias: %ld " "Standard Month : %d Daylight Month: %d", regtzi.DaylightBias, regtzi.StandardDate.wMonth, regtzi.DaylightDate.wMonth); diff --git a/src/libqof/qof/qofsession.cpp b/src/libqof/qof/qofsession.cpp index 9939c67f44..093cf495a4 100644 --- a/src/libqof/qof/qofsession.cpp +++ b/src/libqof/qof/qofsession.cpp @@ -168,7 +168,9 @@ QofSessionImpl::destroy_backend () noexcept void QofSessionImpl::load_backend (std::string access_method) noexcept { - ENTER (" list=%lu", s_providers.size ()); + std::ostringstream s; + s << " list=" << s_providers.size(); + ENTER ("%s", s.str().c_str()); for (auto const & prov : s_providers) { if (!boost::iequals (access_method, prov->access_method))