Re: [Mingw-w64-public] pthread_attr_setschedpolicy not implemented

2013-11-16 Thread Kai Tietz
2013/11/15 Victor Bombi son...@telefonica.net:

 thanks for answering.
 Nothing is trivial for me using pthreads.
 I just need that to compile code made by others that I would not like to
 change.


I added at revision 6370 to trunk the function
pthread_attr_getschedpolicy and pthread_attr_setschedpolicy for
winpthread.

Have fun,
Kai

--
DreamFactory - Open Source REST  JSON Services for HTML5  Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471iu=/4140/ostg.clktrk
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] pthread_attr_setschedpolicy not implemented

2013-11-16 Thread Victor Bombi
Thanks alot
- Original Message - 
From: Kai Tietz ktiet...@googlemail.com
To: mingw-w64-public@lists.sourceforge.net
Sent: Saturday, November 16, 2013 1:21 PM
Subject: Re: [Mingw-w64-public] pthread_attr_setschedpolicy not implemented


 2013/11/15 Victor Bombi son...@telefonica.net:

 thanks for answering.
 Nothing is trivial for me using pthreads.
 I just need that to compile code made by others that I would not like to
 change.


 I added at revision 6370 to trunk the function
 pthread_attr_getschedpolicy and pthread_attr_setschedpolicy for
 winpthread.

 Have fun,
 Kai

 --
 DreamFactory - Open Source REST  JSON Services for HTML5  Native Apps
 OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
 Free app hosting. Or install the open source package on any LAMP server.
 Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
 http://pubads.g.doubleclick.net/gampad/clk?id=63469471iu=/4140/ostg.clktrk
 ___
 Mingw-w64-public mailing list
 Mingw-w64-public@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/mingw-w64-public 


--
DreamFactory - Open Source REST  JSON Services for HTML5  Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471iu=/4140/ostg.clktrk
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] C++11 threading with non-posix versions

2013-11-16 Thread Ruben Van Boxem
2013/11/16 Victor Bombi son...@telefonica.net

  Is there any plan to write this headers on top of win32 api?


No, and any efficient implementation will remove Windows XP compatibility.
Winpthreads is implemented on top of the Win32 API, and GCC's internal
thread API is pretty much a pthreads abstraction, so it's really only just
one extra layer. If you have actual performance issues, I'm sure Kai will
be happy to try and resolve them for you by improving winpthreads.

Ruben

 - Original Message -
 *From:* Ruben Van Boxem vanboxem.ru...@gmail.com
 *To:* mingw-w64-public@lists.sourceforge.net
 *Sent:* Friday, November 15, 2013 7:41 PM
 *Subject:* Re: [Mingw-w64-public] C++11 threading with non-posix versions

  2013/11/15 Victor Bombi son...@telefonica.net

 Hello,

 Why cant we have C++11 threading with non-posix versions?


 Because libstdc++ implements thread, mutex and future on top of
 GCC's internal thread API, for which only the posix threads backend is
 implemented fully.


 Ruben



 best
 victor



 --
 DreamFactory - Open Source REST  JSON Services for HTML5  Native Apps
 OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
 Free app hosting. Or install the open source package on any LAMP server.
 Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!

 http://pubads.g.doubleclick.net/gampad/clk?id=63469471iu=/4140/ostg.clktrk
 ___
 Mingw-w64-public mailing list
 Mingw-w64-public@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


  --


 --
 DreamFactory - Open Source REST  JSON Services for HTML5  Native Apps
 OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
 Free app hosting. Or install the open source package on any LAMP server.
 Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
 http://pubads.g.doubleclick.net/gampad/clk?id=63469471iu=/4140/ostg.clktrk

 --

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



 --
 DreamFactory - Open Source REST  JSON Services for HTML5  Native Apps
 OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
 Free app hosting. Or install the open source package on any LAMP server.
 Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
 http://pubads.g.doubleclick.net/gampad/clk?id=63469471iu=/4140/ostg.clktrk
 ___
 Mingw-w64-public mailing list
 Mingw-w64-public@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


--
DreamFactory - Open Source REST  JSON Services for HTML5  Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471iu=/4140/ostg.clktrk___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] C++11 threading with non-posix versions

2013-11-16 Thread Ruben Van Boxem
2013/11/16 Victor Bombi son...@telefonica.net

  the information provided here
 http://qt-project.org/wiki/MinGW-64-bit
 could be then confusing or inacurate?


If Qt people say there might be a performance degradation (I read the web
page to only talk about C++11 threading features), then I believe them. I
guess I'm not very familiar with heavy threading applications.

Ruben

  - Original Message -
 *From:* Ruben Van Boxem vanboxem.ru...@gmail.com
 *To:* mingw-w64-public@lists.sourceforge.net
 *Sent:* Saturday, November 16, 2013 2:22 PM
 *Subject:* Re: [Mingw-w64-public] C++11 threading with non-posix versions

  2013/11/16 Victor Bombi son...@telefonica.net

  Is there any plan to write this headers on top of win32 api?


 No, and any efficient implementation will remove Windows XP compatibility.
 Winpthreads is implemented on top of the Win32 API, and GCC's internal
 thread API is pretty much a pthreads abstraction, so it's really only just
 one extra layer. If you have actual performance issues, I'm sure Kai will
 be happy to try and resolve them for you by improving winpthreads.

 Ruben

- Original Message -
 *From:* Ruben Van Boxem vanboxem.ru...@gmail.com
 *To:* mingw-w64-public@lists.sourceforge.net
 *Sent:* Friday, November 15, 2013 7:41 PM
 *Subject:* Re: [Mingw-w64-public] C++11 threading with non-posix versions

  2013/11/15 Victor Bombi son...@telefonica.net

 Hello,

 Why cant we have C++11 threading with non-posix versions?


 Because libstdc++ implements thread, mutex and future on top of
 GCC's internal thread API, for which only the posix threads backend is
 implemented fully.


 Ruben



 best
 victor



 --
 DreamFactory - Open Source REST  JSON Services for HTML5  Native Apps
 OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
 Free app hosting. Or install the open source package on any LAMP server.
 Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!

 http://pubads.g.doubleclick.net/gampad/clk?id=63469471iu=/4140/ostg.clktrk
 ___
 Mingw-w64-public mailing list
 Mingw-w64-public@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


  --


 --
 DreamFactory - Open Source REST  JSON Services for HTML5  Native Apps
 OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
 Free app hosting. Or install the open source package on any LAMP server.
 Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!

 http://pubads.g.doubleclick.net/gampad/clk?id=63469471iu=/4140/ostg.clktrk

 --

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



 --
 DreamFactory - Open Source REST  JSON Services for HTML5  Native Apps
 OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
 Free app hosting. Or install the open source package on any LAMP server.
 Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!

 http://pubads.g.doubleclick.net/gampad/clk?id=63469471iu=/4140/ostg.clktrk
 ___
 Mingw-w64-public mailing list
 Mingw-w64-public@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


  --


 --
 DreamFactory - Open Source REST  JSON Services for HTML5  Native Apps
 OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
 Free app hosting. Or install the open source package on any LAMP server.
 Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
 http://pubads.g.doubleclick.net/gampad/clk?id=63469471iu=/4140/ostg.clktrk

 --

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



 --
 DreamFactory - Open Source REST  JSON Services for HTML5  Native Apps
 OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
 Free app hosting. Or install the open source package on any LAMP server.
 Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
 http://pubads.g.doubleclick.net/gampad/clk?id=63469471iu=/4140/ostg.clktrk
 ___
 Mingw-w64-public mailing list
 Mingw-w64-public@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/mingw-w64-public



