From 72de2d7c140a50fd5ef87f0168d39f47b600efda Mon Sep 17 00:00:00 2001 From: Ivan Komissarov Date: Sat, 4 Apr 2020 22:15:51 +0200 Subject: Fix helloworld-complex in "profiling" build on Windows _DEBUG macro is used by the MSVC compiler internally to enable/disable some features (like debug iterators) and defining it manually leads to obscure compilation errors Change-Id: I10e79ccbbfd40fe378fe9b754ecfc6066497eee5 Reviewed-by: Christian Kandeler --- examples/helloworld-complex/hello.qbs | 2 +- examples/helloworld-complex/src/main.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/helloworld-complex/hello.qbs b/examples/helloworld-complex/hello.qbs index 725424e49..16e7eace0 100644 --- a/examples/helloworld-complex/hello.qbs +++ b/examples/helloworld-complex/hello.qbs @@ -74,7 +74,7 @@ Project { cpp.defines: { var defines = outer.concat([ 'HAVE_MAIN_CPP', - cpp.debugInformation ? '_DEBUG' : '_RELEASE' + cpp.debugInformation ? 'HAS_DEBUG' : 'HAS_RELEASE' ]); if (project.hasSpecialFeature) defines.push("HAS_SPECIAL_FEATURE"); diff --git a/examples/helloworld-complex/src/main.cpp b/examples/helloworld-complex/src/main.cpp index 691c401e5..8827c1e5e 100644 --- a/examples/helloworld-complex/src/main.cpp +++ b/examples/helloworld-complex/src/main.cpp @@ -67,9 +67,9 @@ int main() { someUsefulFunction(); -#ifdef _DEBUG +#if defined(HAS_DEBUG) puts("Hello World! (debug version)"); -#else +#elif defined(HAS_RELEASE) puts("Hello World! (release version)"); #endif #ifdef HAS_SPECIAL_FEATURE -- cgit v1.2.3