On 8/16/2016 4:16 AM, Jacek Caban wrote:
On 16.08.2016 12:50, dw wrote:
--- a/mingw-w64-headers/include/mfidl.h
+++ b/mingw-w64-headers/include/mfidl.h
This file is auto generated. You should not touch it, please change .idl
file instead.

Strictly speaking, I believe the (duplicate) MF_xx_BYTE_ALIGNMENT defines should be removed from mfidl.idl. But for our purposes today, I can achieve the desired result by just changing mfapi.h (attached as defines3.patch). Better?

And since you mentioned it, I checked the other files and dxgi.h is also a generated file. I have broken it out to a separate patch (dxgi.patch).

========= dxgi.patch ============
Avoid 'redefine' warnings from duplicated (but microscopically different) defines.

========= defines3.patch ============
Fix minor variations in definitions that trigger compiler warnings.

gs_support.c:
  - The minor variation causes a 'redefines' error.
cephes_emath.h:
  - The minor variations cause 'redefines' errors.
aviriff.h, basetyps.h, combaseapi.h, gpedit.h:
  - Redefine errors.
mfapi.h:
  - Redefine errors.
ntdef.h:
  - Redefine errors.
winnt.h:
  - Redefine errors.

dw
diff --git a/mingw-w64-crt/crt/gs_support.c b/mingw-w64-crt/crt/gs_support.c
index dbd95d5..f47b0fe 100644
--- a/mingw-w64-crt/crt/gs_support.c
+++ b/mingw-w64-crt/crt/gs_support.c
@@ -26,7 +26,7 @@
 
 typedef LONG NTSTATUS;	/* same as in ntdef.h / winternl.h */
 