Re: [Mingw-w64-public] C++11 threading with non-posix versions

2013-11-16 Thread K. Frank
Hello Victor (and Ruben)!

On Sat, Nov 16, 2013 at 10:39 AM, Ruben Van Boxem ru...@box.mail wrote:
 2013/11/16 Victor Bombi bo...@away.net

 the information provided here
 http://qt-project.org/wiki/MinGW-64-bit
 could be then confusing or inacurate?

 If Qt people say there might be a performance degradation (I read the web
 page to only talk about C++11 threading features), then I believe them. I
 guess I'm not very familiar with heavy threading applications.

 Ruben

 - Original Message -
 From: Ruben Van Boxem

 2013/11/16 Victor Bombi boxoff...@bomb.net

 Is there any plan to write this headers on top of win32 api?

 No, and any efficient implementation will remove Windows XP compatibility.
 Winpthreads is implemented on top of the Win32 API, and GCC's internal
 thread API is pretty much a pthreads abstraction, so it's really only just
 one extra layer. If you have actual performance issues, I'm sure Kai will be
 happy to try and resolve them for you by improving winpthreads.

 Ruben
 ...

I did some crude mingw-w64 std::thread performance tests a few years
back comparing the winpthreads std::thread implementation with a
win32-based implementation.

In general, sometimes winpthreads was faster, and sometimes slower.
If I remember correctly, I think winpthreads was significantly slower in
thread creation (and maybe faster in mutex access in the face of
contention), but I reasoned that thread creation is in general a little
bit expensive: if you don't create a lot of threads, the additional cost
won't really matter, and if you create enough threads for the additional
winpthreads cost to matter, the cost of creating native win32 threads
would also matter, and you should probably be using a thread pool.

Bear in mind, this was a while ago.  Winpthreads has presumably been
tuned up some since then, and the win32 implementation was competent,
but not highly optimized.


Happy Multi-Threaded Hacking!


K. Frank

--
DreamFactory - Open Source REST  JSON Services for HTML5  Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471iu=/4140/ostg.clktrk
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


[Mingw-w64-public] [PATCH 1/5] gai_strerrorA: reimplement without FormatMessageA (forbidden in Windows Store)

2013-11-16 Thread Rafaël Carré
---
 mingw-w64-crt/libsrc/ws2tcpip/gai_strerrorA.c | 13 -
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/mingw-w64-crt/libsrc/ws2tcpip/gai_strerrorA.c 
b/mingw-w64-crt/libsrc/ws2tcpip/gai_strerrorA.c
index 8f7f679..956f84f 100644
--- a/mingw-w64-crt/libsrc/ws2tcpip/gai_strerrorA.c
+++ b/mingw-w64-crt/libsrc/ws2tcpip/gai_strerrorA.c
@@ -5,13 +5,16 @@
 #define __CRT__NO_INLINE
 #include winsock2.h
 #include ws2tcpip.h
+#include stdlib.h
 
-char *gai_strerrorA(int ecode)
+WINAPI char *gai_strerrorA(int ecode)
 {
-   DWORD dwMsgLen __attribute__((unused));
static char buff[GAI_STRERROR_BUFFER_SIZE + 1];
-   dwMsgLen = 
FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS|FORMAT_MESSAGE_MAX_WIDTH_MASK,
- NULL, ecode, 
MAKELANGID(LANG_NEUTRAL,SUBLANG_DEFAULT), (LPSTR)buff,
- GAI_STRERROR_BUFFER_SIZE, NULL);
+wchar_t *u = gai_strerrorW(ecode);
+if (!u)
+return NULL;
+
+wcstombs(buff, u, GAI_STRERROR_BUFFER_SIZE + 1);
+
return buff;
 }
-- 
1.8.3.2


--
DreamFactory - Open Source REST  JSON Services for HTML5  Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471iu=/4140/ostg.clktrk
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


[Mingw-w64-public] [PATCH 4/5] winstorecompat: *QueueTimer replacements (deactivated for now)

2013-11-16 Thread Rafaël Carré
---
 mingw-w64-libraries/winstorecompat/Makefile.am |  1 +
 .../winstorecompat/src/QueueTimer.c| 49 ++
 2 files changed, 50 insertions(+)
 create mode 100644 mingw-w64-libraries/winstorecompat/src/QueueTimer.c

diff --git a/mingw-w64-libraries/winstorecompat/Makefile.am 
b/mingw-w64-libraries/winstorecompat/Makefile.am
index 21c5259..db85c96 100644
--- a/mingw-w64-libraries/winstorecompat/Makefile.am
+++ b/mingw-w64-libraries/winstorecompat/Makefile.am
@@ -34,4 +34,5 @@ libwinstorecompat_a_SOURCES = \
   src/Tls.c \
   src/CoCreateInstance.c \
   src/SHGetFolderPathW.c \
+  src/QueueTimer.c \
   $(NULL)
