initial commit

This commit is contained in:
2026-02-12 00:45:31 -08:00
commit 5f168f370b
3024 changed files with 804889 additions and 0 deletions

View File

@@ -0,0 +1,49 @@
#pragma once
#ifdef _WIN32
#include <io.h> // for _write
#else
#include <unistd.h> // for write
#endif
namespace fl {
// Print functions
inline void print_native(const char* str) {
if (!str) return;
// Native/Testing: Use direct system calls to stderr
// Calculate length without strlen()
size_t len = 0;
const char* p = str;
while (*p++) len++;
#ifdef _WIN32
// Windows version
_write(2, str, len); // 2 = stderr
#else
// Unix/Linux version
::write(2, str, len); // 2 = stderr
#endif
}
inline void println_native(const char* str) {
if (!str) return;
print_native(str);
print_native("\n");
}
// Input functions
inline int available_native() {
// Native platforms - no input available in most cases
// This is mainly for testing environments
return 0;
}
inline int read_native() {
// Native platforms - no input available in most cases
// This is mainly for testing environments
return -1;
}
} // namespace fl