Skip to content

Commit

Permalink
AppFwk: Move include of windows.h to top of file
Browse files Browse the repository at this point in the history
The include was located in the middle of a file inside a namespace caf
block and lead to ambiguous symbols when compiling with unity build and
Qt6. It is also considered good practice to have includes at the top.

The pragma warning disable is also removed as the warning seems to be
gone (and none of the other windows.h includes have it).

Closes #11327
  • Loading branch information
marthinsen authored and magnesj committed Apr 5, 2024
1 parent c074033 commit 29d9911
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions Fwk/AppFwk/cafUserInterface/cafProgressInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@
#include <algorithm>
#include <iostream>

#ifdef _MSC_VER
// Define this one to tell windows.h to not define min() and max() as macros
#if defined WIN32 && !defined NOMINMAX
#define NOMINMAX
#endif
#include <windows.h>
#endif

namespace caf
{
//--------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -358,17 +366,6 @@ bool ProgressState::isActive()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
#ifdef _MSC_VER
#pragma warning( push )
#pragma warning( disable : 4668 )
// Define this one to tell windows.h to not define min() and max() as macros
#if defined WIN32 && !defined NOMINMAX
#define NOMINMAX
#endif
#include <windows.h>
#pragma warning( pop )
#endif

void openDebugWindow()
{
#ifdef _MSC_VER
Expand Down

0 comments on commit 29d9911

Please sign in to comment.