diff --git a/mingw-w64-libraries/winstorecompat/src/QueueTimer.c 
b/mingw-w64-libraries/winstorecompat/src/QueueTimer.c
new file mode 100644
index 000..48d8e7f
--- /dev/null
+++ b/mingw-w64-libraries/winstorecompat/src/QueueTimer.c
@@ -0,0 +1,49 @@
+/*
+Copyright (c) 2013 mingw-w64 project
+
+Contributing authors: Rafaël Carré
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the Software),
+to deal in the Software without restriction, including without limitation
+the rights to use, copy, modify, merge, publish, distribute, sublicense,
+and/or sell copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
+*/
+
+#define CreateTimerQueueTimer _CreateTimerQueueTimer
+#define DeleteTimerQueueTimer _DeleteTimerQueueTimer
+#include windows.h
+#include threadpoollegacyapiset.h
+#undef CreateTimerQueueTimer
+#undef DeleteTimerQueueTimer
+
+WINBOOL WINAPI CreateTimerQueueTimer (PHANDLE phNewTimer, HANDLE TimerQueue, 
WAITORTIMERCALLBACK Callback, PVOID Parameter, DWORD DueTime, DWORD Period, 
ULONG Flags);
+
+WINBOOL WINAPI CreateTimerQueueTimer (PHANDLE phNewTimer, HANDLE TimerQueue, 
WAITORTIMERCALLBACK Callback, PVOID Parameter, DWORD DueTime, DWORD Period, 
ULONG Flags)
+{
+SetLastError(ERROR_ACCESS_DENIED);
+return 0;
+}
+
+WINBOOL WINAPI DeleteTimerQueueTimer (HANDLE TimerQueue, HANDLE Timer, HANDLE 
CompletionEvent);
+
+WINBOOL WINAPI DeleteTimerQueueTimer (HANDLE TimerQueue, HANDLE Timer, HANDLE 
CompletionEvent)
+{
+SetLastError(ERROR_ACCESS_DENIED);
+return 0;
+}
+
+WINBOOL (WINAPI *__MINGW_IMP_SYMBOL(CreateTimerQueueTimer)) (PHANDLE 
phNewTimer, HANDLE TimerQueue, WAITORTIMERCALLBACK Callback, PVOID Parameter, 
DWORD DueTime, DWORD Period, ULONG Flags) 
asm(__imp__CreateTimerQueueTimer@28) = CreateTimerQueueTimer;
+WINBOOL (WINAPI *__MINGW_IMP_SYMBOL(DeleteTimerQueueTimer)) (HANDLE 
TimerQueue, HANDLE Timer, HANDLE CompletionEvent) 
asm(__imp__DeleteTimerQueueTimer@12) = DeleteTimerQueueTimer;
-- 
1.8.3.2


--
DreamFactory - Open Source REST  JSON Services for HTML5  Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471iu=/4140/ostg.clktrk
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


[Mingw-w64-public] Windows 8 Store patches

2013-11-16 Thread Rafaël Carré
Hello,

As you probably know we have been working on VLC for Windows Store for 
a long time already.

Here are the latest patches we have to be able to build vlc.git without 
using forbidden symbols that would fail us at the validation step, using 
Microsoft Windows App Cert Kit (WACK).

Those are in raw form, so probably not committable as is but I would like 
to have a discussion about them.

Fix declarations in headers
That one is a couple of hacks put together just to have VLC to build.

- Use WINAPI in gai_strerrorA prototype. I have absolutely no idea why I 
did that 

- Check _WIN32_WINNT define additionally to WINVER. I don't know why 
WINVER was added here in r6188. What is its role compared to _WIN32_WINNT ?

- Revert a couple of #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP):
- winnls.h : no idea here.. I guess other headers depend on these 
declarations and were not commented out. I'll have to check.
- winbase.h : CreateSemaphoreW is reimplemented in libwinstorecompat, 
so we need to have the prototype available.
- combaseapi.h : same remark for CoCreateInstance
- shlobjidl.h : comment out FreeKnownFolderDefinitionFields, I guess 
that it brings a runtime dependency on CoTaskMemFree/ole32. Not sure 
I remember what was the problem here.

Of those hacks the ones of importance (because I don't remember the 
details for the other ones..) are CreateSemaphoreW / CoCreateInstance.

Do we want a special define to still have the prototypes for functions 
reimplemented in winstorecompat?
e.g. -D_WIN32_WINNT=0x602 (is it 0x603 for 8.1?) -DWINSTORECOMPAT


gai_strerrorA: reimplement without FormatMessageA
As vlc is cross platform we use the char * version of gai_strerror,
which is forbidden by Microsoft (only UNICODE APIs are allowed).
This patch makes it use the UNICODE version and convert the message to
ASCII.
I had to add WINAPI for it to build, as it's now declared as WINAPI in the 
header (see above patch).
Note that there were some comments about using mbstowcs which would pull 
another dependency.
Can we use WideCharToMultiByte here ?

Reimplement SHGetFolderPathW using WinRT functions
That one comes from Jean-Baptiste and is for libwinstorecompat.
Jean-Baptiste was there something else we need to do here?

