aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan Komissarov <ABBAPOH@gmail.com>2020-04-04 22:15:51 +0200
committerIvan Komissarov <ABBAPOH@gmail.com>2020-04-06 10:36:30 +0000
commit72de2d7c140a50fd5ef87f0168d39f47b600efda (patch)
tree84036df8d6e55146a705307c197dcafd742bd78b
parent0ec4baf922ce4547ec7f61dba6f9369874834d18 (diff)
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 <christian.kandeler@qt.io>
-rw-r--r--examples/helloworld-complex/hello.qbs2
-rw-r--r--examples/helloworld-complex/src/main.cpp4
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