diff options
| author | robojumper <robojumper@gmail.com> | 2025-08-20 20:55:56 +0200 |
|---|---|---|
| committer | robojumper <robojumper@gmail.com> | 2025-08-20 20:55:56 +0200 |
| commit | 50c32beaa74ad74efbb4ed8200f81eba63e91557 (patch) | |
| tree | c62fd1fdcd8c9e39ed8185d2e1cd2600dc4fb196 /src/s/s_Print.cpp | |
| parent | 897de53b2dd1c5a315a995db768b083b0267ff5d (diff) | |
Various exception/assert files
Diffstat (limited to 'src/s/s_Print.cpp')
| -rw-r--r-- | src/s/s_Print.cpp | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/s/s_Print.cpp b/src/s/s_Print.cpp new file mode 100644 index 00000000..3a94b0cc --- /dev/null +++ b/src/s/s_Print.cpp @@ -0,0 +1,42 @@ +#include "s/s_Print.h" + +#include "rvl/OS/OSError.h" + +#include <cstdarg> +#include <cstdio> +#include <stdio.h> + +namespace sLib { + +typedef int (*vprintf_sig)(const char *format, va_list args); + +static vprintf_sig sPrintfFunc = &std::vprintf; + +static vprintf_sig getVprintfFunc() { + return sPrintfFunc; +} + +static void my_vprintf(const char *format, va_list args) { + (getVprintfFunc())(format, args); +} + +void printf(const char *msg, ...) { + va_list l; + va_start(l, msg); + vprintf(msg, l); + va_end(l); +} + +} // namespace sLib + +// Overriding the weakly linked OS functions... +void OSReport(const char *msg, ...) { + va_list l; + va_start(l, msg); + OSVReport(msg, l); + va_end(l); +} + +void OSVReport(const char *msg, va_list args) { + sLib::my_vprintf(msg, args); +} |
