Rémi Bernon : msvcrt: Make locale and thread helper functions CDECL.

Alexandre Julliard julliard at winehq.org
Tue Nov 10 15:30:25 CST 2020


Module: wine
Branch: master
Commit: a24ad51e3f2515c1970b56f8dfe2206e2b282dc9
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=a24ad51e3f2515c1970b56f8dfe2206e2b282dc9

Author: Rémi Bernon <rbernon at codeweavers.com>
Date:   Tue Nov 10 16:58:37 2020 +0100

msvcrt: Make locale and thread helper functions CDECL.

This prevent callers from having to save SSE registers to the stack.

It is for instance the case in MSVCRT__towlower_l, which is called on
every character by MSVCRT__wcsicmp_l.

Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
Signed-off-by: Piotr Caban <piotr at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/msvcrt/locale.c | 4 ++--
 dlls/msvcrt/msvcrt.h | 6 +++---
 dlls/msvcrt/thread.c | 2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/dlls/msvcrt/locale.c b/dlls/msvcrt/locale.c
index 7562f70eb0b..f25c1228d2f 100644
--- a/dlls/msvcrt/locale.c
+++ b/dlls/msvcrt/locale.c
@@ -452,7 +452,7 @@ static inline void swap_pointers(void **p1, void **p2) {
 }
 
 /* INTERNAL: returns pthreadlocinfo struct */
-MSVCRT_pthreadlocinfo get_locinfo(void) {
+MSVCRT_pthreadlocinfo CDECL get_locinfo(void) {
     thread_data_t *data = msvcrt_get_thread_data();
 
     if(!data || !data->have_locale)
@@ -462,7 +462,7 @@ MSVCRT_pthreadlocinfo get_locinfo(void) {
 }
 
 /* INTERNAL: returns pthreadlocinfo struct */
-MSVCRT_pthreadmbcinfo get_mbcinfo(void) {
+MSVCRT_pthreadmbcinfo CDECL get_mbcinfo(void) {
     thread_data_t *data = msvcrt_get_thread_data();
 
     if(!data || !data->have_locale)
diff --git a/dlls/msvcrt/msvcrt.h b/dlls/msvcrt/msvcrt.h
index 4f79778f7cc..f73117ae5e2 100644
--- a/dlls/msvcrt/msvcrt.h
+++ b/dlls/msvcrt/msvcrt.h
@@ -308,7 +308,7 @@ struct __thread_data {
 
 typedef struct __thread_data thread_data_t;
 
-extern thread_data_t *msvcrt_get_thread_data(void) DECLSPEC_HIDDEN;
+extern thread_data_t *CDECL msvcrt_get_thread_data(void) DECLSPEC_HIDDEN;
 
 LCID MSVCRT_locale_to_LCID(const char*, unsigned short*, BOOL*) DECLSPEC_HIDDEN;
 extern MSVCRT__locale_t MSVCRT_locale DECLSPEC_HIDDEN;
@@ -1128,8 +1128,8 @@ int            __cdecl MSVCRT__set_printf_count_output(int);
 #define MSVCRT__DISABLE_PER_THREAD_LOCALE 2
 
 extern MSVCRT__locale_t MSVCRT_locale;
-MSVCRT_pthreadlocinfo get_locinfo(void) DECLSPEC_HIDDEN;
-MSVCRT_pthreadmbcinfo get_mbcinfo(void) DECLSPEC_HIDDEN;
+MSVCRT_pthreadlocinfo CDECL get_locinfo(void) DECLSPEC_HIDDEN;
+MSVCRT_pthreadmbcinfo CDECL get_mbcinfo(void) DECLSPEC_HIDDEN;
 void __cdecl MSVCRT__free_locale(MSVCRT__locale_t);
 void free_locinfo(MSVCRT_pthreadlocinfo) DECLSPEC_HIDDEN;
 void free_mbcinfo(MSVCRT_pthreadmbcinfo) DECLSPEC_HIDDEN;
diff --git a/dlls/msvcrt/thread.c b/dlls/msvcrt/thread.c
index af31534adbd..11573892e95 100644
--- a/dlls/msvcrt/thread.c
+++ b/dlls/msvcrt/thread.c
@@ -35,7 +35,7 @@ typedef struct {
  *
  * Return the thread local storage structure.
  */
-thread_data_t *msvcrt_get_thread_data(void)
+thread_data_t *CDECL msvcrt_get_thread_data(void)
 {
     thread_data_t *ptr;
     DWORD err = GetLastError();  /* need to preserve last error */




More information about the wine-cvs mailing list