move explicit bezier to vg
[vg.git] / vg_platform.h
index 5ec7287ab436d692f8fb40141627b790ed423cd5..e9bf50b4e9e606845f0c87085eee59c7aab59863 100644 (file)
@@ -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 <stdio.h>
-#include <string.h>
-#include <stdarg.h>
-#include <ctype.h>
-#include <math.h>
-#include <assert.h>
-#include <setjmp.h>
-#include <sys/time.h>
-#include <math.h>
-#include <stdio.h>
-#include <errno.h>
-#include <stdlib.h>
-#endif
-
 #include <stdlib.h>
 #include <stdint.h>
 
@@ -57,9 +28,16 @@ typedef v3f                  m4x3f[4];
 typedef v4f       m4x4f[4];
 typedef v3f                    boxf[2];
 
-/* anything compiled against VG shall implement this function somewhere. */
+/* anything compiled against VG shall implement vg_fatal_exit() somewhere. */
+void vg_fatal_condition(void);
+void vg_fatal_exit(void);
 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]))
+#define VG_ARRAY_LEN( A ) (sizeof(A)/sizeof(A[0]))