diff --git a/3d-viewer/common_ogl/openGL_includes.h b/3d-viewer/common_ogl/openGL_includes.h index d69024ea58..a91ca2ca43 100644 --- a/3d-viewer/common_ogl/openGL_includes.h +++ b/3d-viewer/common_ogl/openGL_includes.h @@ -42,7 +42,6 @@ #ifdef _WIN32 // required for the windows gl.h to work -#define WIN32_LEAN_AND_MEAN #include #endif diff --git a/CMakeLists.txt b/CMakeLists.txt index 495142ef1e..4dcfca9e10 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -62,6 +62,15 @@ set( CMAKE_MODULE_PATH "${KICAD_CMAKE_MODULE_PATH}" ) include( ConfigurePlatform ) +if( WIN32 ) + # Without WIN32_LEAN_AND_MEAN defined including windows.h pulls in legacy + # winsocks.h which conflicts with winsocks2.h used by modern libraries such + # as curl. + # There is no harm in defining this globally, at worst some additional + # headers have to be included explicitly. + add_compile_definitions( WIN32_LEAN_AND_MEAN ) +endif() + # Create a flag to identify the non-Apple unix systems if( UNIX AND NOT APPLE ) set( UNIX_NOT_APPLE ON ) diff --git a/common/dialogs/panel_printer_list.cpp b/common/dialogs/panel_printer_list.cpp index 555913e9ec..9a9ec72d98 100644 --- a/common/dialogs/panel_printer_list.cpp +++ b/common/dialogs/panel_printer_list.cpp @@ -29,6 +29,7 @@ #ifdef __WXMSW__ #include + #include #elif defined( CUPS_LIST_PRINTERS ) #include #endif diff --git a/common/font/fontconfig.cpp b/common/font/fontconfig.cpp index 581a2738fb..3ab525dd1e 100644 --- a/common/font/fontconfig.cpp +++ b/common/font/fontconfig.cpp @@ -30,7 +30,6 @@ #include #ifdef __WIN32__ -#define WIN32_LEAN_AND_MEAN #include #endif diff --git a/libs/core/profile.cpp b/libs/core/profile.cpp index dbe1b81922..2db134c0a4 100644 --- a/libs/core/profile.cpp +++ b/libs/core/profile.cpp @@ -28,7 +28,6 @@ #if defined( _WIN32 ) -#define WIN32_LEAN_AND_MEAN 1 #include int64_t GetRunningMicroSecs()