feat(console output): implemented printing to console for windows

This commit is contained in:
Mineplay 2025-10-17 13:16:22 -05:00
parent bdc3b26f97
commit 2357205470

View file

@ -21,15 +21,29 @@
*/
#include "../../Include/Iony/Core/Console.h"
#if defined(_WIN32)
#include <windows.h>
#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;