From d102bcad5ade1e4b090507e7132d5728ba00347c Mon Sep 17 00:00:00 2001 From: mlankhorst Date: Thu, 3 Jul 2008 00:08:22 -0700 Subject: [PATCH] msvcrt: Add CDECL to all cdecl functions --- dlls/msvcrt/data.c | 2 +- dlls/msvcrt/exit.c | 2 +- dlls/msvcrt/msvcrt.h | 160 +++++++++++++++++++++--------------------- dlls/msvcrt/tests/headers.c | 1 + 4 files changed, 83 insertions(+), 82 deletions(-) diff --git a/dlls/msvcrt/data.c b/dlls/msvcrt/data.c index fd80210..886257f 100644 --- a/dlls/msvcrt/data.c +++ b/dlls/msvcrt/data.c @@ -130,7 +130,7 @@ MSVCRT_wchar_t ** msvcrt_SnapshotOfEnvironmentW(MSVCRT_wchar_t **wblk) return wblk; } -typedef void (*_INITTERMFUN)(void); +typedef void (CDECL *_INITTERMFUN)(void); /*********************************************************************** * __p___argc (MSVCRT.@) diff --git a/dlls/msvcrt/exit.c b/dlls/msvcrt/exit.c index 990b753..27bb0d3 100644 --- a/dlls/msvcrt/exit.c +++ b/dlls/msvcrt/exit.c @@ -38,7 +38,7 @@ static const char szMsgBoxTitle[] = "Wine C++ Runtime Library"; extern int MSVCRT_app_type; extern char *MSVCRT__pgmptr; -void (*_aexit_rtn)(int) = MSVCRT__exit; +void (*CDECL _aexit_rtn)(int) = MSVCRT__exit; /* INTERNAL: call atexit functions */ static void __MSVCRT__call_atexit(void) diff --git a/dlls/msvcrt/msvcrt.h b/dlls/msvcrt/msvcrt.h index 73862dc..42e5141 100644 --- a/dlls/msvcrt/msvcrt.h +++ b/dlls/msvcrt/msvcrt.h @@ -62,14 +62,14 @@ typedef long MSVCRT_time_t; typedef __int64 MSVCRT___time64_t; typedef __int64 MSVCRT_fpos_t; -typedef void (*MSVCRT_terminate_handler)(void); -typedef void (*MSVCRT_terminate_function)(void); -typedef void (*MSVCRT_unexpected_handler)(void); -typedef void (*MSVCRT_unexpected_function)(void); -typedef void (*MSVCRT__se_translator_function)(unsigned int code, struct _EXCEPTION_POINTERS *info); -typedef void (*MSVCRT__beginthread_start_routine_t)(void *); +typedef void (*CDECL MSVCRT_terminate_handler)(void); +typedef void (*CDECL MSVCRT_terminate_function)(void); +typedef void (*CDECL MSVCRT_unexpected_handler)(void); +typedef void (*CDECL MSVCRT_unexpected_function)(void); +typedef void (*CDECL MSVCRT__se_translator_function)(unsigned int code, struct _EXCEPTION_POINTERS *info); +typedef void (*CDECL MSVCRT__beginthread_start_routine_t)(void *); typedef unsigned int (__stdcall *MSVCRT__beginthreadex_start_routine_t)(void *); -typedef int (*MSVCRT__onexit_t)(void); +typedef int (*CDECL MSVCRT__onexit_t)(void); typedef struct {long double x;} MSVCRT__LDOUBLE; @@ -116,8 +116,8 @@ extern int MSVCRT___lc_codepage; void msvcrt_set_errno(int); -void _purecall(void); -void _amsg_exit(int errnum); +void CDECL _purecall(void); +void CDECL _amsg_exit(int errnum); extern char **MSVCRT__environ; extern MSVCRT_wchar_t **_wenviron; @@ -130,16 +130,16 @@ MSVCRT_wchar_t *msvcrt_wstrdupa(const char *); /* FIXME: This should be declared in new.h but it's not an extern "C" so * it would not be much use anyway. Even for Winelib applications. */ -int MSVCRT__set_new_mode(int mode); +int CDECL MSVCRT__set_new_mode(int mode); -void* MSVCRT_operator_new(unsigned long size); -void MSVCRT_operator_delete(void*); +void* CDECL MSVCRT_operator_new(unsigned long size); +void CDECL MSVCRT_operator_delete(void*); -typedef void* (*malloc_func_t)(MSVCRT_size_t); -typedef void (*free_func_t)(void*); +typedef void* (*CDECL malloc_func_t)(MSVCRT_size_t); +typedef void (*CDECL free_func_t)(void*); -extern char* __unDName(char *,const char*,int,malloc_func_t,free_func_t,unsigned short int); -extern char* __unDNameEx(char *,const char*,int,malloc_func_t,free_func_t,void *,unsigned short int); +extern char* CDECL __unDName(char *,const char*,int,malloc_func_t,free_func_t,unsigned short int); +extern char* CDECL __unDNameEx(char *,const char*,int,malloc_func_t,free_func_t,void *,unsigned short int); /* Setup and teardown multi threaded locks */ extern void msvcrt_init_mt_locks(void); @@ -598,72 +598,72 @@ typedef void (*MSVCRT___sighandler_t)(int); #define MSVCRT_SIG_IGN ((MSVCRT___sighandler_t)1) #define MSVCRT_SIG_ERR ((MSVCRT___sighandler_t)-1) -void MSVCRT_free(void*); -void* MSVCRT_malloc(MSVCRT_size_t); -void* MSVCRT_calloc(MSVCRT_size_t,MSVCRT_size_t); -void* MSVCRT_realloc(void*,MSVCRT_size_t); - -int MSVCRT_iswalpha(MSVCRT_wint_t); -int MSVCRT_iswspace(MSVCRT_wint_t); -int MSVCRT_iswdigit(MSVCRT_wint_t); -int MSVCRT_isleadbyte(int); - -int MSVCRT_fgetc(MSVCRT_FILE*); -int MSVCRT_ungetc(int,MSVCRT_FILE*); -MSVCRT_wint_t MSVCRT_fgetwc(MSVCRT_FILE*); -MSVCRT_wint_t MSVCRT_ungetwc(MSVCRT_wint_t,MSVCRT_FILE*); -void MSVCRT__exit(int); -void MSVCRT_abort(void); -unsigned long* MSVCRT___doserrno(void); -int* MSVCRT__errno(void); -char* MSVCRT_getenv(const char*); -char* MSVCRT_setlocale(int,const char*); -int MSVCRT_fclose(MSVCRT_FILE*); -void MSVCRT_terminate(void); -MSVCRT_FILE* MSVCRT__p__iob(void); -MSVCRT_time_t MSVCRT_mktime(struct MSVCRT_tm *t); -struct MSVCRT_tm* MSVCRT_localtime(const MSVCRT_time_t* secs); -struct MSVCRT_tm* MSVCRT_gmtime(const MSVCRT_time_t* secs); -MSVCRT_clock_t MSVCRT_clock(void); -double MSVCRT_difftime(MSVCRT_time_t time1, MSVCRT_time_t time2); -MSVCRT_time_t MSVCRT_time(MSVCRT_time_t*); -MSVCRT_FILE* MSVCRT__fdopen(int, const char *); -MSVCRT_FILE* MSVCRT__wfdopen(int, const MSVCRT_wchar_t *); -int MSVCRT_vsnprintf(char *str, unsigned int len, const char *format, va_list valist); -int MSVCRT_vsnwprintf(MSVCRT_wchar_t *str, unsigned int len, - const MSVCRT_wchar_t *format, va_list valist ); -int MSVCRT_raise(int sig); +void CDECL MSVCRT_free(void*); +void* CDECL MSVCRT_malloc(MSVCRT_size_t); +void* CDECL MSVCRT_calloc(MSVCRT_size_t,MSVCRT_size_t); +void* CDECL MSVCRT_realloc(void*,MSVCRT_size_t); + +int CDECL MSVCRT_iswalpha(MSVCRT_wint_t); +int CDECL MSVCRT_iswspace(MSVCRT_wint_t); +int CDECL MSVCRT_iswdigit(MSVCRT_wint_t); +int CDECL MSVCRT_isleadbyte(int); + +int CDECL MSVCRT_fgetc(MSVCRT_FILE*); +int CDECL MSVCRT_ungetc(int,MSVCRT_FILE*); +MSVCRT_wint_t CDECL MSVCRT_fgetwc(MSVCRT_FILE*); +MSVCRT_wint_t CDECL MSVCRT_ungetwc(MSVCRT_wint_t,MSVCRT_FILE*); +void CDECL MSVCRT__exit(int); +void CDECL MSVCRT_abort(void); +unsigned long* CDECL MSVCRT___doserrno(void); +int* CDECL MSVCRT__errno(void); +char* CDECL MSVCRT_getenv(const char*); +char* CDECL MSVCRT_setlocale(int,const char*); +int CDECL MSVCRT_fclose(MSVCRT_FILE*); +void CDECL MSVCRT_terminate(void); +MSVCRT_FILE* CDECL MSVCRT__p__iob(void); +MSVCRT_time_t CDECL MSVCRT_mktime(struct MSVCRT_tm *t); +struct MSVCRT_tm* CDECL MSVCRT_localtime(const MSVCRT_time_t* secs); +struct MSVCRT_tm* CDECL MSVCRT_gmtime(const MSVCRT_time_t* secs); +MSVCRT_clock_t CDECL MSVCRT_clock(void); +double CDECL MSVCRT_difftime(MSVCRT_time_t time1, MSVCRT_time_t time2); +MSVCRT_time_t CDECL MSVCRT_time(MSVCRT_time_t*); +MSVCRT_FILE* CDECL MSVCRT__fdopen(int, const char *); +MSVCRT_FILE* CDECL MSVCRT__wfdopen(int, const MSVCRT_wchar_t *); +int CDECL MSVCRT_vsnprintf(char *str, unsigned int len, const char *format, va_list valist); +int CDECL MSVCRT_vsnwprintf(MSVCRT_wchar_t *str, unsigned int len, + const MSVCRT_wchar_t *format, va_list valist ); +int CDECL MSVCRT_raise(int sig); #ifndef __WINE_MSVCRT_TEST -int MSVCRT__write(int,const void*,unsigned int); -int _getch(void); -int _ismbstrail(const unsigned char* start, const unsigned char* str); -MSVCRT_intptr_t _spawnve(int,const char*,const char* const *,const char* const *); -MSVCRT_intptr_t _spawnvpe(int,const char*,const char* const *,const char* const *); -MSVCRT_intptr_t _wspawnve(int,const MSVCRT_wchar_t*,const MSVCRT_wchar_t* const *,const MSVCRT_wchar_t* const *); -MSVCRT_intptr_t _wspawnvpe(int,const MSVCRT_wchar_t*,const MSVCRT_wchar_t* const *,const MSVCRT_wchar_t* const *); -void _searchenv(const char*,const char*,char*); -int _getdrive(void); -char* _strdup(const char*); -char* _strnset(char*,int,MSVCRT_size_t); -char* _strset(char*,int); -int _ungetch(int); -int _cputs(const char*); -int _cprintf(const char*,...); -char*** __p__environ(void); -int* __p___mb_cur_max(void); -unsigned int* __p__fmode(void); -MSVCRT_wchar_t* _wcsdup(const MSVCRT_wchar_t*); -MSVCRT_wchar_t*** __p__wenviron(void); -char* _strdate(char* date); -char* _strtime(char* date); -void _ftime(struct MSVCRT__timeb *buf); -int MSVCRT__close(int); -int MSVCRT__dup(int); -int MSVCRT__dup2(int, int); -int MSVCRT__pipe(int *, unsigned int, int); -MSVCRT_wchar_t* _wgetenv(const MSVCRT_wchar_t*); -void _wsearchenv(const MSVCRT_wchar_t*, const MSVCRT_wchar_t*, MSVCRT_wchar_t*); +int CDECL MSVCRT__write(int,const void*,unsigned int); +int CDECL _getch(void); +int CDECL _ismbstrail(const unsigned char* start, const unsigned char* str); +MSVCRT_intptr_t CDECL _spawnve(int,const char*,const char* const *,const char* const *); +MSVCRT_intptr_t CDECL _spawnvpe(int,const char*,const char* const *,const char* const *); +MSVCRT_intptr_t CDECL _wspawnve(int,const MSVCRT_wchar_t*,const MSVCRT_wchar_t* const *,const MSVCRT_wchar_t* const *); +MSVCRT_intptr_t CDECL _wspawnvpe(int,const MSVCRT_wchar_t*,const MSVCRT_wchar_t* const *,const MSVCRT_wchar_t* const *); +void CDECL _searchenv(const char*,const char*,char*); +int CDECL _getdrive(void); +char* CDECL _strdup(const char*); +char* CDECL _strnset(char*,int,MSVCRT_size_t); +char* CDECL _strset(char*,int); +int CDECL _ungetch(int); +int CDECL _cputs(const char*); +int CDECL _cprintf(const char*,...); +char*** CDECL __p__environ(void); +int* CDECL __p___mb_cur_max(void); +unsigned int* CDECL __p__fmode(void); +MSVCRT_wchar_t* CDECL _wcsdup(const MSVCRT_wchar_t*); +MSVCRT_wchar_t*** CDECL __p__wenviron(void); +char* CDECL _strdate(char* date); +char* CDECL _strtime(char* date); +void CDECL _ftime(struct MSVCRT__timeb *buf); +int CDECL MSVCRT__close(int); +int CDECL MSVCRT__dup(int); +int CDECL MSVCRT__dup2(int, int); +int CDECL MSVCRT__pipe(int *, unsigned int, int); +MSVCRT_wchar_t* CDECL _wgetenv(const MSVCRT_wchar_t*); +void CDECL _wsearchenv(const MSVCRT_wchar_t*, const MSVCRT_wchar_t*, MSVCRT_wchar_t*); #endif #endif /* __WINE_MSVCRT_H */ diff --git a/dlls/msvcrt/tests/headers.c b/dlls/msvcrt/tests/headers.c index d7c7cd7..3bd32cc 100644 --- a/dlls/msvcrt/tests/headers.c +++ b/dlls/msvcrt/tests/headers.c @@ -20,6 +20,7 @@ * symbols defined in msvcrt.h (prefixed by MSVCRT_). */ +#include "windef.h" #include "dos.h" #include "math.h" #include "stdlib.h" -- 1.5.6.5