Added very useful and convenient macro for parsing attribute IDs
[AROS.git] / arch / arm-native / ceboot / ui.c
blobe8a10c9ebf2c31742cf405ca5b71094cd188466d
1 #include <stdarg.h>
2 #include <stdio.h>
3 #include <windows.h>
5 #include <runtime.h>
7 #include "bootstrap.h"
9 static LPTSTR StrConvert(const char *src)
11 int len = strlen(src) + 1;
12 LPTSTR res = malloc(len * 2);
14 if (res)
16 if (!MultiByteToWideChar(CP_ACP, 0, src, -1, res, len))
18 free(res);
19 return NULL;
22 return res;
25 void kprintf(const char *fmt, ...)
27 va_list args;
29 va_start(args, fmt);
30 vfprintf(stderr, fmt, args);
31 va_end(args);
34 void DisplayError(char *fmt, ...)
36 va_list args;
37 LPTSTR str;
39 va_start(args, fmt);
40 vsnprintf(buf, sizeof(buf), fmt, args);
41 va_end(args);
43 str = StrConvert(buf);
44 MessageBox(NULL, str, TEXT("AROS bootstrap error"), MB_OK|MB_ICONSTOP);
45 free(str);