mirror of
https://github.com/decompals/wibo.git
synced 2025-12-18 01:15:37 +00:00
Use CDECL_NO_CONV for va_list thunks; remove .globl
This commit is contained in:
@@ -302,14 +302,14 @@ void *CDECL __acrt_iob_func(unsigned int index) {
|
|||||||
return nullptr;
|
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) {
|
va_list args) {
|
||||||
HOST_CONTEXT_GUARD();
|
HOST_CONTEXT_GUARD();
|
||||||
DEBUG_LOG("__stdio_common_vfprintf(%llu, %p, %s, %p, %p)\n", options, stream, format, locale, args);
|
DEBUG_LOG("__stdio_common_vfprintf(%llu, %p, %s, %p, %p)\n", options, stream, format, locale, args);
|
||||||
return vfprintf(stream, format, 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) {
|
void *locale, va_list args) {
|
||||||
HOST_CONTEXT_GUARD();
|
HOST_CONTEXT_GUARD();
|
||||||
DEBUG_LOG("__stdio_common_vsprintf(%llu, %p, %zu, %s, %p, ...)\n", options, buffer, len, format, locale);
|
DEBUG_LOG("__stdio_common_vsprintf(%llu, %p, %zu, %s, %p, ...)\n", options, buffer, len, format, locale);
|
||||||
|
|||||||
@@ -66,9 +66,9 @@ void CDECL _exit(int status);
|
|||||||
void CDECL abort();
|
void CDECL abort();
|
||||||
signal_handler CDECL signal(int signum, signal_handler handler);
|
signal_handler CDECL signal(int signum, signal_handler handler);
|
||||||
void *CDECL __acrt_iob_func(unsigned int index);
|
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);
|
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 *locale, va_list args);
|
||||||
void CDECL qsort(void *base, SIZE_T num, SIZE_T size, sort_compare compare);
|
void CDECL qsort(void *base, SIZE_T num, SIZE_T size, sort_compare compare);
|
||||||
int CDECL puts(const char *str);
|
int CDECL puts(const char *str);
|
||||||
|
|||||||
@@ -1071,7 +1071,7 @@ namespace msvcrt {
|
|||||||
return 0;
|
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();
|
HOST_CONTEXT_GUARD();
|
||||||
DEBUG_LOG("_vsnprintf(%p, %zu, %s, %p)\n", buffer, count, format, args);
|
DEBUG_LOG("_vsnprintf(%p, %zu, %s, %p)\n", buffer, count, format, args);
|
||||||
if (!buffer || !format) {
|
if (!buffer || !format) {
|
||||||
@@ -1818,7 +1818,7 @@ namespace msvcrt {
|
|||||||
return std::fflush(host);
|
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();
|
HOST_CONTEXT_GUARD();
|
||||||
DEBUG_LOG("vfwprintf(%p, %s, ...)\n", stream, wideStringToString(format).c_str());
|
DEBUG_LOG("vfwprintf(%p, %s, ...)\n", stream, wideStringToString(format).c_str());
|
||||||
FILE *host = mapToHostFile(stream ? stream : stdout);
|
FILE *host = mapToHostFile(stream ? stream : stdout);
|
||||||
@@ -2217,7 +2217,7 @@ namespace msvcrt {
|
|||||||
return mapToHostFile(stream);
|
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();
|
HOST_CONTEXT_GUARD();
|
||||||
DEBUG_LOG("vfprintf(stream=%p, format=%s, args=%p)\n", stream, format, args);
|
DEBUG_LOG("vfprintf(stream=%p, format=%s, args=%p)\n", stream, format, args);
|
||||||
if (!format || !stream) {
|
if (!format || !stream) {
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ int CDECL _ismbcdigit(unsigned int ch);
|
|||||||
int CDECL _stricmp(const char *lhs, const char *rhs);
|
int CDECL _stricmp(const char *lhs, const char *rhs);
|
||||||
int CDECL _strnicmp(const char *lhs, const char *rhs, SIZE_T count);
|
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 _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 _snprintf(char *buffer, SIZE_T count, const char *format, ...);
|
||||||
int CDECL_NO_CONV sprintf(char *buffer, const char *format, ...);
|
int CDECL_NO_CONV sprintf(char *buffer, const char *format, ...);
|
||||||
int CDECL_NO_CONV printf(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);
|
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 *));
|
void CDECL qsort(void *base, SIZE_T num, SIZE_T size, int (*compar)(const void *, const void *));
|
||||||
int CDECL fflush(FILE *stream);
|
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);
|
FILE *CDECL fopen(const char *filename, const char *mode);
|
||||||
int CDECL _dup2(int fd1, int fd2);
|
int CDECL _dup2(int fd1, int fd2);
|
||||||
int CDECL _isatty(int fd);
|
int CDECL _isatty(int fd);
|
||||||
@@ -176,7 +176,7 @@ int CDECL _crt_debugger_hook(int value);
|
|||||||
int CDECL _configthreadlocale(int mode);
|
int CDECL _configthreadlocale(int mode);
|
||||||
void CDECL __setusermatherr(void *handler);
|
void CDECL __setusermatherr(void *handler);
|
||||||
void CDECL _cexit();
|
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_NO_CONV fprintf(FILE *stream, const char *format, ...);
|
||||||
int CDECL fputc(int ch, FILE *stream);
|
int CDECL fputc(int ch, FILE *stream);
|
||||||
SIZE_T CDECL fwrite(const void *buffer, SIZE_T size, SIZE_T count, FILE *stream);
|
SIZE_T CDECL fwrite(const void *buffer, SIZE_T size, SIZE_T count, FILE *stream);
|
||||||
|
|||||||
@@ -535,7 +535,6 @@ def emit_host_to_guest_thunks(
|
|||||||
lines.append(
|
lines.append(
|
||||||
f"\t# Arg {i} (slot_size={arg.slot_size}, primitive={arg.primitive}, sign_extended={arg.sign_extended})"
|
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".weak {thunk}")
|
||||||
lines.append(f".type {thunk}, @function")
|
lines.append(f".type {thunk}, @function")
|
||||||
lines.append(f"{thunk}:")
|
lines.append(f"{thunk}:")
|
||||||
|
|||||||
Reference in New Issue
Block a user