Browse Source

lib: add required Win32 setup definitions in setup-win32.h

Assisted-by: Jay Satiro
Reviewed-by: Marcel Raad

Follow up to #9312
Closes #9375
Marc Hoersken 1 year ago
parent
commit
0c68e2545c
2 changed files with 11 additions and 11 deletions
  1. 0 11
      CMake/CurlTests.c
  2. 11 0
      lib/setup-win32.h

+ 0 - 11
CMake/CurlTests.c

@@ -539,17 +539,6 @@ main() {
 #ifdef HAVE_WIN32_WINNT
 /* includes start */
 #ifdef WIN32
-/*
- * Don't include unneeded stuff in Windows headers to avoid compiler
- * warnings and macro clashes.
- * Make sure to define this macro before including any Windows headers.
- */
-#  ifndef WIN32_LEAN_AND_MEAN
-#    define WIN32_LEAN_AND_MEAN
-#  endif
-#  ifndef NOGDI
-#    define NOGDI
-#  endif
 #  include "../lib/setup-win32.h"
 #endif
 /* includes end */

+ 11 - 0
lib/setup-win32.h

@@ -42,6 +42,17 @@
 #  if defined(_UNICODE) && !defined(UNICODE)
 #    define UNICODE
 #  endif
+/*
+ * Don't include unneeded stuff in Windows headers to avoid compiler
+ * warnings and macro clashes.
+ * Make sure to define this macro before including any Windows headers.
+ */
+#  ifndef WIN32_LEAN_AND_MEAN
+#    define WIN32_LEAN_AND_MEAN
+#  endif
+#  ifndef NOGDI
+#    define NOGDI
+#  endif
 #  include <winerror.h>
 #  include <windows.h>
 #  ifdef HAVE_WINSOCK2_H