summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorthegeorg <[email protected]>2022-03-03 14:08:45 +0300
committerthegeorg <[email protected]>2022-03-03 14:08:45 +0300
commitecbf59ee908f520741be4c495d9ea4b70dc50fb4 (patch)
tree0f362b5c992ba76edfccbb056ed78aa6d3ab4488 /util
parent75b363ad9be455d895aee7f72f45be2d950d3518 (diff)
Enable yet another warning under clang-cl
ref:fdd92250532d24eebbf27cb8f8369eeb88e17df9
Diffstat (limited to 'util')
-rw-r--r--util/system/win_undef.h40
-rw-r--r--util/system/winint.h47
2 files changed, 50 insertions, 37 deletions
diff --git a/util/system/win_undef.h b/util/system/win_undef.h
new file mode 100644
index 00000000000..43f3d5c73d2
--- /dev/null
+++ b/util/system/win_undef.h
@@ -0,0 +1,40 @@
+/*
+ * The lack of #pragma once is intentional,
+ * as the user might need to include this header multiple times.
+ */
+
+#include <util/system/platform.h>
+
+#if defined(_win_)
+ #undef GetFreeSpace
+ #undef LoadImage
+ #undef GetMessage
+ #undef SendMessage
+ #undef DeleteFile
+ #undef GetUserName
+ #undef CreateMutex
+ #undef GetObject
+ #undef GetGeoInfo
+ #undef GetClassName
+ #undef GetKValue
+ #undef StartDoc
+ #undef UpdateResource
+ #undef GetNameInfo
+ #undef GetProp
+ #undef SetProp
+ #undef RemoveProp
+
+ // FIXME thegeorg@: undefining CONST breaks too many projects.
+ // #undef CONST
+ #undef DEFAULT_QUALITY
+ #undef ERROR
+ #undef IGNORE
+ #undef OPTIONAL
+ #undef TRANSPARENT
+
+ #undef LANG_LAO
+ #undef LANG_YI
+
+ #undef CM_NONE
+
+#endif
diff --git a/util/system/winint.h b/util/system/winint.h
index ebeaefb3d2c..4f6659b40c1 100644
--- a/util/system/winint.h
+++ b/util/system/winint.h
@@ -1,43 +1,16 @@
#pragma once
-#include "platform.h"
+/*
+ * WARN:
+ * including this header does not make a lot of sense.
+ * You should just #include all necessary headers from Windows SDK,
+ * and then #include <util/system/win_undef.h> in order to undefine some common macros.
+ */
-#if defined(_win_)
-
- #ifndef WIN32_LEAN_AND_MEAN
- #define WIN32_LEAN_AND_MEAN
- #endif
-
- #ifndef NOMINMAX
- #define NOMINMAX
- #endif
+#include <util/system/platform.h>
+#if defined(_win_)
#include <windows.h>
-
- #undef GetFreeSpace
- #undef LoadImage
- #undef GetMessage
- #undef SendMessage
- #undef DeleteFile
- #undef OPTIONAL
- #undef GetUserName
- #undef CreateMutex
- #undef GetObject
- #undef GetGeoInfo
- #undef GetClassName
- #undef LANG_LAO
- #undef GetKValue
- #undef StartDoc
- #undef UpdateResource
- #undef GetNameInfo
- #undef GetProp
- #undef SetProp
- #undef RemoveProp
-
- #undef IGNORE
- #undef ERROR
- #undef TRANSPARENT
-
- #undef CM_NONE
-
#endif
+
+#include <util/system/win_undef.h>