[Mingw-w64-public] [PATCH] headers: Add more GUIDs in mfidl.idl.

2021-05-14 Thread Biswapriyo Nath

From 8c54bb5c0842decc2966cf2252f4881522580162 Mon Sep 17 00:00:00 2001
From: Biswapriyo Nath 
Date: Sat, 15 May 2021 10:48:02 +0530
Subject: [PATCH] headers: Add more GUIDs in mfidl.idl.

Signed-off-by: Biswapriyo Nath 
---
 mingw-w64-headers/include/mfidl.idl | 55 +
 1 file changed, 55 insertions(+)

diff --git a/mingw-w64-headers/include/mfidl.idl 
b/mingw-w64-headers/include/mfidl.idl
index 1ac68cc..ed74c74 100644
--- a/mingw-w64-headers/include/mfidl.idl
+++ b/mingw-w64-headers/include/mfidl.idl
@@ -635,6 +635,8 @@ cpp_quote("HRESULT WINAPI 
MFCreateASFMultiplexer(IMFASFMultiplexer **ppIMultiple
 cpp_quote("HRESULT WINAPI MFCreateASFProfile(IMFASFProfile **ppIProfile);")
 cpp_quote("HRESULT WINAPI 
MFCreateASFProfileFromPresentationDescriptor(IMFPresentationDescriptor 
*pIPD,IMFASFProfile **ppIProfile);")
 cpp_quote("HRESULT WINAPI MFCreateASFSplitter(IMFASFSplitter **ppISplitter);")
+cpp_quote("HRESULT WINAPI MFCreateAudioRenderer(IMFAttributes 
*pAudioAttributes, IMFMediaSink **ppSink);")
+cpp_quote("HRESULT WINAPI MFCreateAudioRendererActivate(IMFActivate 
**ppActivate);")
 cpp_quote("HRESULT WINAPI MFCreateMediaSession(IMFAttributes 
*pConfiguration,IMFMediaSession **ppMS);")
 cpp_quote("HRESULT WINAPI MFCreateMP3MediaSink(IMFByteStream 
*pTargetByteStream,IMFMediaSink **ppMediaSink);")
 cpp_quote("HRESULT WINAPI MFCreateMPEG4MediaSink(IMFByteStream 
*pIByteStream,IMFMediaType *pVideoMediaType,IMFMediaType 
*pAudioMediaType,IMFMediaSink **ppIMediaSink);")
@@ -678,6 +680,21 @@ cpp_quote("HRESULT WINAPI 
MFGetTopoNodeCurrentType(IMFTopologyNode *pNode,DWORD
 cpp_quote("HRESULT WINAPI MFTranscodeGetAudioOutputAvailableTypes(REFGUID 
guidSubType,DWORD dwMFTFlags,IMFAttributes *pCodecConfig,IMFCollection 
**ppAvailableTypes);")
 cpp_quote("#endif")
 
+cpp_quote("EXTERN_GUID(MFNETSOURCE_STATISTICS, 0x3cb1f274, 0x0505, 0x4c5d, 
0xae, 0x71, 0x0a, 0x55, 0x63, 0x44, 0xef, 0xa1);")
+cpp_quote("EXTERN_GUID(MFNETSOURCE_STATISTICS_SERVICE, 0x3cb1f275, 0x0505, 
0x4c5d, 0xae, 0x71, 0x0a, 0x55, 0x63, 0x44, 0xef, 0xa1);")
+
+cpp_quote("EXTERN_GUID(MF_ACTIVATE_CUSTOM_VIDEO_MIXER_CLSID, 0xba491360, 
0xbe50, 0x451e, 0x95, 0xab, 0x6d, 0x4a, 0xcc, 0xc7, 0xda, 0xd8 );")
+cpp_quote("EXTERN_GUID(MF_ACTIVATE_CUSTOM_VIDEO_MIXER_ACTIVATE, 0xba491361, 
0xbe50, 0x451e, 0x95, 0xab, 0x6d, 0x4a, 0xcc, 0xc7, 0xda, 0xd8 );")
+cpp_quote("EXTERN_GUID(MF_ACTIVATE_CUSTOM_VIDEO_MIXER_FLAGS, 0xba491362, 
0xbe50, 0x451e, 0x95, 0xab, 0x6d, 0x4a, 0xcc, 0xc7, 0xda, 0xd8 );")
+cpp_quote("EXTERN_GUID(MF_ACTIVATE_CUSTOM_VIDEO_PRESENTER_CLSID, 0xba491364, 
0xbe50, 0x451e, 0x95, 0xab, 0x6d, 0x4a, 0xcc, 0xc7, 0xda, 0xd8 );")
+cpp_quote("EXTERN_GUID(MF_ACTIVATE_CUSTOM_VIDEO_PRESENTER_ACTIVATE, 
0xba491365, 0xbe50, 0x451e, 0x95, 0xab, 0x6d, 0x4a, 0xcc, 0xc7, 0xda, 0xd8 );")
+cpp_quote("EXTERN_GUID(MF_ACTIVATE_CUSTOM_VIDEO_PRESENTER_FLAGS, 0xba491366, 
0xbe50, 0x451e, 0x95, 0xab, 0x6d, 0x4a, 0xcc, 0xc7, 0xda, 0xd8 );")
+
+cpp_quote("EXTERN_GUID(MF_AUDIO_RENDERER_ATTRIBUTE_SESSION_ID, 0xede4b5e3, 
0xf805, 0x4d6c, 0x99, 0xb3, 0xdb, 0x01, 0xbf, 0x95, 0xdf, 0xab);")
+cpp_quote("EXTERN_GUID(MF_AUDIO_RENDERER_ATTRIBUTE_ENDPOINT_ID, 0xb10aaec3, 
0xef71, 0x4cc3, 0xb8, 0x73, 0x5, 0xa9, 0xa0, 0x8b, 0x9f, 0x8e);")
+cpp_quote("EXTERN_GUID(MF_AUDIO_RENDERER_ATTRIBUTE_ENDPOINT_ROLE, 0x6ba644ff, 
0x27c5, 0x4d02, 0x98, 0x87, 0xc2, 0x86, 0x19, 0xfd, 0xb9, 0x1b);")
+cpp_quote("EXTERN_GUID(MF_AUDIO_RENDERER_ATTRIBUTE_STREAM_CATEGORY, 
0xa9770471, 0x92ec, 0x4df4, 0x94, 0xfe, 0x81, 0xc3, 0x6f, 0xc, 0x3a, 0x7a);")
+
 cpp_quote("EXTERN_GUID(MF_DEVSOURCE_ATTRIBUTE_FRIENDLY_NAME, 
0x60d0e559,0x52f8,0x4fa2,0xbb,0xce,0xac,0xdb,0x34,0xa8,0xec,0x1);")
 cpp_quote("EXTERN_GUID(MF_DEVSOURCE_ATTRIBUTE_MEDIA_TYPE, 
0x56a819ca,0xc78,0x4de4,0xa0,0xa7,0x3d,0xda,0xba,0xf,0x24,0xd4);")
 cpp_quote("EXTERN_GUID(MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE_AUDCAP_ENDPOINT_ID, 
0x30da9258,0xfeb9,0x47a7,0xa4,0x53,0x76,0x3a,0x7a,0x8e,0x1c,0x5f);")
@@ -688,3 +705,41 @@ 
cpp_quote("EXTERN_GUID(MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE_VIDCAP_MAX_BUFFERS, 0x
 
cpp_quote("EXTERN_GUID(MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE_VIDCAP_SYMBOLIC_LINK, 
0x58f0aad8,0x22bf,0x4f8a,0xbb,0x3d,0xd2,0xc4,0x97,0x8c,0x6e,0x2f);")
 cpp_quote("EXTERN_GUID(MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE, 
0xc60ac5fe,0x252a,0x478f,0xa0,0xef,0xbc,0x8f,0xa5,0xf7,0xca,0xd3);")
 cpp_quote("EXTERN_GUID(MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE_VIDCAP_GUID, 
0x8ac3587a,0x4ae7,0x42d8,0x99,0xe0,0x0a,0x60,0x13,0xee,0xf9,0x0f);")
+
+cpp_quote("EXTERN_GUID(MF_METADATA_PROVIDER_SERVICE, 0xdb214084, 0x58a4, 
0x4d2e, 0xb8, 0x4f, 0x6f, 0x75, 0x5b, 0x2f, 0x7a, 0xd);")
+cpp_quote("EXTERN_GUID(MF_PROPERTY_HANDLER_SERVICE, 0xa3face02, 0x32b8, 
0x41dd, 0x90, 0xe7, 0x5f, 0xef, 0x7c, 0x89, 0x91, 0xb5);")
+cpp_quote("EXTERN_GUID(MF_RATE_CONTROL_SERVICE, 0x866fa297, 0xb802, 0x4bf8, 
0x9d, 0xc9, 0x5e, 0x3b, 0x6a, 0x9f, 0x53, 0xc9);")
+cpp_quote("EXTERN_GUID(MF_SAMPLEGRABBERSINK_IGNORE_CLOCK, 0x0efda2c0, 0x2b69, 
0x4e2e, 0xab, 0x8d, 0x46, 0xdc, 0xbf, 0xf7, 

Re: [Mingw-w64-public] [PATCH] headers: Add wmsdk.h

2021-05-14 Thread JonY via Mingw-w64-public

On 5/14/21 12:14 PM, JonY wrote:

On 5/13/21 3:31 PM, Biswapriyo Nath wrote:





Patch OK, will commit soon if nobody has objections.



Pushed to master branch.


OpenPGP_signature
Description: OpenPGP digital signature
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] [PATCH] headers: Add more constants to STORAGE_BUS_TYPE.

2021-05-14 Thread JonY via Mingw-w64-public

On 5/14/21 1:46 PM, JonY wrote:

On 5/14/21 12:35 PM, Christian Franke wrote:

... in particular BusTypeNvme.



Patch OK, will push soon if no objections.



Pushed to master branch.


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


Re: [Mingw-w64-public] wine FTBFS with mingw64 gcc 11: undefined reference to `sincos'

2021-05-14 Thread lhmouse
在 5/15/21 1:27 AM, Jacek Caban 写道:
> 
> I think that the decision was unfortunate on GCC side, but there is little we 
> can do. We will 
> probably need to provide it in msvcrt importlibs. Please try the attached 
> patch, it should help.
> 
> 
Doesn't GCC transform such pair of calls to `sincos()` again and result in an 
infinite recursion?



-- 
Best regards,
Liu Hao

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


Re: [Mingw-w64-public] wine FTBFS with mingw64 gcc 11: undefined reference to `sincos'

2021-05-14 Thread Jacek Caban

Hi Alex,

On 5/14/21 3:01 AM, Alex Xu (Hello71) wrote:

Hi,

I tried building wine 6.8 with mingw. All fine, just one problem, it
reports error "undefined reference to `sincos'". Why, you may ask, since
wine never calls sincos function? Well, it seems to be because mingw gcc
11 enables sincos optimization: [0]. But, wine uses -nodefaultlibs,
intending to provide libc functions with msvcrt; however, wine msvcrt
doesn't implement any sincos. So, there is a mismatch: gcc accepts mingw
claim to implement sincos (ok since mingwex implements it), then
generates call to sincos, then fails at link time (because msvcrt does
not implement it).

After adding -fno-builtin-{sin,cos}{,f} to CFLAGS, wine compiled and ran
OK.

This issue seems to be worked around for winelib builds by adding
-fno-builtin, so that gcc will not generate sincos (or most other
problematic functions).

I think this issue could be worked around by adding those -fno-builtin-*
flags for mingw builds. However, I think the sin/cos->sincos
optimization is a good one, so maybe we could instead add sincos
forwarder in msvcrt (calling sin+cos separately in case sincos is not
implemented in libc?).

CCed mingw-w64-public@lists.sourceforge.net due to potential relevance
and felixonm...@archlinux.org due to maintaining wine and mingw-gcc on
Arch. You may need to subscribe in order to reply all. I look forward to
hearing your thoughts.



I think that the decision was unfortunate on GCC side, but there is 
little we can do. We will probably need to provide it in msvcrt 
importlibs. Please try the attached patch, it should help.



Thanks,

Jacek

diff --git a/dlls/msvcrt/mathf.c b/dlls/msvcrt/mathf.c
index 4038bdb4cf7..3cd5377f1e4 100644
--- a/dlls/msvcrt/mathf.c
+++ b/dlls/msvcrt/mathf.c
@@ -67,3 +67,15 @@ float exp2f(float x) { return powf(2.0f, x); }
 __ASM_GLOBAL_IMPORT(exp2)
 __ASM_GLOBAL_IMPORT(exp2f)
 #endif
+
+void sincos(double x, double *s, double *c)
+{
+*s = sin(x);
+*c = cos(x);
+}
+
+void sincosf(float x, float *s, float *c)
+{
+*s = sinf(x);
+*c = cosf(x);
+}
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


[Mingw-w64-public] [PATCH] include/{guiddef, _mingw}: Implement `__uuidof` with overloading instead of specialization

2021-05-14 Thread Liu Hao

It may fix issues about specializations outside their namespaces, but is 
otherwise totally untested.



--
Best regards,
Liu Hao
From 429d462b97e8980d89ba4dc6c14de051e408c9d9 Mon Sep 17 00:00:00 2001
From: Liu Hao 
Date: Fri, 14 May 2021 21:46:49 +0800
Subject: [PATCH] include/{guiddef,_mingw}: Implement `__uuidof` with
 overloading instead of specialization

Reference: https://sourceforge.net/p/mingw-w64/mailman/message/37282360/
Signed-off-by: Liu Hao 
---
 mingw-w64-headers/crt/_mingw.h.in   | 31 -
 mingw-w64-headers/include/guiddef.h | 11 --
 2 files changed, 8 insertions(+), 34 deletions(-)

diff --git a/mingw-w64-headers/crt/_mingw.h.in 
b/mingw-w64-headers/crt/_mingw.h.in
index 89b1d257..b401e65b 100644
--- a/mingw-w64-headers/crt/_mingw.h.in
+++ b/mingw-w64-headers/crt/_mingw.h.in
@@ -529,35 +529,20 @@ typedef int __int128 __attribute__ ((__mode__ (TI)));
 /* Macros for __uuidof template-based emulation */
 #if defined(__cplusplus) && (USE___UUIDOF == 0)
 
-#if __cpp_constexpr >= 200704l && __cpp_inline_variables >= 201606L
 #define __CRT_UUID_DECL(type,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8)\
 extern "C++" {   \
-template<> struct __mingw_uuidof_s {   \
-static constexpr IID __uuid_inst = { \
+  static inline  \
+  const GUID& __mingw_uuidof_v2(type**) throw() {\
+static const GUID __uuid_inst = {\
 l,w1,w2, {b1,b2,b3,b4,b5,b6,b7,b8}   \
 };   \
-};   \
-template<> constexpr const GUID &__mingw_uuidof() {\
-return __mingw_uuidof_s::__uuid_inst;  \
-}\
-template<> constexpr const GUID &__mingw_uuidof() {   \
-return  __mingw_uuidof_s::__uuid_inst; \
-}\
+return __uuid_inst;  \
+  }  \
 }
-#else
-#define __CRT_UUID_DECL(type,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8)   \
-extern "C++" {  \
-template<> inline const GUID &__mingw_uuidof() {  \
-static const IID __uuid_inst = {l,w1,w2, {b1,b2,b3,b4,b5,b6,b7,b8}}; \
-return __uuid_inst; \
-}   \
-template<> inline const GUID &__mingw_uuidof() { \
-return __mingw_uuidof();  \
-}   \
-}
-#endif
 
-#define __uuidof(type) __mingw_uuidof<__typeof(type)>()
+/* The parentheses around `__mingw_uuidof_v2` prevent ADL.
+ * The extra level of pointer declaration prevents evil implicit conversions.  
*/
+#define __uuidof(type) ((__mingw_uuidof_v2)(static_cast<__typeof(type)**>(0)))
 
 #else
 
diff --git a/mingw-w64-headers/include/guiddef.h 
b/mingw-w64-headers/include/guiddef.h
index 8b7d5109..f5818e56 100644
--- a/mingw-w64-headers/include/guiddef.h
+++ b/mingw-w64-headers/include/guiddef.h
@@ -25,17 +25,6 @@ typedef struct _GUID {
 #endif
 #endif
 
-#if defined(__cplusplus) && (USE___UUIDOF == 0)
-extern "C++" {
-#if __cpp_constexpr >= 200704l && __cpp_inline_variables >= 201606L
-__extension__ template struct __mingw_uuidof_s;
-__extension__ template constexpr const GUID &__mingw_uuidof();
-#else
-__extension__ template const GUID &__mingw_uuidof();
-#endif
-}
-#endif
-
 #ifndef FAR
 #define FAR
 #endif
-- 
2.31.1



OpenPGP_signature
Description: OpenPGP digital signature
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] [PATCH] headers: Add more constants to STORAGE_BUS_TYPE.

2021-05-14 Thread JonY via Mingw-w64-public

On 5/14/21 12:35 PM, Christian Franke wrote:

... in particular BusTypeNvme.



Patch OK, will push soon if no objections.



OpenPGP_signature
Description: OpenPGP digital signature
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


[Mingw-w64-public] [PATCH] headers: Add more constants to STORAGE_BUS_TYPE.

2021-05-14 Thread Christian Franke

... in particular BusTypeNvme.

From 26b61d33a96e4cede27e2ebf8e3e1b535df7b9f5 Mon Sep 17 00:00:00 2001
From: Christian Franke 
Date: Fri, 14 May 2021 14:12:05 +0200
Subject: [PATCH] headers: Add more constants to STORAGE_BUS_TYPE.

Signed-off-by: Christian Franke 
---
 mingw-w64-headers/include/winioctl.h | 4 
 1 file changed, 4 insertions(+)

diff --git a/mingw-w64-headers/include/winioctl.h 
b/mingw-w64-headers/include/winioctl.h
index e27cc3fb..76664e57 100644
--- a/mingw-w64-headers/include/winioctl.h
+++ b/mingw-w64-headers/include/winioctl.h
@@ -461,6 +461,10 @@ typedef struct _STORAGE_READ_CAPACITY {
 #if (_WIN32_WINNT >= 0x0601)
 BusTypeVirtual = 0xE,
 BusTypeFileBackedVirtual   = 0xF,
+BusTypeSpaces  = 0x10,
+BusTypeNvme= 0x11,
+BusTypeSCM = 0x12,
+BusTypeUfs = 0x13,
 #endif /*(_WIN32_WINNT >= 0x0601)*/
 BusTypeMax,
 BusTypeMaxReserved = 0x7F 
-- 
2.31.1

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


Re: [Mingw-w64-public] [PATCH] headers: Add wmsdk.h

2021-05-14 Thread JonY via Mingw-w64-public

On 5/13/21 3:31 PM, Biswapriyo Nath wrote:





Patch OK, will commit soon if nobody has objections.



OpenPGP_signature
Description: OpenPGP digital signature
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


[Mingw-w64-public] __CRT_UUID_DECL in namespace causes error

2021-05-14 Thread Biswapriyo Nath
If an interface declaration is moved inside a namespace
__CRT_UUID_DECL produces error. The error is: explicit specialization
of 'template const GUID& __mingw_uuidof()' outside its
namespace must use a nested-name-specifier [-fpermissive].

A simple reproducible code is attached (test.cpp). The same thing
happen with qtmultimedia/src/plugins/wmf/player/mfvideorenderercontrol.cpp
file of branch 5.15.2.
#include 

namespace
{
MIDL_INTERFACE("12345678-1234-1234-1234-123456789012")
IFooBar : public IUnknown
{
virtual void Foo(void) = 0;
};

#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(IFooBar, 0x12345678, 0x1234, 0x1234, 
0x12,0x34,0x12,0x34,0x56,0x78,0x90,0x12)
#endif

GUID var = __uuidof(IFooBar);
}
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public