| 1 | #if defined(_MSC_VER) && !defined(__clang__) |
| 2 | #include <stdio.h> |
| 3 | #elif defined(__MINGW32__) || defined(__MINGW64__) || (defined(__clang__) && (defined(_WIN32) || defined(_WIN64))) |
| 4 | FILE* __cdecl __acrt_iob_func(unsigned index); |
| 5 | #define stdout (__acrt_iob_func(1)) |
| 6 | #if (!defined(_MSC_VER) || defined(__clang__)) && !defined(__cplusplus) |
| 7 | int V_CRT_CALL _fileno(FILE *stream); |
| 8 | FILE * V_CRT_CALL _wfopen(const unsigned short *filename, const unsigned short *mode); |
| 9 | int V_CRT_CALL _vscprintf(const char *format, va_list ap); |
| 10 | int V_CRT_CALL _vsnprintf_s(char *buffer, size_t size, size_t count, const char *format, va_list ap); |
| 11 | unsigned short * V_CRT_CALL _wgetenv(const unsigned short *varname); |
| 12 | int V_CRT_CALL _wputenv(const unsigned short *envstring); |
| 13 | int V_CRT_CALL _wremove(const unsigned short *path); |
| 14 | #if defined(_MSC_VER) && !defined(__clang__) |
| 15 | #define C__LONG LONG |
| 16 | #define v_set_unhandled_exception_filter(handler) SetUnhandledExceptionFilter((LPTOP_LEVEL_EXCEPTION_FILTER)(handler)) |
| 17 | typedef C__LONG (VCALLCONV(stdcall) *TopLevelExceptionFilter)(ExceptionPointers*); |
| 18 | VV_LOC C__LONG VCALLCONV(stdcall) builtin__unhandled_exception_handler(ExceptionPointers* e); |
| 19 | v_set_unhandled_exception_filter(builtin__unhandled_exception_handler); |
| 20 | u32 res = FormatMessageW( |
| 21 | atomic_compare_exchange_weak_ptr(((voidptr)(&ch->adr_written)), ((voidptr)(&nulladr)), ((isize)(-1))) |
| 22 | atomic_compare_exchange_strong_ptr(((voidptr)(&ch->write_adr)), ((voidptr)(&wradr)), ((isize)(0))) |
| 23 | atomic_compare_exchange_weak_ptr(((voidptr)(&ch->adr_written)), ((voidptr)(&nulladr)), ((isize)(wradr))) |
| 24 | atomic_compare_exchange_weak_ptr(((voidptr)(&ch->adr_read)), ((voidptr)(&nulladr)), ((isize)(rdadr))) |
| 25 | |