From 466f5fd669e68ab08d5afd20e2acdf87332cc444 Mon Sep 17 00:00:00 2001 From: nilsnolde Date: Thu, 1 Oct 2020 12:53:32 +0200 Subject: [PATCH] undefine win-specific NOGDI globally and only define inplaces where explicitly needed --- src/CMakeLists.txt | 7 ++++--- src/baldr/tz_alt.cpp | 6 ------ 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 8909d6853a..e735e34c24 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -86,8 +86,8 @@ function(valhalla_module) PUBLIC # ERROR macro clashes with windows.h -> NOGDI necessary (e.g. https://github.com/ipkn/crow/issues/87) # However, NOGDI needs to be undefined in logging.h - $<$:NOGDI;WIN32_LEAN_AND_MEAN> - $<$:VC_EXTRALEAN;NOMINMAX;> + $<$:WIN32_LEAN_AND_MEAN> + $<$:NOMINMAX> RAPIDJSON_HAS_STDSTRING HAS_REMOTE_API=0 AUTO_DOWNLOAD=0 @@ -192,7 +192,8 @@ create_source_groups("Source Files" ${valhalla_src}) target_compile_definitions(valhalla PUBLIC - $<$:VC_EXTRALEAN;WIN32_LEAN_AND_MEAN;NOMINMAX;NOGDI> + $<$:WIN32_LEAN_AND_MEAN> + $<$:NOMINMAX> RAPIDJSON_HAS_STDSTRING # this is a part of the workaround for OBJECT libraries, # because ${libvalhalla_compile_definitions} must be private. # To be removed with ${libvalhalla_compile_definitions} below diff --git a/src/baldr/tz_alt.cpp b/src/baldr/tz_alt.cpp index 1fd6730c99..43fa60b3aa 100644 --- a/src/baldr/tz_alt.cpp +++ b/src/baldr/tz_alt.cpp @@ -62,12 +62,6 @@ // that "If you define NTDDI_VERSION, you must also define _WIN32_WINNT." // So we declare we require Vista or greater. # ifdef __MINGW32__ - // otherwise LOGFONTW is not defined (defined in shobjidl.h if not NOGDI) - // https://sourceforge.net/p/mingw-w64/bugs/834/ - // also needs to be redefined in midgard/loggign.h -# ifdef NOGDI -# undef NOGDI -# endif # ifndef NTDDI_VERSION # define NTDDI_VERSION 0x06000000