Added support for compiling C++ files. It isn't included for all
[AROS.git] / arch / all-mingw32 / kernel / host_debug.c
blobedac479d02f66925cce6e0a49d46a3d4670bb194
1 #include <windows.h>
3 #include "host_intern.h"
5 HANDLE conin, conout;
7 int __declspec(dllexport) __aros core_putc(char c)
9 DWORD cnt;
11 WriteConsole(conout, &c, 1, &cnt, NULL);
12 return cnt;
15 int __declspec(dllexport) __aros core_getc(void)
17 DWORD cnt;
18 INPUT_RECORD input;
22 if (!PeekConsoleInput(conin, &input, 1, &cnt))
23 return -1;
24 if (cnt < 1)
25 return -1;
27 if (!ReadConsoleInput(conin, &input, 1, &cnt))
28 return -1;
29 /* Control keys also generate events with zero character, so we ignore them */
30 } while ((input.EventType != KEY_EVENT) || (!input.Event.KeyEvent.bKeyDown) ||
31 (!input.Event.KeyEvent.uChar.AsciiChar));
33 return input.Event.KeyEvent.uChar.AsciiChar;
36 void __declspec(dllexport) __aros core_alert(const char *text)
38 MessageBox(NULL, text, "AROS guru meditation", MB_ICONERROR|MB_SETFOREGROUND);