mojoshader_common.c
changeset 1146 31337471b909
parent 1141 77468a2a9165
child 1150 02c0f0afb39a
--- a/mojoshader_common.c	Wed Dec 31 16:49:59 2014 -0500
+++ b/mojoshader_common.c	Sat Jan 03 00:50:43 2015 -0500
@@ -1,6 +1,22 @@
 #define __MOJOSHADER_INTERNAL__ 1
 #include "mojoshader_internal.h"
 
+// Convenience functions for allocators...
+#if !MOJOSHADER_FORCE_ALLOCATOR
+void *MOJOSHADER_internal_malloc(int bytes, void *d) { return malloc(bytes); }
+void MOJOSHADER_internal_free(void *ptr, void *d) { free(ptr); }
+#endif
+
+MOJOSHADER_error MOJOSHADER_out_of_mem_error = {
+    "Out of memory", NULL, MOJOSHADER_POSITION_NONE
+};
+
+MOJOSHADER_parseData MOJOSHADER_out_of_mem_data = {
+    1, &MOJOSHADER_out_of_mem_error, 0, 0, 0, 0,
+    MOJOSHADER_TYPE_UNKNOWN, 0, 0, 0, 0
+};
+
+
 typedef struct HashItem
 {
     const void *key;