bad char
[vg.git] / vg_log.h
index 9c8d59f373a4c4084406de3e835acac3cd4922b5..cf2b7370301b8de0db02a163b0e2ebda9c648c43 100644 (file)
--- a/vg_log.h
+++ b/vg_log.h
@@ -1,8 +1,7 @@
-#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
@@ -12,7 +11,7 @@
 #define vg_success( ... ) \
  vg_logx(stdout,VG_LOG_WHERE,"success",KGRN,__VA_ARGS__)
 #define vg_info( ... ) \
- vg_logx(stdout,VG_LOG_WHERE,"info",KWHT,__VA_ARGS__)
+ vg_logx(stdout,VG_LOG_WHERE,"info",KNRM,__VA_ARGS__)
 #define vg_warn( ... ) \
  vg_logx(stdout,VG_LOG_WHERE,"warn",KYEL,__VA_ARGS__ )
 #define vg_error( ... ) \
  #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, ... );
+#ifdef VG_ENGINE
+   SDL_SpinLock print_sl;
+#endif
+}
+extern vg_log;
 
-static void _vg_logx_va( FILE *file, 
-                         const char *location, const char *prefix,
-                         const char *colour,
-                         const char *fmt, va_list args );
+void vg_logx( FILE *file, 
+              const char *location, const char *prefix, 
+              const char *colour,
+              const char *fmt, ... );
 
-static void vg_print_backtrace(void);
+void _vg_logx_va( FILE *file, 
+                  const char *location, const char *prefix,
+                  const char *colour,
+                  const char *fmt, va_list args );
 
+void vg_print_backtrace(void);
 
-#endif