diff --git a/Src/Core/Console.c b/Src/Core/Console.c index e6088af..0f26387 100644 --- a/Src/Core/Console.c +++ b/Src/Core/Console.c @@ -21,15 +21,29 @@ */ #include "../../Include/Iony/Core/Console.h" +#if defined(_WIN32) +#include +#elif defined(__GNUC__) + +#endif + IonyError iony_print(char *text) { - if (text == ((void*)0)) { + if (text == 0) { return IONY_ERROR_INVALID_POINTER; } - #if defined(_WIN32) - - #elif defined(__linux__) + unsigned long text_length = 0; + while (text[text_length] != '\0') { + text_length += 1; + } + #if defined(_WIN32) + static HANDLE standard_console_out_handle = GetStdHandle(STD_OUTPUT_HANDLE); + + DWORD characters_written; + WriteFile(standard_console_out_handle, text, text_length, &characters_written, 0); + #elif defined(__GNUC__) + #endif return IONY_ERROR_NONE;