[Mingw-w64-public] [PATCH] for push/pop macro problem

2016-08-21 Thread David Wohlferd
Under certain circumstances, the #pragma pop_macro("__has_builtin") at 
the bottom of intrin-impl.h can be called without ever having hit the 
#pragma push_macro("__has_builtin") at the top.  Clang warns about this, 
so I have moved the push appropriately.


Patch attached.

dw

diff --git a/mingw-w64-headers/include/psdk_inc/intrin-impl.h b/mingw-w64-headers/include/psdk_inc/intrin-impl.h
index 7da3238..f8dc78f 100644
--- a/mingw-w64-headers/include/psdk_inc/intrin-impl.h
+++ b/mingw-w64-headers/include/psdk_inc/intrin-impl.h
@@ -61,6 +61,12 @@ __INTRINSICS_USEINLINE
 
 #ifdef __MINGW_INTRIN_INLINE
 
+/* Clang has support for MSVC builtins, GCC doesn't */
+#pragma push_macro("__has_builtin")
+#ifndef __has_builtin
+  #define __has_builtin(x) 0
+#endif
+
 /* These macros are used by the routines below.  While this file may be included 
multiple times, these macros only need to be defined once. */
 #ifndef _INTRIN_MAC_
@@ -80,12 +86,6 @@ __INTRINSICS_USEINLINE
 #define __FLAGCLOBBER2
 #endif
 
