AppFwk: Move include of windows.h to top of file

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
This commit is contained in:
Eirik Marthinsen 2024-04-04 14:49:44 +02:00 committed by Magne Sjaastad
parent c074033dc2
commit 29d991159b

View File

@ -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
{
//--------------------------------------------------------------------------------------------------
@ -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