mirror of
https://github.com/nunuhara/xsystem4.git
synced 2026-10-10 00:08:23 +03:00
Android: Report ERROR() with a message box
This commit is contained in:
@@ -129,8 +129,13 @@ void vm_stack_trace(void);
|
||||
_Noreturn void _vm_error(const char *fmt, ...);
|
||||
_Noreturn void vm_exit(int code);
|
||||
|
||||
#ifdef __ANDROID__
|
||||
// Report the error with a message box and exit.
|
||||
#define VM_ERROR ERROR
|
||||
#else
|
||||
#define VM_ERROR(fmt, ...) \
|
||||
_vm_error("*ERROR*(%s:%s:%d): " fmt "\n", __FILE__, __func__, __LINE__, ##__VA_ARGS__)
|
||||
#endif
|
||||
|
||||
#ifdef VM_PRIVATE
|
||||
#include "little_endian.h"
|
||||
|
||||
@@ -401,11 +401,22 @@ static void windows_error_handler(const char *msg)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __ANDROID__
|
||||
static void android_error_handler(const char *msg)
|
||||
{
|
||||
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "xsystem4", msg, NULL);
|
||||
}
|
||||
#endif
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
#ifdef _WIN32
|
||||
sys_error_handler = windows_error_handler;
|
||||
#endif
|
||||
#ifdef __ANDROID__
|
||||
sys_error_handler = android_error_handler;
|
||||
#endif
|
||||
|
||||
initialize_instructions();
|
||||
char *ainfile;
|
||||
int err = AIN_SUCCESS;
|
||||
|
||||
Reference in New Issue
Block a user