diff mbox

Use CreateSemaphoreW instead of CreateSemaphoreA in libgcc.

Message ID 52384078.2060505@gmail.com
State New
Headers show

Commit Message

Jacek Caban Sept. 17, 2013, 11:43 a.m. UTC
On 09/17/13 13:41, Kai Tietz wrote:
> 2013/9/17 Jacek Caban <cjacek@gmail.com>:
>> This is no-op for usual GCC targets, because we don't pass any string to
>> CreateSemaphore anyway. However this trivial change will help
>> mingw-w64's efforts to support WinRT, where only unicode variant is
>> available.
>>
>> libgcc/Changelog:
>>     config/i386/gthr-win32.c: CreateSemaphoreW instead of CreateSemaphoreA.
>>     config/i386/gthr-win32.h: Likewise.
>>
> Please attach (or inline) patch.

It's attached now, sorry.

Jacek
commit eea3738e6103da1d1bc391b99734c93737d292a4
Author: Jacek Caban <jacek@codeweavers.com>
Date:   Tue May 7 17:22:01 2013 +0200

    Use CreateSemaphoreW instead of CreateSemaphoreA in libgcc.
    
    libgcc/Changelog:
        config/i386/gthr-win32.c: CreateSemaphoreW instead of CreateSemaphoreA.
        config/i386/gthr-win32.h: Likewise.

Comments

Kai Tietz Sept. 17, 2013, 11:49 a.m. UTC | #1
Hi Jacek,

I applied patch at rev. 202648 with following ChangeLog

2013-09-17  Jacek Caban

    * config/i386/gthr-win32.c: CreateSemaphoreW instead of
    CreateSemaphoreA.
    * config/i386/gthr-win32.h: Likewise.

The wide-variant is in general ok due we don't support any windows-OS
anymore, which doesn't support wide API.

Thanks,
Kai
diff mbox

Patch

diff --git a/libgcc/config/i386/gthr-win32.c b/libgcc/config/i386/gthr-win32.c
index f6f661a..f323031 100644
--- a/libgcc/config/i386/gthr-win32.c
+++ b/libgcc/config/i386/gthr-win32.c
@@ -147,7 +147,7 @@  void
 __gthr_win32_mutex_init_function (__gthread_mutex_t *mutex)
 {
   mutex->counter = -1;
-  mutex->sema = CreateSemaphore (NULL, 0, 65535, NULL);
+  mutex->sema = CreateSemaphoreW (NULL, 0, 65535, NULL);
 }
 
 void
@@ -195,7 +195,7 @@  __gthr_win32_recursive_mutex_init_function (__gthread_recursive_mutex_t *mutex)
   mutex->counter = -1;
   mutex->depth = 0;
   mutex->owner = 0;
-  mutex->sema = CreateSemaphore (NULL, 0, 65535, NULL);
+  mutex->sema = CreateSemaphoreW (NULL, 0, 65535, NULL);
 }
 
 int
diff --git a/libgcc/config/i386/gthr-win32.h b/libgcc/config/i386/gthr-win32.h
index d2e729a..1e437fc 100644
--- a/libgcc/config/i386/gthr-win32.h
+++ b/libgcc/config/i386/gthr-win32.h
@@ -635,7 +635,7 @@  static inline void
 __gthread_mutex_init_function (__gthread_mutex_t *__mutex)
 {
   __mutex->counter = -1;
-  __mutex->sema = CreateSemaphore (NULL, 0, 65535, NULL);
+  __mutex->sema = CreateSemaphoreW (NULL, 0, 65535, NULL);
 }
 
 static inline void
@@ -697,7 +697,7 @@  __gthread_recursive_mutex_init_function (__gthread_recursive_mutex_t *__mutex)
   __mutex->counter = -1;
   __mutex->depth = 0;
   __mutex->owner = 0;
-  __mutex->sema = CreateSemaphore (NULL, 0, 65535, NULL);
+  __mutex->sema = CreateSemaphoreW (NULL, 0, 65535, NULL);
 }
 
 static inline int