diff --git a/dll/crt.cpp b/dll/crt.cpp index 9715876..06b24bc 100644 --- a/dll/crt.cpp +++ b/dll/crt.cpp @@ -302,14 +302,14 @@ void *CDECL __acrt_iob_func(unsigned int index) { return nullptr; } -int CDECL __stdio_common_vfprintf(unsigned long long options, FILE *stream, const char *format, void *locale, +int CDECL_NO_CONV __stdio_common_vfprintf(unsigned long long options, FILE *stream, const char *format, void *locale, va_list args) { HOST_CONTEXT_GUARD(); DEBUG_LOG("__stdio_common_vfprintf(%llu, %p, %s, %p, %p)\n", options, stream, format, locale, args); return vfprintf(stream, format, args); } -int CDECL __stdio_common_vsprintf(unsigned long long options, char *buffer, SIZE_T len, const char *format, +int CDECL_NO_CONV __stdio_common_vsprintf(unsigned long long options, char *buffer, SIZE_T len, const char *format, void *locale, va_list args) { HOST_CONTEXT_GUARD(); DEBUG_LOG("__stdio_common_vsprintf(%llu, %p, %zu, %s, %p, ...)\n", options, buffer, len, format, locale); diff --git a/dll/crt.h b/dll/crt.h index 9fa41c6..bee3543 100644 --- a/dll/crt.h +++ b/dll/crt.h @@ -66,9 +66,9 @@ void CDECL _exit(int status); void CDECL abort(); signal_handler CDECL signal(int signum, signal_handler handler); void *CDECL __acrt_iob_func(unsigned int index); -int CDECL __stdio_common_vfprintf(unsigned long long options, FILE *stream, const char *format, void *locale, +int CDECL_NO_CONV __stdio_common_vfprintf(unsigned long long options, FILE *stream, const char *format, void *locale, va_list args); -int CDECL __stdio_common_vsprintf(unsigned long long options, char *buffer, SIZE_T len, const char *format, +int CDECL_NO_CONV __stdio_common_vsprintf(unsigned long long options, char *buffer, SIZE_T len, const char *format, void *locale, va_list args); void CDECL qsort(void *base, SIZE_T num, SIZE_T size, sort_compare compare); int CDECL puts(const char *str); diff --git a/dll/msvcrt.cpp b/dll/msvcrt.cpp index 040a989..9736fe4 100644 --- a/dll/msvcrt.cpp +++ b/dll/msvcrt.cpp @@ -1071,7 +1071,7 @@ namespace msvcrt { return 0; } - int CDECL _vsnprintf(char *buffer, SIZE_T count, const char *format, va_list args) { + int CDECL_NO_CONV _vsnprintf(char *buffer, SIZE_T count, const char *format, va_list args) { HOST_CONTEXT_GUARD(); DEBUG_LOG("_vsnprintf(%p, %zu, %s, %p)\n", buffer, count, format, args); if (!buffer || !format) { @@ -1818,7 +1818,7 @@ namespace msvcrt { return std::fflush(host); } - int CDECL vfwprintf(FILE *stream, const uint16_t *format, va_list args) { + int CDECL_NO_CONV vfwprintf(FILE *stream, const uint16_t *format, va_list args) { HOST_CONTEXT_GUARD(); DEBUG_LOG("vfwprintf(%p, %s, ...)\n", stream, wideStringToString(format).c_str()); FILE *host = mapToHostFile(stream ? stream : stdout); @@ -2217,7 +2217,7 @@ namespace msvcrt { return mapToHostFile(stream); } - int CDECL vfprintf(FILE *stream, const char *format, va_list args) { + int CDECL_NO_CONV vfprintf(FILE *stream, const char *format, va_list args) { HOST_CONTEXT_GUARD(); DEBUG_LOG("vfprintf(stream=%p, format=%s, args=%p)\n", stream, format, args); if (!format || !stream) { diff --git a/dll/msvcrt.h b/dll/msvcrt.h index 28a2f75..232b8f8 100644 --- a/dll/msvcrt.h +++ b/dll/msvcrt.h @@ -88,7 +88,7 @@ int CDECL _ismbcdigit(unsigned int ch); int CDECL _stricmp(const char *lhs, const char *rhs); int CDECL _strnicmp(const char *lhs, const char *rhs, SIZE_T count); int CDECL _memicmp(const void *lhs, const void *rhs, SIZE_T count); -int CDECL _vsnprintf(char *buffer, SIZE_T count, const char *format, va_list args); +int CDECL_NO_CONV _vsnprintf(char *buffer, SIZE_T count, const char *format, va_list args); int CDECL_NO_CONV _snprintf(char *buffer, SIZE_T count, const char *format, ...); int CDECL_NO_CONV sprintf(char *buffer, const char *format, ...); int CDECL_NO_CONV printf(const char *format, ...); @@ -147,7 +147,7 @@ void *CDECL memmove(void *dest, const void *src, SIZE_T count); int CDECL memcmp(const void *lhs, const void *rhs, SIZE_T count); void CDECL qsort(void *base, SIZE_T num, SIZE_T size, int (*compar)(const void *, const void *)); int CDECL fflush(FILE *stream); -int CDECL vfwprintf(FILE *stream, const uint16_t *format, va_list args); +int CDECL_NO_CONV vfwprintf(FILE *stream, const uint16_t *format, va_list args); FILE *CDECL fopen(const char *filename, const char *mode); int CDECL _dup2(int fd1, int fd2); int CDECL _isatty(int fd); @@ -176,7 +176,7 @@ int CDECL _crt_debugger_hook(int value); int CDECL _configthreadlocale(int mode); void CDECL __setusermatherr(void *handler); void CDECL _cexit(); -int CDECL vfprintf(FILE *stream, const char *format, va_list args); +int CDECL_NO_CONV vfprintf(FILE *stream, const char *format, va_list args); int CDECL_NO_CONV fprintf(FILE *stream, const char *format, ...); int CDECL fputc(int ch, FILE *stream); SIZE_T CDECL fwrite(const void *buffer, SIZE_T size, SIZE_T count, FILE *stream); diff --git a/tools/gen_trampolines.py b/tools/gen_trampolines.py index 676e5c4..bf14b54 100644 --- a/tools/gen_trampolines.py +++ b/tools/gen_trampolines.py @@ -535,7 +535,6 @@ def emit_host_to_guest_thunks( lines.append( f"\t# Arg {i} (slot_size={arg.slot_size}, primitive={arg.primitive}, sign_extended={arg.sign_extended})" ) - lines.append(f".globl {thunk}") lines.append(f".weak {thunk}") lines.append(f".type {thunk}, @function") lines.append(f"{thunk}:")