For more D2DERR_* macros defined in d2derr.h, warnings is:

  In file included from mingw-w64-headers/include/d2d1.h:20,
                   from mingw-w64-headers/include/d2d1_1.h:10,
                   from libsrc/uuid.c:29:
  mingw-w64-headers/include/d2derr.h:16: warning: "D2DERR_BAD_NUMBER" redefined
   #define D2DERR_BAD_NUMBER 0x88990011

  In file included from mingw-w64-headers/include/winbase.h:2816,
                   from mingw-w64-headers/include/windows.h:70,
                   from mingw-w64-headers/include/rpc.h:16,
                   from mingw-w64-headers/include/credentialprovider.h:7,
                   from libsrc/uuid.c:17:
  mingw-w64-headers/include/winerror.h:4713: note: this is the location of the 
previous definition
   #define D2DERR_BAD_NUMBER                            
_HRESULT_TYPEDEF_(0x88990011)

Add guards in winerror.h and d2derr.h to not define same macros multiple times.
---
 mingw-w64-headers/include/d2derr.h   | 8 ++++++--
 mingw-w64-headers/include/winerror.h | 3 +++
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/mingw-w64-headers/include/d2derr.h 
b/mingw-w64-headers/include/d2derr.h
index 879789d38e22..d0aaaea04cee 100644
--- a/mingw-w64-headers/include/d2derr.h
+++ b/mingw-w64-headers/include/d2derr.h
@@ -13,12 +13,13 @@
 #define _D2DERR_H
 
 /* error codes */
+#ifndef D2DERR_WRONG_STATE
+/* may be defined from winerror.h */
 #define D2DERR_BAD_NUMBER 0x88990011
 #define D2DERR_DISPLAY_FORMAT_NOT_SUPPORTED 0x88990009
 #define D2DERR_DISPLAY_STATE_INVALID 0x88990006
 #define D2DERR_EXCEEDS_MAX_BITMAP_SIZE 0x8899001D
 #define D2DERR_INCOMPATIBLE_BRUSH_TYPES 0x88990018
-#define D2DERR_INSUFFICIENT_BUFFER 
HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER)
 #define D2DERR_INTERNAL_ERROR 0x88990008
 #define D2DERR_INVALID_CALL 0x8899000A
 #define D2DERR_LAYER_ALREADY_IN_USE 0x88990013
@@ -37,12 +38,15 @@
 #define D2DERR_TEXT_RENDERER_NOT_RELEASED 0x8899001C
 #define D2DERR_TOO_MANY_SHADER_ELEMENTS 0x8899000D
 #define D2DERR_UNSUPPORTED_OPERATION 0x88990003
-#define D2DERR_UNSUPPORTED_PIXEL_FORMAT WINCODEC_ERR_UNSUPPORTEDPIXELFORMAT
 #define D2DERR_UNSUPPORTED_VERSION 0x88990010
 #define D2DERR_WIN32_ERROR 0x88990019
 #define D2DERR_WRONG_FACTORY 0x88990012
 #define D2DERR_WRONG_RESOURCE_DOMAIN 0x88990015
 #define D2DERR_WRONG_STATE 0x88990001
 #define D2DERR_ZERO_VECTOR 0x88990007
+#endif
+
+#define D2DERR_INSUFFICIENT_BUFFER 
HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER)
+#define D2DERR_UNSUPPORTED_PIXEL_FORMAT WINCODEC_ERR_UNSUPPORTEDPIXELFORMAT
 
 #endif /* _D2DERR_H */
diff --git a/mingw-w64-headers/include/winerror.h 
b/mingw-w64-headers/include/winerror.h
index e75855fe921f..7c176f0844e2 100755
--- a/mingw-w64-headers/include/winerror.h
+++ b/mingw-w64-headers/include/winerror.h
@@ -4694,6 +4694,8 @@ __CRT_INLINE HRESULT HRESULT_FROM_WIN32(__LONG32 x) { 
return x <= 0 ? (HRESULT)x
 #define D3D12_ERROR_ADAPTER_NOT_FOUND                
_HRESULT_TYPEDEF_(0x887E0001)
 #define D3D12_ERROR_DRIVER_VERSION_MISMATCH          
_HRESULT_TYPEDEF_(0x887E0002)
 
+#ifndef D2DERR_WRONG_STATE
+/* may be defined from d2derr.h */
 #define D2DERR_WRONG_STATE                           
_HRESULT_TYPEDEF_(0x88990001)
 #define D2DERR_NOT_INITIALIZED                       
_HRESULT_TYPEDEF_(0x88990002)
 #define D2DERR_UNSUPPORTED_OPERATION                 
_HRESULT_TYPEDEF_(0x88990003)
@@ -4723,6 +4725,7 @@ __CRT_INLINE HRESULT HRESULT_FROM_WIN32(__LONG32 x) { 
return x <= 0 ? (HRESULT)x
 #define D2DERR_TEXT_EFFECT_IS_WRONG_TYPE             
_HRESULT_TYPEDEF_(0x8899001B)
 #define D2DERR_TEXT_RENDERER_NOT_RELEASED            
_HRESULT_TYPEDEF_(0x8899001C)
 #define D2DERR_EXCEEDS_MAX_BITMAP_SIZE               
_HRESULT_TYPEDEF_(0x8899001D)
+#endif
 #define D2DERR_INVALID_GRAPH_CONFIGURATION           
_HRESULT_TYPEDEF_(0x8899001E)
 #define D2DERR_INVALID_INTERNAL_GRAPH_CONFIGURATION  
_HRESULT_TYPEDEF_(0x8899001F)
 #define D2DERR_CYCLIC_GRAPH                          
_HRESULT_TYPEDEF_(0x88990020)
-- 
2.20.1



_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to