Closed wuxinmao2008 closed 3 months ago
From 2abeff921070a7841444b1bd2df673d2a6089c72 Mon Sep 17 00:00:00 2001
From: wuxinmao2008 <wuxinmao2008@hotmail.com>
Date: Fri, 9 Aug 2024 11:26:01 +0800
Subject: [PATCH] fix min/max error in GdiplusTypes.h
---
coders/emf.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/coders/emf.c b/coders/emf.c
index ff611e839..08782c0a6 100644
--- a/coders/emf.c
+++ b/coders/emf.c
@@ -49,6 +49,13 @@
# endif
# else
#pragma warning(disable: 4458)
+# define NOMINMAX
+# include <algorithm>
+namespace Gdiplus
+{
+ using std::min;
+ using std::max;
+}
# include <gdiplus.h>
#pragma warning(default: 4458)
# pragma comment(lib, "gdiplus.lib")
--
2.45.2.windows.1
You should switch to a newer version of the SDK instead. This issue has been fixed by Microsoft: https://developercommunity.visualstudio.com/t/GdiplusTypesh-does-not-compile-with-NOM/727770
ImageMagick version
7.1.1-36
Operating system
Windows
Operating system, version and so on
Windows11, VS 2022, Windows SDK 10.0.19041
Description
I meet such errors
Finnally , i found this was cause by coders/emf.c which includes ""
I soveld this by following instruction by possible-problems-with-nominmax-on-visual-c
Steps to Reproduce
I Add A patch below.