Fix a load of assumptions about default calling convention, a lot more remain.

svn path=/trunk/; revision=69242
This commit is contained in:
Stefan Ginsberg 2015-09-15 13:15:28 +00:00
parent b987b1571e
commit 6b5b096ee2
19 changed files with 39 additions and 29 deletions

View file

@ -1243,6 +1243,7 @@ CallPerInstanceInitFunctions (
}
VOID
__cdecl
wmainCRTStartup (
VOID
)

View file

@ -445,6 +445,7 @@ SmpUnhandledExceptionFilter(IN PEXCEPTION_POINTERS ExceptionInfo)
}
NTSTATUS
__cdecl
_main(IN INT argc,
IN PCHAR argv[],
IN PCHAR envp[],

View file

@ -37,7 +37,7 @@ LRESULT CALLBACK ConnectionDialogProc(HWND, UINT, WPARAM, LPARAM);
LRESULT CALLBACK CaptureDialogProc(HWND, UINT, WPARAM, LPARAM);
VOID EnableFileMenuItemByID(UINT Id, BOOL Enable);
VOID CheckLocalEchoMenuItem(BOOL Checked);
VOID Rs232Thread(VOID* Parameter);
VOID __cdecl Rs232Thread(VOID* Parameter);
int APIENTRY _tWinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
@ -437,7 +437,7 @@ VOID CheckLocalEchoMenuItem(BOOL Checked)
CheckMenuItem(hFileMenu, IDM_FILE_LOCALECHO, MF_BYCOMMAND|(Checked ? MF_CHECKED : MF_UNCHECKED));
}
VOID Rs232Thread(VOID* Parameter)
VOID __cdecl Rs232Thread(VOID* Parameter)
{
BYTE Byte;
TCHAR String[MAX_PATH];

View file

@ -672,6 +672,7 @@ extern "C" {
_CRTIMP
wchar_t*
__cdecl
wcsncat(
wchar_t *_Dest,
const wchar_t *_Source,

View file

@ -388,10 +388,10 @@ extern "C" {
#ifdef _USE_32BIT_TIME_T
/* Do it like this to be compatible to msvcrt.dll on 32 bit windows XP and before */
__CRT_INLINE wchar_t *__cdecl _wctime32(const time_t *_Time) { return _wctime(_Time); }
__CRT_INLINE errno_t _wctime32_s(wchar_t *_Buffer, size_t _SizeInWords,const __time32_t *_Time) { return _wctime32_s(_Buffer, _SizeInWords, _Time); }
__CRT_INLINE errno_t __cdecl _wctime32_s(wchar_t *_Buffer, size_t _SizeInWords,const __time32_t *_Time) { return _wctime32_s(_Buffer, _SizeInWords, _Time); }
#else
__CRT_INLINE wchar_t *__cdecl _wctime(const time_t *_Time) { return _wctime64(_Time); }
__CRT_INLINE errno_t _wctime_s(wchar_t *_Buffer, size_t _SizeInWords,const time_t *_Time) { return _wctime64_s(_Buffer, _SizeInWords, _Time); }
__CRT_INLINE errno_t __cdecl _wctime_s(wchar_t *_Buffer, size_t _SizeInWords,const time_t *_Time) { return _wctime64_s(_Buffer, _SizeInWords, _Time); }
#endif
#endif

View file

@ -2450,7 +2450,7 @@ EngSetPrinterData(
_In_ DWORD cjPrinterData);
#endif /* !USERMODE_DRIVER */
typedef int (CDECL *SORTCOMP)(const void *pv1, const void *pv2);
typedef int (__cdecl /*CDECL*/ *SORTCOMP)(const void *pv1, const void *pv2);
ENGAPI
VOID

View file

@ -387,9 +387,9 @@ FT_BEGIN_HEADER
#ifndef FT_EXPORT
#ifdef __cplusplus
#define FT_EXPORT( x ) extern "C" x
#define FT_EXPORT( x ) extern "C" x __cdecl
#else
#define FT_EXPORT( x ) extern x
#define FT_EXPORT( x ) extern x __cdecl
#endif
#endif /* !FT_EXPORT */
@ -398,9 +398,9 @@ FT_BEGIN_HEADER
#ifndef FT_EXPORT_DEF
#ifdef __cplusplus
#define FT_EXPORT_DEF( x ) extern "C" x
#define FT_EXPORT_DEF( x ) extern "C" x __cdecl
#else
#define FT_EXPORT_DEF( x ) extern x
#define FT_EXPORT_DEF( x ) extern x __cdecl
#endif
#endif /* !FT_EXPORT_DEF */

View file

@ -21,7 +21,7 @@ extern "C" {
#ifdef __REACTOS__
#include "malloc.h"
struct _exception;
__declspec(dllimport) void __setusermatherr(int (__cdecl *)(struct _exception *));
__declspec(dllimport) void __cdecl __setusermatherr(int (__cdecl *)(struct _exception *));
#define __mingw_fprintf fprintf
#define __mingw_vfprintf vfprintf
#endif

View file

@ -24,7 +24,7 @@
_PVFV *__onexitbegin;
_PVFV *__onexitend;
extern _CRTIMP _onexit_t __dllonexit (_onexit_t, _PVFV**, _PVFV**);
extern _CRTIMP _onexit_t __cdecl __dllonexit (_onexit_t, _PVFV**, _PVFV**);
extern _onexit_t (__cdecl * __MINGW_IMP_SYMBOL(_onexit)) (_onexit_t func);
/* Choose a different name to prevent name conflicts. The CRT one works fine. */

View file

@ -7,13 +7,13 @@
#include <sect_attribs.h>
#include <internal.h>
__declspec(dllimport) int __lconv_init (void);
__declspec(dllimport) int __cdecl __lconv_init (void);
int mingw_initcharmax = 0;
int _charmax = 255;
static int my_lconv_init(void)
static int __cdecl my_lconv_init(void)
{
return __lconv_init();
}

View file

@ -14,10 +14,10 @@ extern HINSTANCE __mingw_winmain_hInstance;
extern LPWSTR __mingw_winmain_lpCmdLine;
extern DWORD __mingw_winmain_nShowCmd;
int wmain (int, wchar_t **, wchar_t **);
int __cdecl wmain (int, wchar_t **, wchar_t **);
/*ARGSUSED*/
int wmain (int __UNUSED_PARAM(flags),
int __cdecl wmain (int __UNUSED_PARAM(flags),
wchar_t ** __UNUSED_PARAM(cmdline),
wchar_t ** __UNUSED_PARAM(inst))
{

View file

@ -40,7 +40,7 @@ PIMAGE_SECTION_HEADER _FindPESectionExec (size_t);
PBYTE _GetPEImageBase (void);
int __mingw_init_ehandler (void);
extern void _fpreset (void);
extern void __cdecl _fpreset (void);
#if defined(_WIN64) && !defined(_MSC_VER)
EXCEPTION_DISPOSITION __mingw_SEH_error_handler(struct _EXCEPTION_RECORD *, void *, struct _CONTEXT *, void *);
@ -90,7 +90,7 @@ __mingw_init_ehandler (void)
return 1;
}
extern void _fpreset (void);
extern void __cdecl _fpreset (void);
EXCEPTION_DISPOSITION
__mingw_SEH_error_handler (struct _EXCEPTION_RECORD* ExceptionRecord,

View file

@ -54,11 +54,12 @@ extern WINBOOL WINAPI DllMain (HANDLE hDllHandle, DWORD dwReason, LPVOID lpreser
extern WINBOOL WINAPI DllEntryPoint (HANDLE, DWORD, LPVOID);
static int pre_c_init (void);
static int __cdecl pre_c_init (void);
_CRTALLOC(".CRT$XIAA") _PIFV pcinit = pre_c_init;
static int
__cdecl
pre_c_init (void)
{
_PVFV *onexitbegin;

View file

@ -39,7 +39,7 @@ extern char *** __MINGW_IMP_SYMBOL(__initenv);
/* This symbol is defined by ld. */
extern IMAGE_DOS_HEADER __ImageBase;
extern void _fpreset (void);
extern void __cdecl _fpreset (void);
#define SPACECHAR _T(' ')
#define DQUOTECHAR _T('\"')
@ -147,11 +147,11 @@ pre_cpp_init (void)
#endif
}
static int __tmainCRTStartup (void);
static int __cdecl __tmainCRTStartup (void);
int WinMainCRTStartup (void);
int __cdecl WinMainCRTStartup (void);
int WinMainCRTStartup (void)
int __cdecl WinMainCRTStartup (void)
{
int ret = 255;
#ifdef __SEH__
@ -173,13 +173,13 @@ int WinMainCRTStartup (void)
return ret;
}
int mainCRTStartup (void);
int __cdecl mainCRTStartup (void);
#ifdef _WIN64
int __mingw_init_ehandler (void);
#endif
int mainCRTStartup (void)
int __cdecl mainCRTStartup (void)
{
int ret = 255;
#ifdef __SEH__
@ -202,7 +202,8 @@ int mainCRTStartup (void)
}
static
__declspec(noinline) int
__declspec(noinline)
int __cdecl
__tmainCRTStartup (void)
{
_TCHAR *lpszCommandLine = NULL;
@ -410,7 +411,7 @@ static void duplicate_ppstrings (int ac, char ***av)
#else
#define __UNUSED_PARAM_1 __UNUSED_PARAM
#endif
static void
static void __cdecl
__mingw_invalidParameterHandler (const wchar_t * __UNUSED_PARAM_1(expression),
const wchar_t * __UNUSED_PARAM_1(function),
const wchar_t * __UNUSED_PARAM_1(file),

View file

@ -6,7 +6,7 @@
#pragma function(_tcslen)
#endif /* _MSC_VER */
size_t _tcslen(const _TCHAR * str)
size_t __cdecl _tcslen(const _TCHAR * str)
{
const _TCHAR * s;

View file

@ -2,7 +2,7 @@
#include <stddef.h>
#include <tchar.h>
size_t _tcsnlen(const _TCHAR * str, size_t count)
size_t __cdecl _tcsnlen(const _TCHAR * str, size_t count)
{
const _TCHAR * s;

View file

@ -511,6 +511,7 @@ SetWorldTransformForMetafile(
}
void
__cdecl
_assert (
const char *exp,
const char *file,

View file

@ -641,7 +641,7 @@ QueryEnvironmentVariable(PUNICODE_STRING Name,
return(STATUS_VARIABLE_NOT_FOUND);
}
static int
static int __cdecl
DbgCompareChannels(const void * a, const void * b)
{
return wcscmp((WCHAR*)a, ((DBG_CHANNEL*)b)->Name);

View file

@ -43,6 +43,10 @@ typedef struct _SECURITY_ATTRIBUTES SECURITY_ATTRIBUTES, *LPSECURITY_ATTRIBUTES;
#include <math.h>
#include <intrin.h>
// Needed because windef.h messes up CDECL for whatever
#undef CDECL
#define CDECL __cdecl
/* Avoid type casting, by defining RECT to RECTL */
#define RECT RECTL
#define PRECT PRECTL