-#define UNW_FLAG_NHANDLER 0x00
+#define UNW_FLAG_NHANDLER   0x0
 
 typedef union
 {
diff --git a/mingw-w64-crt/math/cephes_emath.h b/mingw-w64-crt/math/cephes_emath.h
index b92d710..58a8e13 100644
--- a/mingw-w64-crt/math/cephes_emath.h
+++ b/mingw-w64-crt/math/cephes_emath.h
@@ -190,7 +190,7 @@
 #define EXONE (0x3fff)
 
 
-#define  mtherr(x,y)
+#define mtherr(fname, code)
 
 
 extern long double strtold (const char * __restrict__ s, char ** __restrict__ se);
@@ -293,7 +293,7 @@ static __inline__ void __eshdn6(register short unsigned int *x);
  */
 #define XPD 0,
 /* #define XPD */
-#define NANS
+#define NANS 1
 
 /* NaN's require infinity support. */
 #ifdef NANS
diff --git a/mingw-w64-headers/include/aviriff.h b/mingw-w64-headers/include/aviriff.h
index 30e7de3..9f4e664 100755
--- a/mingw-w64-headers/include/aviriff.h
+++ b/mingw-w64-headers/include/aviriff.h
@@ -53,12 +53,12 @@ typedef struct _rifflist {
 #define streamtypeVIDEO FCC('vids')
 #endif
 
-#define AVIF_HASINDEX 0x10
-#define AVIF_MUSTUSEINDEX 0x20
-#define AVIF_ISINTERLEAVED 0x100
-#define AVIF_TRUSTCKTYPE 0x800
-#define AVIF_WASCAPTUREFILE 0x10000
-#define AVIF_COPYRIGHTED 0x20000
+#define AVIF_HASINDEX 0x00000010
+#define AVIF_MUSTUSEINDEX 0x00000020
+#define AVIF_ISINTERLEAVED 0x00000100
+#define AVIF_TRUSTCKTYPE 0x00000800
+#define AVIF_WASCAPTUREFILE 0x00010000
+#define AVIF_COPYRIGHTED 0x00020000
 
 #ifndef AVIIF_LIST
 #define AVIIF_LIST 0x1
@@ -67,8 +67,8 @@ typedef struct _rifflist {
 #define AVIIF_NO_TIME 0x100
 #define AVIIF_COMPRESSOR 0xfff0000
 
-#define AVISF_DISABLED 0x1
-#define AVISF_VIDEO_PALCHANGES 0x10000
+#define AVISF_DISABLED 0x00000001
+#define AVISF_VIDEO_PALCHANGES 0x00010000
 
 #define TIMECODE_RATE_30DROP 0
 
diff --git a/mingw-w64-headers/include/basetyps.h b/mingw-w64-headers/include/basetyps.h
index 7c36eca..dbfdcea 100644
--- a/mingw-w64-headers/include/basetyps.h
+++ b/mingw-w64-headers/include/basetyps.h
@@ -78,9 +78,9 @@
 #endif
 
 #define IFACEMETHOD(method) /*override*/ STDMETHOD (method)
-#define IFACEMETHOD_(type, method) /*override*/ STDMETHOD_ (type, method)
+#define IFACEMETHOD_(type, method) /*override*/ STDMETHOD_(type, method)
 #define IFACEMETHODV(method) /*override*/ STDMETHODV (method)
-#define IFACEMETHODV_(type, method) /*override*/ STDMETHODV_ (type, method)
+#define IFACEMETHODV_(type, method) /*override*/ STDMETHODV_(type, method)
 
 #include <guiddef.h>
 
diff --git a/mingw-w64-headers/include/combaseapi.h b/mingw-w64-headers/include/combaseapi.h
index 3536e25..ca6483f 100644
--- a/mingw-w64-headers/include/combaseapi.h
+++ b/mingw-w64-headers/include/combaseapi.h
@@ -63,7 +63,7 @@
 #define DECLARE_INTERFACE_IID_(iface, baseiface, iid) interface DECLSPEC_UUID (iid) DECLSPEC_NOVTABLE iface : public baseiface
 
 #define IFACEMETHOD(method) STDMETHOD (method)
-#define IFACEMETHOD_(type, method) STDMETHOD_(type, method)
+#define IFACEMETHOD_(type, method) /*override*/ STDMETHOD_(type, method)
 #define IFACEMETHODV(method) STDMETHODV (method)
 #define IFACEMETHODV_(type, method) STDMETHODV_(type, method)
 
@@ -92,9 +92,9 @@ extern "C++" {
 #define STDMETHODV_(type, method) type (STDMETHODVCALLTYPE *method)
 
 #define IFACEMETHOD(method) STDMETHOD (method)
-#define IFACEMETHOD_(type, method) STDMETHOD_ (type, method)
+#define IFACEMETHOD_(type, method) /*override*/ STDMETHOD_(type, method)
 #define IFACEMETHODV(method) STDMETHODV (method)
-#define IFACEMETHODV_(type, method) STDMETHODV_ (type, method)
+#define IFACEMETHODV_(type, method) /*override*/ STDMETHODV_(type, method)
 
 #ifndef BEGIN_INTERFACE
 #define BEGIN_INTERFACE
diff --git a/mingw-w64-headers/include/gpedit.h b/mingw-w64-headers/include/gpedit.h
index 6b980f4..c611395 100644
--- a/mingw-w64-headers/include/gpedit.h
+++ b/mingw-w64-headers/include/gpedit.h
@@ -11,7 +11,7 @@ DEFINE_GUID(NODEID_UserSWSettings,0x8fc0b73c,0xa0e1,0x11d1,0xa7,0xd3,0x0,0x0,0xf
 DEFINE_GUID(IID_IGPEInformation,0x8fc0b735,0xa0e1,0x11d1,0xa7,0xd3,0x0,0x0,0xf8,0x75,0x71,0xe3);
 DEFINE_GUID(CLSID_GroupPolicyObject,0xea502722,0xa23d,0x11d1,0xa7,0xd3,0x0,0x0,0xf8,0x75,0x71,0xe3);
 DEFINE_GUID(IID_IGroupPolicyObject,0xea502723,0xa23d,0x11d1,0xa7,0xd3,0x0,0x0,0xf8,0x75,0x71,0xe3);
-#define REGISTRY_EXTENSION_GUID { 0x35378EAC,0x683F,0x11D2,0xA8,0x9A,0x00,0xC0,0x4F,0xBB,0xCF,0xA2 }
+#define REGISTRY_EXTENSION_GUID { 0x35378eac, 0x683f, 0x11d2, 0xa8, 0x9a, 0x00, 0xc0, 0x4f, 0xbb, 0xcf, 0xa2 }
 DEFINE_GUID(CLSID_RSOPSnapIn,0x6dc3804b,0x7212,0x458d,0xad,0xb0,0x9a,0x07,0xe2,0xae,0x1f,0xa2);
 DEFINE_GUID(NODEID_RSOPMachine,0xbd4c1a2e,0x0b7a,0x4a62,0xa6,0xb0,0xc0,0x57,0x75,0x39,0xc9,0x7e);
 DEFINE_GUID(NODEID_RSOPMachineSWSettings,0x6a76273e,0xeb8e,0x45db,0x94,0xc5,0x25,0x66,0x3a,0x5f,0x2c,0x1a);
diff --git a/mingw-w64-headers/include/mfapi.h b/mingw-w64-headers/include/mfapi.h
index 41f7ffc..67dc684 100644
--- a/mingw-w64-headers/include/mfapi.h
+++ b/mingw-w64-headers/include/mfapi.h
@@ -160,16 +160,16 @@ extern "C" {
 #define MF_E_DXGI_NEW_VIDEO_DEVICE ((HRESULT)__MSABI_LONG(0x80041001))
 #define MF_E_DXGI_VIDEO_DEVICE_LOCKED ((HRESULT)__MSABI_LONG(0x80041002))
 
-#define MF_1_BYTE_ALIGNMENT 0x00000000
-#define MF_2_BYTE_ALIGNMENT 0x00000001
-#define MF_4_BYTE_ALIGNMENT 0x00000003
-#define MF_8_BYTE_ALIGNMENT 0x00000007
-#define MF_16_BYTE_ALIGNMENT 0x0000000f
-#define MF_32_BYTE_ALIGNMENT 0x0000001f
-#define MF_64_BYTE_ALIGNMENT 0x0000003f
-#define MF_128_BYTE_ALIGNMENT 0x0000007f
-#define MF_256_BYTE_ALIGNMENT 0x000000ff
-#define MF_512_BYTE_ALIGNMENT 0x000001ff
+#define MF_1_BYTE_ALIGNMENT     0x00000000
+#define MF_2_BYTE_ALIGNMENT     0x00000001
+#define MF_4_BYTE_ALIGNMENT     0x00000003
+#define MF_8_BYTE_ALIGNMENT     0x00000007
+#define MF_16_BYTE_ALIGNMENT    0x0000000F
+#define MF_32_BYTE_ALIGNMENT    0x0000001F
+#define MF_64_BYTE_ALIGNMENT    0x0000003F
+#define MF_128_BYTE_ALIGNMENT   0x0000007F
+#define MF_256_BYTE_ALIGNMENT   0x000000FF
+#define MF_512_BYTE_ALIGNMENT   0x000001FF
 
 #endif
 
diff --git a/mingw-w64-headers/include/ntdef.h b/mingw-w64-headers/include/ntdef.h
index 4be8c14..e3e29e7 100644
--- a/mingw-w64-headers/include/ntdef.h
+++ b/mingw-w64-headers/include/ntdef.h
@@ -694,14 +694,14 @@ typedef struct _GROUP_AFFINITY {
 #define MAXUCHAR  0xff
 #define MAXUSHORT 0xffff
 #define MAXULONG  0xffffffff
-#define MAXLONGLONG (0x7fffffffffffffffLL)
+#define MAXLONGLONG (0x7fffffffffffffffll)
 
 /* Multiplication and Shift Operations */
-#define Int32x32To64(a,b) ((LONGLONG)(a)*(LONGLONG)(b))
-#define UInt32x32To64(a,b) ((ULONGLONG)(a)*(ULONGLONG)(b))
-#define Int64ShllMod32(a,b) ((ULONGLONG)(a)<<(b))
-#define Int64ShraMod32(a,b) ((LONGLONG)(a)>>(b))
-#define Int64ShrlMod32(a,b) ((ULONGLONG)(a)>>(b))
+#define Int32x32To64(a, b) (((LONGLONG) ((LONG) (a))) * ((LONGLONG) ((LONG) (b))))
+#define UInt32x32To64(a, b) (((ULONGLONG) ((unsigned int) (a))) *((ULONGLONG) ((unsigned int) (b))))
+#define Int64ShllMod32(a, b) (((ULONGLONG) (a)) << (b))
+#define Int64ShraMod32(a, b) (((LONGLONG) (a)) >> (b))
+#define Int64ShrlMod32(a, b) (((ULONGLONG) (a)) >> (b))
 
 /* C_ASSERT Definition */
 #define C_ASSERT(expr) extern char (*c_assert(void)) [(expr) ? 1 : -1]
diff --git a/mingw-w64-headers/include/winnt.h b/mingw-w64-headers/include/winnt.h
index 84eb36a..a855801 100644
--- a/mingw-w64-headers/include/winnt.h
+++ b/mingw-w64-headers/include/winnt.h
@@ -1745,10 +1745,10 @@ extern "C" {
 
 #define OUT_OF_PROCESS_FUNCTION_TABLE_CALLBACK_EXPORT_NAME "OutOfProcessFunctionTableCallback"
 
-#define UNW_FLAG_NHANDLER   0x00
-#define UNW_FLAG_EHANDLER   0x01
-#define UNW_FLAG_UHANDLER   0x02
-#define UNW_FLAG_CHAININFO  0x04
+#define UNW_FLAG_NHANDLER   0x0
+#define UNW_FLAG_EHANDLER   0x1
+#define UNW_FLAG_UHANDLER   0x2
+#define UNW_FLAG_CHAININFO  0x4
 
 #endif /* end of _AMD64_ */
 
diff --git a/mingw-w64-headers/direct-x/include/dxgi.h b/mingw-w64-headers/direct-x/include/dxgi.h
index d116b89..d056fa3 100644
--- a/mingw-w64-headers/direct-x/include/dxgi.h
+++ b/mingw-w64-headers/direct-x/include/dxgi.h
@@ -108,6 +108,11 @@ extern "C" {
 #define DXGI_STATUS_MODE_CHANGED                    MAKE_DXGI_STATUS(7)
 #define DXGI_STATUS_MODE_CHANGE_IN_PROGRESS         MAKE_DXGI_STATUS(8)
 #define MAKE_DXGI_HRESULT(x)                        MAKE_HRESULT(1, _FACDXGI, x)
+
+/* These defines are (incorrectly) duplicated in winerror.h.  Avoid the
+   redefine error.  */
+#ifndef DXGI_ERROR_INVALID_CALL
+
 #define DXGI_ERROR_INVALID_CALL                     MAKE_DXGI_HRESULT(1)
 #define DXGI_ERROR_NOT_FOUND                        MAKE_DXGI_HRESULT(2)
 #define DXGI_ERROR_MORE_DATA                        MAKE_DXGI_HRESULT(3)
@@ -121,6 +126,9 @@ extern "C" {
 #define DXGI_ERROR_DRIVER_INTERNAL_ERROR            MAKE_DXGI_HRESULT(32)
 #define DXGI_ERROR_NONEXCLUSIVE                     MAKE_DXGI_HRESULT(33)
 #define DXGI_ERROR_NOT_CURRENTLY_AVAILABLE          MAKE_DXGI_HRESULT(34)
+
+#endif /* DXGI_ERROR_INVALID_CALL */
+
 #if 0
 typedef HANDLE HMONITOR;
 typedef struct _LUID {
diff --git a/mingw-w64-headers/direct-x/include/dxgi.idl b/mingw-w64-headers/direct-x/include/dxgi.idl
index c7ba584..c7f7ca9 100644
--- a/mingw-w64-headers/direct-x/include/dxgi.idl
+++ b/mingw-w64-headers/direct-x/include/dxgi.idl
@@ -32,6 +32,11 @@ cpp_quote("#define DXGI_STATUS_MODE_CHANGED                    MAKE_DXGI_STATUS(
 cpp_quote("#define DXGI_STATUS_MODE_CHANGE_IN_PROGRESS         MAKE_DXGI_STATUS(8)")
 
 cpp_quote("#define MAKE_DXGI_HRESULT(x)                        MAKE_HRESULT(1, _FACDXGI, x)")
+cpp_quote("")
+cpp_quote("/* These defines are (incorrectly) duplicated in winerror.h.  Avoid the")
+cpp_quote("   redefine error.  */")
+cpp_quote("#ifndef DXGI_ERROR_INVALID_CALL")
+cpp_quote("")
 cpp_quote("#define DXGI_ERROR_INVALID_CALL                     MAKE_DXGI_HRESULT(1)")
 cpp_quote("#define DXGI_ERROR_NOT_FOUND                        MAKE_DXGI_HRESULT(2)")
 cpp_quote("#define DXGI_ERROR_MORE_DATA                        MAKE_DXGI_HRESULT(3)")
@@ -45,6 +50,9 @@ cpp_quote("#define DXGI_ERROR_GRAPHICS_VIDPN_SOURCE_IN_USE     MAKE_DXGI_HRESULT
 cpp_quote("#define DXGI_ERROR_DRIVER_INTERNAL_ERROR            MAKE_DXGI_HRESULT(32)")
 cpp_quote("#define DXGI_ERROR_NONEXCLUSIVE                     MAKE_DXGI_HRESULT(33)")
 cpp_quote("#define DXGI_ERROR_NOT_CURRENTLY_AVAILABLE          MAKE_DXGI_HRESULT(34)")
+cpp_quote("")
+cpp_quote("#endif /* DXGI_ERROR_INVALID_CALL */")
+cpp_quote("")
 
 cpp_quote("#if 0")
 typedef HANDLE HMONITOR;
------------------------------------------------------------------------------
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to