X-Git-Url: https://harrygodden.com/git/?p=vg.git;a=blobdiff_plain;f=vg_platform.h;h=319f7a9abd1892e2fb4b8d03860484aa4c5725a0;hp=5ec7287ab436d692f8fb40141627b790ed423cd5;hb=HEAD;hpb=3b14f3dcd5bf9dd3c85144f2123d667bfa4bb63f diff --git a/vg_platform.h b/vg_platform.h index 5ec7287..b846b06 100644 --- a/vg_platform.h +++ b/vg_platform.h @@ -1,34 +1,5 @@ #pragma once -#if 0 -#include "vg_stdint.h" -// Resource types -typedef struct vg_tex2d vg_tex2d; - -struct vg_achievement -{ - int is_set; - const char *name; -}; - -#define vg_static_assert _Static_assert -#define VG_MUST_USE_RESULT __attribute__((warn_unused_result)) - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#endif - #include #include @@ -60,6 +31,12 @@ typedef v3f boxf[2]; /* anything compiled against VG shall implement this function somewhere. */ void vg_fatal_error( const char *fmt, ... ); +#define VG_ASSERT( ITEM, ... ) \ + if( !( ITEM ) ) { \ + vg_fatal_error( "Assertion failed: " VG_LOG_MCSTR(ITEM) "\n" \ + VG_LOG_WHERE ); \ + } + #define VG_MIN( A, B ) ((A)<(B)?(A):(B)) #define VG_MAX( A, B ) ((A)>(B)?(A):(B)) #define vg_list_size( A ) (sizeof(A)/sizeof(A[0]))