winstorecompat: *QueueTimer replacements (deactivated for
I don't think I had sent that one, it is in the spirit of other functions 
already present in libwinstorecompat so likely not controversial.

More Windows Store forbidden APIs
Comment out a bunch of forbidden functions in the headers.


--
DreamFactory - Open Source REST  JSON Services for HTML5  Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471iu=/4140/ostg.clktrk
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


[Mingw-w64-public] [PATCH 5/5] Fix declarations in headers

2013-11-16 Thread Rafaël Carré
---
 mingw-w64-headers/include/combaseapi.h | 2 +-
 mingw-w64-headers/include/shobjidl.h   | 3 ++-
 mingw-w64-headers/include/winbase.h| 2 +-
 mingw-w64-headers/include/winnls.h | 6 +++---
 mingw-w64-headers/include/ws2tcpip.h   | 2 +-
 5 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/mingw-w64-headers/include/combaseapi.h 
b/mingw-w64-headers/include/combaseapi.h
index b79c4db..09b5ce9 100644
--- a/mingw-w64-headers/include/combaseapi.h
+++ b/mingw-w64-headers/include/combaseapi.h
@@ -257,7 +257,7 @@ WINOLEAPI CoCreateInstance (REFCLSID rclsid, LPUNKNOWN 
pUnkOuter, DWORD dwClsCon
 WINOLEAPI CoCreateInstanceEx (REFCLSID Clsid, IUnknown *punkOuter, DWORD 
dwClsCtx, COSERVERINFO *pServerInfo, DWORD dwCount, MULTI_QI *pResults);
 #endif
 
-#if WINAPI_FAMILY == WINAPI_FAMILY_APP
+#if 0 //WINAPI_FAMILY == WINAPI_FAMILY_APP
   __inline HRESULT CoCreateInstance (REFCLSID rclsid, LPUNKNOWN pUnkOuter, 
DWORD dwClsContext, REFIID riid, LPVOID *ppv) {
 MULTI_QI OneQI;
 HRESULT hr;
diff --git a/mingw-w64-headers/include/shobjidl.h 
b/mingw-w64-headers/include/shobjidl.h
index fde591d..8f245c7 100644
--- a/mingw-w64-headers/include/shobjidl.h
+++ b/mingw-w64-headers/include/shobjidl.h
@@ -29949,7 +29949,7 @@ HRESULT __RPC_STUB IKnownFolderManager_Redirect_Stub(
 
 #endif  /* __IKnownFolderManager_INTERFACE_DEFINED__ */
 
-
+#if 0
   __inline void FreeKnownFolderDefinitionFields(KNOWNFOLDER_DEFINITION *pKFD) {
 CoTaskMemFree(pKFD-pszName);
 CoTaskMemFree(pKFD-pszDescription);
@@ -29960,6 +29960,7 @@ HRESULT __RPC_STUB IKnownFolderManager_Redirect_Stub(
 CoTaskMemFree(pKFD-pszIcon);
 CoTaskMemFree(pKFD-pszSecurity);
   }
+#endif
 
 typedef enum SHARE_ROLE {
 SHARE_ROLE_INVALID = -1,
diff --git a/mingw-w64-headers/include/winbase.h 
b/mingw-w64-headers/include/winbase.h
index 93a0eb6..3b614d2 100644
--- a/mingw-w64-headers/include/winbase.h
+++ b/mingw-w64-headers/include/winbase.h
@@ -1487,7 +1487,7 @@ extern C {
 #define SHUTDOWN_NORETRY 0x1
 #endif
 
-#if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
+#if 1 //WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
   WINBASEAPI HANDLE WINAPI OpenMutexA (DWORD dwDesiredAccess, WINBOOL 
bInheritHandle, LPCSTR lpName);
   WINBASEAPI HANDLE WINAPI CreateSemaphoreA (LPSECURITY_ATTRIBUTES 
lpSemaphoreAttributes, LONG lInitialCount, LONG lMaximumCount, LPCSTR lpName);
   WINBASEAPI HANDLE WINAPI CreateSemaphoreW (LPSECURITY_ATTRIBUTES 
lpSemaphoreAttributes, LONG lInitialCount, LONG lMaximumCount, LPCWSTR lpName);
diff --git a/mingw-w64-headers/include/winnls.h 
b/mingw-w64-headers/include/winnls.h
index d59c363..6c6edbd 100644
--- a/mingw-w64-headers/include/winnls.h
+++ b/mingw-w64-headers/include/winnls.h
@@ -19,7 +19,7 @@ extern C {
 
 #ifndef NONLS
 
-#if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_APP)
+#if 1 //WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_APP)
 
 #ifndef _NORMALIZE_
 #define WINNORMALIZEAPI DECLSPEC_IMPORT
@@ -775,7 +775,7 @@ extern C {
 GEOCLASS_ALL = 0
   };
 
-#if WINVER = 0x0600
+#if WINVER = 0x0600 || _WIN32_WINNT = 0x600
   typedef enum _NORM_FORM {
 NormalizationOther = 0,
 NormalizationC = 0x1,
@@ -1048,7 +1048,7 @@ extern C {
 
 #define EnumSystemCodePages __MINGW_NAME_AW(EnumSystemCodePages)
 
-#if WINVER = 0x0600
+#if WINVER = 0x0600 || _WIN32_WINNT = 0x0600
 
 #define LOCALE_NAME_USER_DEFAULT NULL
 #define LOCALE_NAME_INVARIANT L
diff --git a/mingw-w64-headers/include/ws2tcpip.h 
b/mingw-w64-headers/include/ws2tcpip.h
index 0f05e76..2b038ce 100644
--- a/mingw-w64-headers/include/ws2tcpip.h
+++ b/mingw-w64-headers/include/ws2tcpip.h
@@ -274,7 +274,7 @@ extern C {
 
 #define GAI_STRERROR_BUFFER_SIZE 1024
 
-char *gai_strerrorA (int);
+WINAPI char *gai_strerrorA (int);
 WCHAR *gai_strerrorW(int);
 
 #define NI_MAXHOST 1025
-- 
1.8.3.2


--
DreamFactory - Open Source REST  JSON Services for HTML5  Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471iu=/4140/ostg.clktrk
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


[Mingw-w64-public] [PATCH 2/5] More Windows Store forbidden APIs

2013-11-16 Thread Rafaël Carré
---
 mingw-w64-headers/include/shellapi.h | 4 
 1 file changed, 4 insertions(+)

diff --git a/mingw-w64-headers/include/shellapi.h 
b/mingw-w64-headers/include/shellapi.h
index c036978..4d3a2ef 100644
--- a/mingw-w64-headers/include/shellapi.h
+++ b/mingw-w64-headers/include/shellapi.h
@@ -297,6 +297,8 @@ extern C {
 #endif
 #endif
 
+#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
+
   typedef struct _SHELLEXECUTEINFOA {
 DWORD cbSize;
 ULONG fMask;
@@ -436,6 +438,8 @@ extern C {
   SHSTDAPI SHGetPropertyStoreForWindow (HWND hwnd, REFIID riid, void **ppv);
 #endif
 
+#endif /* WINAPI_PARTITION_DESKTOP.  */
+
   typedef struct _NOTIFYICONDATAA {
 DWORD cbSize;
 HWND hWnd;
-- 
1.8.3.2


--
DreamFactory - Open Source REST  JSON Services for HTML5  Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471iu=/4140/ostg.clktrk
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


[Mingw-w64-public] [PATCH 3/5] Reimplement SHGetFolderPathW using WinRT functions

2013-11-16 Thread Rafaël Carré
From: Jean-Baptiste Kempf j...@videolan.org

---
 .../winstorecompat/src/SHGetFolderPathW.c  | 110 +++--
 1 file changed, 104 insertions(+), 6 deletions(-)

diff --git a/mingw-w64-libraries/winstorecompat/src/SHGetFolderPathW.c 
b/mingw-w64-libraries/winstorecompat/src/SHGetFolderPathW.c
index 9ae7d3c..c15136f 100644
--- a/mingw-w64-libraries/winstorecompat/src/SHGetFolderPathW.c
+++ b/mingw-w64-libraries/winstorecompat/src/SHGetFolderPathW.c
@@ -1,7 +1,8 @@
 /*
 Copyright (c) 2013 mingw-w64 project
 
-Contributing authors: Rafaël Carré
+Contributing authors: Jean-Baptiste Kempf
+  Rafaël Carré
 
 Permission is hereby granted, free of charge, to any person obtaining a
 copy of this software and associated documentation files (the Software),
@@ -23,15 +24,112 @@
 */
 
 #define SHGetFolderPathW __SHGetFolderPathW
+
+#define _WIN32_WINNT 0x602
+#define COBJMACROS
+#define INITGUID
+#include winstring.h
 #include windows.h
-#include shfolder.h
+#include shlobj.h
+#include roapi.h
+#include windows.storage.h
 #undef SHGetFolderPathW
 
-HRESULT WINAPI SHGetFolderPathW(HWND hwnd,int csidl,HANDLE hToken,DWORD 
dwFlags,LPWSTR pszPath);
+HRESULT WINAPI SHGetFolderPathW(HWND hwnd, int csidl, HANDLE hToken, DWORD 
dwFlags, LPWSTR pszPath) {
+
+IStorageFolder *folder;
+
+(void)hwnd;
+(void)hToken;
+
+if (dwFlags != SHGFP_TYPE_CURRENT)
+return E_NOTIMPL;
+
+folder = NULL;
+
+if (csidl == CSIDL_APPDATA) {
+IApplicationDataStatics *appDataStatics = NULL;
+IApplicationData *appData = NULL;
+static const WCHAR *className = LWindows.Storage.ApplicationData;
+const UINT32 clen = wcslen(className);
+
+HSTRING hClassName = NULL;
+HSTRING_HEADER header;
+HRESULT hr = WindowsCreateStringReference(className, clen, header, 
hClassName);
+if (hr) {
+WindowsDeleteString(hClassName);
+return E_FAIL;
+}
+
+hr = RoGetActivationFactory(hClassName, IID_IApplicationDataStatics, 
(void**)appDataStatics);
+WindowsDeleteString(hClassName);
+
+if (hr)
+return E_FAIL;
+
+IApplicationDataStatics_get_Current(appDataStatics, appData);
+
+if (!appData)
+return E_FAIL;
+
+IApplicationData_get_LocalFolder(appData, folder);
+
+IApplicationDataStatics_Release(appDataStatics);
+IApplicationData_Release(appData);
+
+} else {
+IKnownFoldersStatics *knownFoldersStatics = NULL;
+static const WCHAR *className = LWindows.Storage.KnownFolders;
+const UINT32 clen = wcslen(className);
+
+HSTRING hClassName = NULL;
+HSTRING_HEADER header;
+HRESULT hr = WindowsCreateStringReference(className, clen, header, 
hClassName);
+if (hr) {
+WindowsDeleteString(hClassName);
+return E_FAIL;
+}
+
+hr = RoGetActivationFactory(hClassName, IID_IKnownFoldersStatics, 
(void**)knownFoldersStatics);
+WindowsDeleteString(hClassName);
+
+if (hr)
+return E_FAIL;
+
+switch(csidl) {
+case CSIDL_PERSONAL:
+IKnownFoldersStatics_get_DocumentsLibrary(knownFoldersStatics, 
folder);
+break;
+case CSIDL_MYMUSIC:
+IKnownFoldersStatics_get_MusicLibrary(knownFoldersStatics, 
folder);
+break;
+case CSIDL_MYPICTURES:
+IKnownFoldersStatics_get_PicturesLibrary(knownFoldersStatics, 
folder);
+break;
+case CSIDL_MYVIDEO:
+IKnownFoldersStatics_get_VideosLibrary(knownFoldersStatics, 
folder);
+break;
+default:
+return E_INVALIDARG;
+}
+
+IKnownFoldersStatics_Release(knownFoldersStatics);
+}
+
+{
+HSTRING path = NULL;
+IStorageItem *item = NULL;
+PCWSTR pszPathTemp;
+
+IStorageFolder_QueryInterface(folder, IID_IStorageItem, 
(void**)item);
+IStorageItem_get_Path(item, path);
+
+pszPathTemp = WindowsGetStringRawBuffer(path, NULL);
+wcscpy(pszPath, pszPathTemp);
+WindowsDeleteString(path);
+}
 
-HRESULT WINAPI SHGetFolderPathW(HWND hwnd,int csidl,HANDLE hToken,DWORD 
dwFlags,LPWSTR pszPath)
-{
-return S_FALSE;
+return S_OK;
 }
 
 HRESULT (WINAPI *__MINGW_IMP_SYMBOL(SHGetFolderPathW))(HWND hwnd,int 
csidl,HANDLE hToken,DWORD dwFlags,LPWSTR pszPath) 
asm(__imp__SHGetFolderPathW@20) = SHGetFolderPathW;
-- 
1.8.3.2


--
DreamFactory - Open Source REST  JSON Services for HTML5  Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!

Re: [Mingw-w64-public] Windows 8 Store patches

2013-11-16 Thread Rafaël Carré
Le 16/11/2013 19:03, Rafaël Carré a écrit :
 Hello,
 
 As you probably know we have been working on VLC for Windows Store for 
 a long time already.
 
 Here are the latest patches we have to be able to build vlc.git without 
 using forbidden symbols that would fail us at the validation step, using 
 Microsoft Windows App Cert Kit (WACK).

I forgot to add that since we are now targetting Windows 8.1 through
VS2013, we need to add a def file for msvcr120 before we validate with
the Store Cert Kit.

--
DreamFactory - Open Source REST  JSON Services for HTML5  Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471iu=/4140/ostg.clktrk
___
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 2/5] More Windows Store forbidden APIs

2013-11-16 Thread Kai Tietz
Patch is ok.

Thanks,
Kai

2013/11/16 Rafaël Carré fun...@videolan.org:
 ---
  mingw-w64-headers/include/shellapi.h | 4 
  1 file changed, 4 insertions(+)

 diff --git a/mingw-w64-headers/include/shellapi.h 
 b/mingw-w64-headers/include/shellapi.h
 index c036978..4d3a2ef 100644
 --- a/mingw-w64-headers/include/shellapi.h
 +++ b/mingw-w64-headers/include/shellapi.h
 @@ -297,6 +297,8 @@ extern C {
  #endif
  #endif

 +#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
 +
typedef struct _SHELLEXECUTEINFOA {
  DWORD cbSize;
  ULONG fMask;
 @@ -436,6 +438,8 @@ extern C {
SHSTDAPI SHGetPropertyStoreForWindow (HWND hwnd, REFIID riid, void **ppv);
  #endif

 +#endif /* WINAPI_PARTITION_DESKTOP.  */
 +
typedef struct _NOTIFYICONDATAA {
  DWORD cbSize;
  HWND hWnd;
 --
 1.8.3.2


 --
 DreamFactory - Open Source REST  JSON Services for HTML5  Native Apps
 OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
 Free app hosting. Or install the open source package on any LAMP server.
 Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
 http://pubads.g.doubleclick.net/gampad/clk?id=63469471iu=/4140/ostg.clktrk
 ___
 Mingw-w64-public mailing list
 Mingw-w64-public@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

--
DreamFactory - Open Source REST  JSON Services for HTML5  Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471iu=/4140/ostg.clktrk
___
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 1/5] gai_strerrorA: reimplement without FormatMessageA (forbidden in Windows Store)

2013-11-16 Thread Kai Tietz
2013/11/16 Rafaël Carré fun...@videolan.org:
 ---
  mingw-w64-crt/libsrc/ws2tcpip/gai_strerrorA.c | 13 -
  1 file changed, 8 insertions(+), 5 deletions(-)

 diff --git a/mingw-w64-crt/libsrc/ws2tcpip/gai_strerrorA.c 
 b/mingw-w64-crt/libsrc/ws2tcpip/gai_strerrorA.c
 index 8f7f679..956f84f 100644
 --- a/mingw-w64-crt/libsrc/ws2tcpip/gai_strerrorA.c
 +++ b/mingw-w64-crt/libsrc/ws2tcpip/gai_strerrorA.c
 @@ -5,13 +5,16 @@
  #define __CRT__NO_INLINE
  #include winsock2.h
  #include ws2tcpip.h
 +#include stdlib.h

 -char *gai_strerrorA(int ecode)
 +WINAPI char *gai_strerrorA(int ecode)
For what is this WINAPI?  I doubt that it is required.  AFAI read
documentation is gai_strerrorA not stdcall.

  {
 -   DWORD dwMsgLen __attribute__((unused));
 static char buff[GAI_STRERROR_BUFFER_SIZE + 1];
 -   dwMsgLen = 
 FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS|FORMAT_MESSAGE_MAX_WIDTH_MASK,
 - NULL, ecode, 
 MAKELANGID(LANG_NEUTRAL,SUBLANG_DEFAULT), (LPSTR)buff,
 - GAI_STRERROR_BUFFER_SIZE, NULL);
 +wchar_t *u = gai_strerrorW(ecode);
 +if (!u)
 +return NULL;
Is it actual possible that gai_strerrorW returns NULL?!?

 +wcstombs(buff, u, GAI_STRERROR_BUFFER_SIZE + 1);
 +
 return buff;
  }
 --
 1.8.3.2

Rest of the patch is ok.

Regards,
Kai

--
DreamFactory - Open Source REST  JSON Services for HTML5  Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471iu=/4140/ostg.clktrk
___
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 5/5] Fix declarations in headers

2013-11-16 Thread Kai Tietz
2013/11/16 Rafaël Carré fun...@videolan.org:
 ---
  mingw-w64-headers/include/combaseapi.h | 2 +-
  mingw-w64-headers/include/shobjidl.h   | 3 ++-
  mingw-w64-headers/include/winbase.h| 2 +-
  mingw-w64-headers/include/winnls.h | 6 +++---
  mingw-w64-headers/include/ws2tcpip.h   | 2 +-
  5 files changed, 8 insertions(+), 7 deletions(-)

 diff --git a/mingw-w64-headers/include/combaseapi.h 
 b/mingw-w64-headers/include/combaseapi.h
 index b79c4db..09b5ce9 100644
 --- a/mingw-w64-headers/include/combaseapi.h
 +++ b/mingw-w64-headers/include/combaseapi.h
 @@ -257,7 +257,7 @@ WINOLEAPI CoCreateInstance (REFCLSID rclsid, LPUNKNOWN 
 pUnkOuter, DWORD dwClsCon
  WINOLEAPI CoCreateInstanceEx (REFCLSID Clsid, IUnknown *punkOuter, DWORD 
 dwClsCtx, COSERVERINFO *pServerInfo, DWORD dwCount, MULTI_QI *pResults);
  #endif

 -#if WINAPI_FAMILY == WINAPI_FAMILY_APP
 +#if 0 //WINAPI_FAMILY == WINAPI_FAMILY_APP
__inline HRESULT CoCreateInstance (REFCLSID rclsid, LPUNKNOWN pUnkOuter, 
 DWORD dwClsContext, REFIID riid, LPVOID *ppv) {
  MULTI_QI OneQI;
  HRESULT hr;
 diff --git a/mingw-w64-headers/include/shobjidl.h 
 b/mingw-w64-headers/include/shobjidl.h
 index fde591d..8f245c7 100644
 --- a/mingw-w64-headers/include/shobjidl.h
 +++ b/mingw-w64-headers/include/shobjidl.h
 @@ -29949,7 +29949,7 @@ HRESULT __RPC_STUB IKnownFolderManager_Redirect_Stub(

  #endif  /* __IKnownFolderManager_INTERFACE_DEFINED__ */

 -
 +#if 0
__inline void FreeKnownFolderDefinitionFields(KNOWNFOLDER_DEFINITION 
 *pKFD) {
  CoTaskMemFree(pKFD-pszName);
  CoTaskMemFree(pKFD-pszDescription);
 @@ -29960,6 +29960,7 @@ HRESULT __RPC_STUB IKnownFolderManager_Redirect_Stub(
  CoTaskMemFree(pKFD-pszIcon);
  CoTaskMemFree(pKFD-pszSecurity);
}
 +#endif

  typedef enum SHARE_ROLE {
  SHARE_ROLE_INVALID = -1,
 diff --git a/mingw-w64-headers/include/winbase.h 
 b/mingw-w64-headers/include/winbase.h
 index 93a0eb6..3b614d2 100644
 --- a/mingw-w64-headers/include/winbase.h
 +++ b/mingw-w64-headers/include/winbase.h
 @@ -1487,7 +1487,7 @@ extern C {
  #define SHUTDOWN_NORETRY 0x1
  #endif

 -#if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
 +#if 1 //WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
WINBASEAPI HANDLE WINAPI OpenMutexA (DWORD dwDesiredAccess, WINBOOL 
 bInheritHandle, LPCSTR lpName);
WINBASEAPI HANDLE WINAPI CreateSemaphoreA (LPSECURITY_ATTRIBUTES 
 lpSemaphoreAttributes, LONG lInitialCount, LONG lMaximumCount, LPCSTR lpName);
WINBASEAPI HANDLE WINAPI CreateSemaphoreW (LPSECURITY_ATTRIBUTES 
 lpSemaphoreAttributes, LONG lInitialCount, LONG lMaximumCount, LPCWSTR 
 lpName);
 diff --git a/mingw-w64-headers/include/winnls.h 
 b/mingw-w64-headers/include/winnls.h
 index d59c363..6c6edbd 100644
 --- a/mingw-w64-headers/include/winnls.h
 +++ b/mingw-w64-headers/include/winnls.h
 @@ -19,7 +19,7 @@ extern C {

  #ifndef NONLS

 -#if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_APP)
 +#if 1 //WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_APP)

  #ifndef _NORMALIZE_
  #define WINNORMALIZEAPI DECLSPEC_IMPORT
 @@ -775,7 +775,7 @@ extern C {
  GEOCLASS_ALL = 0
};

 -#if WINVER = 0x0600
 +#if WINVER = 0x0600 || _WIN32_WINNT = 0x600
typedef enum _NORM_FORM {
  NormalizationOther = 0,
  NormalizationC = 0x1,
 @@ -1048,7 +1048,7 @@ extern C {

  #define EnumSystemCodePages __MINGW_NAME_AW(EnumSystemCodePages)

 -#if WINVER = 0x0600
 +#if WINVER = 0x0600 || _WIN32_WINNT = 0x0600

  #define LOCALE_NAME_USER_DEFAULT NULL
  #define LOCALE_NAME_INVARIANT L
 diff --git a/mingw-w64-headers/include/ws2tcpip.h 
 b/mingw-w64-headers/include/ws2tcpip.h
 index 0f05e76..2b038ce 100644
 --- a/mingw-w64-headers/include/ws2tcpip.h
 +++ b/mingw-w64-headers/include/ws2tcpip.h
 @@ -274,7 +274,7 @@ extern C {

  #define GAI_STRERROR_BUFFER_SIZE 1024

 -char *gai_strerrorA (int);
 +WINAPI char *gai_strerrorA (int);
  WCHAR *gai_strerrorW(int);

  #define NI_MAXHOST 1025
 --
 1.8.3.2

Patch is not ok. As discussed already on IRC, please add here instead
additional guards for WINSTORECOMPAT define.

Kai

--
DreamFactory - Open Source REST  JSON Services for HTML5  Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471iu=/4140/ostg.clktrk
___
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 2/5] More Windows Store forbidden APIs

2013-11-16 Thread Rafaël Carré
Le 16/11/2013 22:37, Kai Tietz a écrit :
 Patch is ok.
 
 Thanks,
 Kai

Applied as r6372, thanks

--
DreamFactory - Open Source REST  JSON Services for HTML5  Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471iu=/4140/ostg.clktrk
___
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 1/5] gai_strerrorA: reimplement without FormatMessageA (forbidden in Windows Store)

2013-11-16 Thread Rafaël Carré
Le 16/11/2013 22:40, Kai Tietz a écrit :
 2013/11/16 Rafaël Carré fun...@videolan.org:
 ---
  mingw-w64-crt/libsrc/ws2tcpip/gai_strerrorA.c | 13 -
  1 file changed, 8 insertions(+), 5 deletions(-)

 diff --git a/mingw-w64-crt/libsrc/ws2tcpip/gai_strerrorA.c 
 b/mingw-w64-crt/libsrc/ws2tcpip/gai_strerrorA.c
 index 8f7f679..956f84f 100644
 --- a/mingw-w64-crt/libsrc/ws2tcpip/gai_strerrorA.c
 +++ b/mingw-w64-crt/libsrc/ws2tcpip/gai_strerrorA.c
 @@ -5,13 +5,16 @@
  #define __CRT__NO_INLINE
  #include winsock2.h
  #include ws2tcpip.h
 +#include stdlib.h

 -char *gai_strerrorA(int ecode)
 +WINAPI char *gai_strerrorA(int ecode)
 For what is this WINAPI?  I doubt that it is required.  AFAI read
 documentation is gai_strerrorA not stdcall.

I have no clue ... I will remove it and retest.

  {
 -   DWORD dwMsgLen __attribute__((unused));
 static char buff[GAI_STRERROR_BUFFER_SIZE + 1];
 -   dwMsgLen = 
 FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS|FORMAT_MESSAGE_MAX_WIDTH_MASK,
 - NULL, ecode, 
 MAKELANGID(LANG_NEUTRAL,SUBLANG_DEFAULT), (LPSTR)buff,
 - GAI_STRERROR_BUFFER_SIZE, NULL);
 +wchar_t *u = gai_strerrorW(ecode);
 +if (!u)
 +return NULL;
 Is it actual possible that gai_strerrorW returns NULL?!?
 
 +wcstombs(buff, u, GAI_STRERROR_BUFFER_SIZE + 1);
 +
 return buff;
  }
 --
 1.8.3.2
 
 Rest of the patch is ok.
 
 Regards,
 Kai

Thanks,

--
DreamFactory - Open Source REST  JSON Services for HTML5  Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471iu=/4140/ostg.clktrk
___
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 3/5] Reimplement SHGetFolderPathW using WinRT functions

2013-11-16 Thread Jean-Baptiste Kempf
On 16 Nov, Kai Tietz wrote :
 Looks reasonable for me.  Did this piece of code got tested?

Yes, a long time ago.

More testing is indeed advised before pushing.

With my kindest regards,

-- 
Jean-Baptiste Kempf
http://www.jbkempf.com/ - +33 672 704 734
Sent from my Electronic Device

--
DreamFactory - Open Source REST  JSON Services for HTML5  Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471iu=/4140/ostg.clktrk
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


[Mingw-w64-public] [PATCH 1/2] Keep CreateSemaphore(W) prototype on Windows Store builds, if WINSTORECOMPAT is defined

2013-11-16 Thread Rafaël Carré
---
 mingw-w64-headers/include/winbase.h | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/mingw-w64-headers/include/winbase.h 
b/mingw-w64-headers/include/winbase.h
index 93a0eb6..30acd12 100644
--- a/mingw-w64-headers/include/winbase.h
+++ b/mingw-w64-headers/include/winbase.h
@@ -1487,10 +1487,13 @@ extern C {
 #define SHUTDOWN_NORETRY 0x1
 #endif
 
+#if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP) || 
defined(WINSTORECOMPAT)
+#define CreateSemaphore __MINGW_NAME_AW(CreateSemaphore)
+  WINBASEAPI HANDLE WINAPI CreateSemaphoreW (LPSECURITY_ATTRIBUTES 
lpSemaphoreAttributes, LONG lInitialCount, LONG lMaximumCount, LPCWSTR lpName);
+#endif
 #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
   WINBASEAPI HANDLE WINAPI OpenMutexA (DWORD dwDesiredAccess, WINBOOL 
bInheritHandle, LPCSTR lpName);
   WINBASEAPI HANDLE WINAPI CreateSemaphoreA (LPSECURITY_ATTRIBUTES 
lpSemaphoreAttributes, LONG lInitialCount, LONG lMaximumCount, LPCSTR lpName);
-  WINBASEAPI HANDLE WINAPI CreateSemaphoreW (LPSECURITY_ATTRIBUTES 
lpSemaphoreAttributes, LONG lInitialCount, LONG lMaximumCount, LPCWSTR lpName);
   WINBASEAPI HANDLE WINAPI OpenSemaphoreA (DWORD dwDesiredAccess, WINBOOL 
bInheritHandle, LPCSTR lpName);
   WINBASEAPI HANDLE WINAPI CreateWaitableTimerA (LPSECURITY_ATTRIBUTES 
lpTimerAttributes, WINBOOL bManualReset, LPCSTR lpTimerName);
   WINBASEAPI HANDLE WINAPI CreateWaitableTimerW (LPSECURITY_ATTRIBUTES 
lpTimerAttributes, WINBOOL bManualReset, LPCWSTR lpTimerName);
@@ -1515,7 +1518,6 @@ extern C {
 #define GetLogicalDriveStrings GetLogicalDriveStringsA
 #endif
 
-#define CreateSemaphore __MINGW_NAME_AW(CreateSemaphore)
 #define CreateWaitableTimer __MINGW_NAME_AW(CreateWaitableTimer)
 #define LoadLibrary __MINGW_NAME_AW(LoadLibrary)
 
-- 
1.8.3.2


--
DreamFactory - Open Source REST  JSON Services for HTML5  Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471iu=/4140/ostg.clktrk
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


[Mingw-w64-public] [PATCH] gai_strerrorA: reimplement without FormatMessageA

2013-11-16 Thread Rafaël Carré
(forbidden in Windows Store)
---
 mingw-w64-crt/libsrc/ws2tcpip/gai_strerrorA.c | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/mingw-w64-crt/libsrc/ws2tcpip/gai_strerrorA.c 
b/mingw-w64-crt/libsrc/ws2tcpip/gai_strerrorA.c
index 8f7f679..ebdc06a 100644
--- a/mingw-w64-crt/libsrc/ws2tcpip/gai_strerrorA.c
+++ b/mingw-w64-crt/libsrc/ws2tcpip/gai_strerrorA.c
@@ -8,10 +8,7 @@
 
 char *gai_strerrorA(int ecode)
 {
-   DWORD dwMsgLen __attribute__((unused));
static char buff[GAI_STRERROR_BUFFER_SIZE + 1];
-   dwMsgLen = 
FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS|FORMAT_MESSAGE_MAX_WIDTH_MASK,
- NULL, ecode, 
MAKELANGID(LANG_NEUTRAL,SUBLANG_DEFAULT), (LPSTR)buff,
- GAI_STRERROR_BUFFER_SIZE, NULL);
+   wcstombs(buff, gai_strerrorW(ecode), GAI_STRERROR_BUFFER_SIZE + 1);
return buff;
 }
-- 
1.8.3.2


--
DreamFactory - Open Source REST  JSON Services for HTML5  Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471iu=/4140/ostg.clktrk
___
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 2/2] CoCreateInstance / CoCreateInstanceEx: force inlining on Windows Store

2013-11-16 Thread Kai Tietz
Ok,

thanks,
Kai

2013/11/16 Rafaël Carré fun...@videolan.org:
 Avoid multiple symbol definitions when linking several .o together
 ---
  mingw-w64-headers/include/combaseapi.h | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

 diff --git a/mingw-w64-headers/include/combaseapi.h 
 b/mingw-w64-headers/include/combaseapi.h
 index b79c4db..3536e25 100644
 --- a/mingw-w64-headers/include/combaseapi.h
 +++ b/mingw-w64-headers/include/combaseapi.h
 @@ -258,7 +258,7 @@ WINOLEAPI CoCreateInstanceEx (REFCLSID Clsid, IUnknown 
 *punkOuter, DWORD dwClsCt
  #endif

  #if WINAPI_FAMILY == WINAPI_FAMILY_APP
 -  __inline HRESULT CoCreateInstance (REFCLSID rclsid, LPUNKNOWN pUnkOuter, 
 DWORD dwClsContext, REFIID riid, LPVOID *ppv) {
 +  __forceinline HRESULT CoCreateInstance (REFCLSID rclsid, LPUNKNOWN 
 pUnkOuter, DWORD dwClsContext, REFIID riid, LPVOID *ppv) {
  MULTI_QI OneQI;
  HRESULT hr;

 @@ -273,7 +273,7 @@ WINOLEAPI CoCreateInstanceEx (REFCLSID Clsid, IUnknown 
 *punkOuter, DWORD dwClsCt
  return FAILED (hr) ? hr : OneQI.hr;
}

 -  __inline HRESULT CoCreateInstanceEx (REFCLSID Clsid, IUnknown *punkOuter, 
 DWORD dwClsCtx, COSERVERINFO *pServerInfo, DWORD dwCount, MULTI_QI *pResults) 
 {
 +  __forceinline HRESULT CoCreateInstanceEx (REFCLSID Clsid, IUnknown 
 *punkOuter, DWORD dwClsCtx, COSERVERINFO *pServerInfo, DWORD dwCount, 
 MULTI_QI *pResults) {
  return CoCreateInstanceFromApp (Clsid, punkOuter, dwClsCtx, pServerInfo, 
 dwCount, pResults);
}
  #endif
 --
 1.8.3.2


 --
 DreamFactory - Open Source REST  JSON Services for HTML5  Native Apps
 OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
 Free app hosting. Or install the open source package on any LAMP server.
 Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
 http://pubads.g.doubleclick.net/gampad/clk?id=63469471iu=/4140/ostg.clktrk
 ___
 Mingw-w64-public mailing list
 Mingw-w64-public@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

--
DreamFactory - Open Source REST  JSON Services for HTML5  Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471iu=/4140/ostg.clktrk
___
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] gai_strerrorA: reimplement without FormatMessageA

2013-11-16 Thread Kai Tietz
Patch is fine.

Please apply.
Kai

2013/11/16 Rafaël Carré fun...@videolan.org:
 (forbidden in Windows Store)
 ---
  mingw-w64-crt/libsrc/ws2tcpip/gai_strerrorA.c | 5 +
  1 file changed, 1 insertion(+), 4 deletions(-)

 diff --git a/mingw-w64-crt/libsrc/ws2tcpip/gai_strerrorA.c 
 b/mingw-w64-crt/libsrc/ws2tcpip/gai_strerrorA.c
 index 8f7f679..ebdc06a 100644
 --- a/mingw-w64-crt/libsrc/ws2tcpip/gai_strerrorA.c
 +++ b/mingw-w64-crt/libsrc/ws2tcpip/gai_strerrorA.c
 @@ -8,10 +8,7 @@

  char *gai_strerrorA(int ecode)
  {
 -   DWORD dwMsgLen __attribute__((unused));
 static char buff[GAI_STRERROR_BUFFER_SIZE + 1];
 -   dwMsgLen = 
 FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS|FORMAT_MESSAGE_MAX_WIDTH_MASK,
 - NULL, ecode, 
 MAKELANGID(LANG_NEUTRAL,SUBLANG_DEFAULT), (LPSTR)buff,
 - GAI_STRERROR_BUFFER_SIZE, NULL);
 +   wcstombs(buff, gai_strerrorW(ecode), GAI_STRERROR_BUFFER_SIZE + 1);
 return buff;
  }
 --
 1.8.3.2


 --
 DreamFactory - Open Source REST  JSON Services for HTML5  Native Apps
 OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
 Free app hosting. Or install the open source package on any LAMP server.
 Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
 http://pubads.g.doubleclick.net/gampad/clk?id=63469471iu=/4140/ostg.clktrk
 ___
 Mingw-w64-public mailing list
 Mingw-w64-public@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

--
DreamFactory - Open Source REST  JSON Services for HTML5  Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471iu=/4140/ostg.clktrk
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public