-#ifndef VG_LOG_H
-#define VG_LOG_H
+#pragma once
+#include "vg_platform.h"
#include <stdio.h>
-#include "vg_stdint.h"
#define VG_LOG_MCSTR(S) VG_LOG_MCSTR2(S)
#define VG_LOG_MCSTR2(S) #S
-#define VG_LOG_WHERE "@" __FILE__ ":" VG_LOG_MCSTR(__LINE__)\
+#define VG_LOG_WHERE __FILE__ ":" VG_LOG_MCSTR(__LINE__)\
" "
#define vg_success( ... ) \
#define PRINTF_v3f( V3 ) "%.4f %.4f %.4f\n", V3[0], V3[1], V3[2]
#define PRINTF_v4f( V4 ) "%.4f %.4f %.4f %.4f\n", V4[0], V4[1], V4[2], V4[3]
-#ifdef _WIN32
+#if VG_32
#define PRINTF_U64 "%llu"
#else
#define PRINTF_U64 "%lu"
#endif
-#ifdef VG_GAME
+#ifdef VG_ENGINE
#include "dep/sdl/include/SDL.h"
- static SDL_SpinLock log_print_sl;
#endif
-struct vg_log{
+struct vg_log
+{
char log[64][96];
u32 log_line_count, log_line_current;
-}
-static vg_log;
-
-static void vg_logx( FILE *file,
- const char *location, const char *prefix,
- const char *colour,
- const char *fmt, ... );
-
-static void _vg_logx_va( FILE *file,
- const char *location, const char *prefix,
- const char *colour,
- const char *fmt, va_list args );
-static void vg_print_backtrace(void);
+#ifdef VG_ENGINE
+ SDL_SpinLock print_sl;
+#endif
+}
+extern vg_log;
+void vg_logx( FILE *file,
+ const char *location, const char *prefix,
+ const char *colour,
+ const char *fmt, ... );
-#endif
+void _vg_logx_va( FILE *file,
+ const char *location, const char *prefix,
+ const char *colour,
+ const char *fmt, va_list args );