#if defined _WIN32 || defined __CYGWIN__ #include int main(void) { static const char MSG[] = "Hello, world!\r\n\n"; unsigned n; WriteFile(GetStdHandle(STD_OUTPUT_HANDLE), MSG, sizeof(MSG) - 1, &n, 0); ExitProcess(0); } #else #include #ifndef __sun long syscall(long, ...); #endif int main(void) { static const char MSG[] = "Hello, world!\n\n"; syscall(SYS_write, 1, MSG, sizeof(MSG) - 1); return (int)syscall(SYS_exit, 0); } #endif /* defined _WIN32 || defined __CYGWIN__ */