-/* Clang has support for MSVC builtins, GCC doesn't */
-#pragma push_macro("__has_builtin")
-#ifndef __has_builtin
-  #define __has_builtin(x) 0
-#endif
-
 /* This macro is used by __stosb, __stosw, __stosd, __stosq */
 
 /* Parameters: (FunctionName, DataType, Operator)
--
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


[Mingw-w64-public] [PATCH] for missing voids

2016-08-21 Thread David Wohlferd

To my surprise, these two statements have (slightly) different meanings:

  STDAPI MFUnregisterPlatformFromMMCSS ();
  STDAPI MFUnregisterPlatformFromMMCSS (void);

And clang complains about it (warning: function with no prototype cannot 
use the stdcall calling convention).


I have added 'void' every place clang complained (attached).

dw

diff --git a/mingw-w64-headers/include/commctrl.h b/mingw-w64-headers/include/commctrl.h
index 23adb9e..70d00b4 100644
--- a/mingw-w64-headers/include/commctrl.h
+++ b/mingw-w64-headers/include/commctrl.h
@@ -436,7 +436,7 @@ extern "C" {
 #define ILCF_SWAP 0x1
   WINCOMMCTRLAPI WINBOOL WINAPI ImageList_Copy(HIMAGELIST himlDst,int iDst,HIMAGELIST himlSrc,int iSrc,UINT uFlags);
   WINCOMMCTRLAPI WINBOOL WINAPI ImageList_BeginDrag(HIMAGELIST himlTrack,int iTrack,int dxHotspot,int dyHotspot);
-  WINCOMMCTRLAPI void WINAPI ImageList_EndDrag();
+  WINCOMMCTRLAPI void WINAPI ImageList_EndDrag(void);
   WINCOMMCTRLAPI WINBOOL WINAPI ImageList_DragEnter(HWND hwndLock,int x,int y);
   WINCOMMCTRLAPI WINBOOL WINAPI ImageList_DragLeave(HWND hwndLock);
   WINCOMMCTRLAPI WINBOOL WINAPI ImageList_DragMove(int x,int y);
diff --git a/mingw-w64-headers/include/mfapi.h b/mingw-w64-headers/include/mfapi.h
index 94404ce..fa41c97 100644
--- a/mingw-w64-headers/include/mfapi.h
+++ b/mingw-w64-headers/include/mfapi.h
@@ -71,9 +71,9 @@ extern "C" {
 #endif
 );
 
-  STDAPI MFShutdown ();
-  STDAPI MFLockPlatform ();
-  STDAPI MFUnlockPlatform ();
+  STDAPI MFShutdown (void);
+  STDAPI MFLockPlatform (void);
+  STDAPI MFUnlockPlatform (void);
   STDAPI MFPutWorkItem2 (DWORD dwQueue, LONG Priority, IMFAsyncCallback *pCallback, IUnknown *pState);
   STDAPI MFPutWorkItemEx2 (DWORD dwQueue, LONG Priority, IMFAsyncResult *pResult);
   STDAPI MFPutWaitingWorkItem (HANDLE hEvent, LONG Priority, IMFAsyncResult *pResult, MFWORKITEM_KEY *pKey);
@@ -124,7 +124,7 @@ extern "C" {
   STDAPI MFGetWorkQueueMMCSSClass (DWORD dwWorkQueueId, LPWSTR pwszClass, DWORD *pcchClass);
   STDAPI MFGetWorkQueueMMCSSTaskId (DWORD dwWorkQueueId, LPDWORD pdwTaskId);
   STDAPI MFRegisterPlatformWithMMCSS (PCWSTR wszClass, DWORD *pdwTaskId, LONG lPriority);
-  STDAPI MFUnregisterPlatformFromMMCSS ();
+  STDAPI MFUnregisterPlatformFromMMCSS (void);
   STDAPI MFGetWorkQueueMMCSSPriority (DWORD dwWorkQueueId, LONG *lPriority);
   STDAPI MFCreateFile (MF_FILE_ACCESSMODE AccessMode, MF_FILE_OPENMODE OpenMode, MF_FILE_FLAGS fFlags, LPCWSTR pwszFileURL, IMFByteStream **ppIByteStream);
   STDAPI MFCreateTempFile (MF_FILE_ACCESSMODE AccessMode, MF_FILE_OPENMODE OpenMode, MF_FILE_FLAGS fFlags, IMFByteStream **ppIByteStream);
@@ -148,7 +148,7 @@ extern "C" {
 
 #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_APP)
   STDAPI MFLockDXGIDeviceManager (UINT *pResetToken, IMFDXGIDeviceManager **ppManager);
-  STDAPI MFUnlockDXGIDeviceManager ();
+  STDAPI MFUnlockDXGIDeviceManager (void);
   STDAPI MFCreateDXGISurfaceBuffer (REFIID riid, IUnknown *punkSurface, UINT uSubresourceIndex, WINBOOL fBottomUpWhenLinear, IMFMediaBuffer **ppBuffer);
   STDAPI MFCreateVideoSampleAllocatorEx (REFIID riid, void **ppSampleAllocator);
   STDAPI MFCreateDXGIDeviceManager (UINT *resetToken, IMFDXGIDeviceManager **ppDeviceManager);
diff --git a/mingw-w64-headers/include/rpcdce.h b/mingw-w64-headers/include/rpcdce.h
index 289a780..5c0af03 100644
--- a/mingw-w64-headers/include/rpcdce.h
+++ b/mingw-w64-headers/include/rpcdce.h
@@ -235,7 +235,7 @@ extern "C" {
   RPCRTAPI RPC_STATUS RPC_ENTRY RpcServerUseProtseqIfExA(RPC_CSTR Protseq,unsigned int MaxCalls,RPC_IF_HANDLE IfSpec,void *SecurityDescriptor,PRPC_POLICY Policy);
   RPCRTAPI RPC_STATUS RPC_ENTRY RpcServerUseProtseqIfW(RPC_WSTR Protseq,unsigned int MaxCalls,RPC_IF_HANDLE IfSpec,void *SecurityDescriptor);
   RPCRTAPI RPC_STATUS RPC_ENTRY RpcServerUseProtseqIfExW(RPC_WSTR Protseq,unsigned int MaxCalls,RPC_IF_HANDLE IfSpec,void *SecurityDescriptor,PRPC_POLICY Policy);
-  RPCRTAPI void RPC_ENTRY RpcServerYield ();
+  RPCRTAPI void RPC_ENTRY RpcServerYield (void);
   RPCRTAPI RPC_STATUS RPC_ENTRY RpcMgmtStatsVectorFree(RPC_STATS_VECTOR **StatsVector);
   RPCRTAPI RPC_STATUS RPC_ENTRY RpcMgmtInqStats(RPC_BINDING_HANDLE Binding,RPC_STATS_VECTOR **Statistics);
   RPCRTAPI RPC_STATUS RPC_ENTRY RpcMgmtIsServerListening(RPC_BINDING_HANDLE Binding);
@@ -454,7 +454,7 @@ extern "C" {
 
   RPCRTAPI RPC_STATUS RPC_ENTRY RpcImpersonateClient(RPC_BINDING_HANDLE BindingHandle);
   RPCRTAPI RPC_STATUS RPC_ENTRY RpcRevertToSelfEx(RPC_BINDING_HANDLE BindingHandle);
-  RPCRTAPI RPC_STATUS RPC_ENTRY RpcRevertToSelf();
+  RPCRTAPI RPC_STATUS RPC_ENTRY RpcRevertToSelf(void);
   RPCRTAPI RPC_STATUS RPC_ENTRY RpcBindingInqAuthClientA(RPC_BINDING_HANDLE ClientBinding,RPC_AUTHZ_HANDLE *Privs,RPC_CSTR *ServerPrincName,unsigned __LONG32 *AuthnLevel,unsigned __LONG32 *AuthnSvc,unsigned __LONG32 *AuthzSvc);
   RPCRTAPI RPC_STATUS RPC_ENTRY RpcBindingInqAuthClientW(RPC_BINDING_HANDLE ClientBinding,RPC_AUTHZ_HANDLE *Privs,RPC_WSTR 

[Mingw-w64-public] [PATCH] for sinhl()

2016-08-21 Thread David Wohlferd

In this function:

long double sinhl(long double x)

there is a call to fabs:

  (fabs (x) > (MAXLOGL + LOGE2L)))

However, fabs doesn't take a (long double), it only takes a (double).  
Clang complains about the truncation (warning: absolute value function 
'fabs' given an argument of type 'long double' but has parameter of type 
'double' which may cause truncation of value).


Patch attached.

dw

diff --git a/mingw-w64-crt/math/sinhl.c b/mingw-w64-crt/math/sinhl.c
index f6ecef0..4db0e51 100644
--- a/mingw-w64-crt/math/sinhl.c
+++ b/mingw-w64-crt/math/sinhl.c
@@ -67,7 +67,7 @@ long double sinhl(long double x)
   if (x_class == FP_ZERO)
 return x;
   if (x_class == FP_INFINITE ||
-  (fabs (x) > (MAXLOGL + LOGE2L)))
+  (fabsl (x) > (MAXLOGL + LOGE2L)))
   {
 errno = ERANGE;
 #ifdef INFINITIES
--
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] error: operator '==' has no left operand, #if (defined(_FILE_OFFSET_BITS) && (_FILE_OFFSET_BITS == 64))

2016-08-21 Thread David Wohlferd
To get this error, I have to have a line like:

#define _FILE_OFFSET_BITS

_FILE_OFFSET_BITS should either be undefined, or be set to 32 or 64 (see 
https://www.gnu.org/software/libc/manual/html_node/Feature-Test-Macros.html). 
'Blank' is not a valid setting.

I'm not sure where this is happening in your build, but that's what you 
need to look for.

dw

On 8/21/2016 6:15 PM, kl222 wrote:
> When I compile tiff, the following error occurred:
>
> [ 4%] Building C object libtiff/CMakeFiles/tiff.dir/tif_close.c.obj
> In file included from D:/msys32/mingw32/i686-w64-mingw32/include/io.h:169:0,
>from D:/msys32/mingw32/i686-w64-mingw32/include/fcntl.h:8,
>from
> D:/source/rabbitim/ThirdLibrary/src/tiff/libtiff/tiffiop.h:36,
>from
> D:/source/rabbitim/ThirdLibrary/src/tiff/libtiff/tif_aux.c:32:
> D:/msys32/mingw32/i686-w64-mingw32/include/_mingw_off_t.h:23:55: error:
> operator '==' has no left operand
>#if (defined(_FILE_OFFSET_BITS) && (_FILE_OFFSET_BITS == 64))
>  ^~
> In file included from
> D:/msys32/mingw32/i686-w64-mingw32/include/fcntl.h:8:0,
>from
> D:/source/rabbitim/ThirdLibrary/src/tiff/libtiff/tiffiop.h:36,
>from
> D:/source/rabbitim/ThirdLibrary/src/tiff/libtiff/tif_aux.c:32:
>
> My gcc:
>
> $ gcc -v
> Using built-in specs.
> COLLECT_GCC=D:\msys32\mingw32\bin\gcc.exe
> COLLECT_LTO_WRAPPER=D:/msys32/mingw32/bin/../lib/gcc/i686-w64-mingw32/6.1.0/lto-wrapper.exe
> Target: i686-w64-mingw32
> Configured with: ../gcc-6.1.0/configure --prefix=/mingw32
> --with-local-prefix=/mingw32/local --build=i686-w64-mingw32
> --host=i686-w64-mingw32 --target=i686-w64-mingw32
> --with-native-system-header-dir=/mingw32/i686-w64-mingw32/include
> --libexecdir=/mingw32/lib --enable-bootstrap --with-arch=i686
> --with-tune=generic
> --enable-languages=c,lto,c++,objc,obj-c++,fortran,ada --enable-shared
> --enable-static --enable-libatomic --enable-threads=posix
> --enable-graphite --enable-fully-dynamic-string
> --enable-libstdcxx-time=yes --disable-libstdcxx-pch
> --disable-libstdcxx-debug --disable-isl-version-check --enable-lto
> --enable-libgomp --disable-multilib --enable-checking=release
> --disable-rpath --disable-win32-registry --disable-nls --disable-werror
> --disable-symvers --with-libiconv --with-system-zlib --with-gmp=/mingw32
> --with-mpfr=/mingw32 --with-mpc=/mingw32 --with-isl=/mingw32
> --with-pkgversion='Rev1, Built by MSYS2 project'
> --with-bugurl=https://sourceforge.net/projects/msys2 --with-gnu-as
> --with-gnu-ld --disable-sjlj-exceptions --with-dwarf2
> Thread model: posix
> gcc version 6.1.0 (Rev1, Built by MSYS2 project)
>
>
> This is mingw of BUG?
>
> --
> ___
> Mingw-w64-public mailing list
> Mingw-w64-public@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
>


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