From 42646a0936a56e54f76f28ff9883b4a3425ba8e6 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Fri, 25 Apr 2008 14:37:08 -0400 Subject: [PATCH] Allow internal dependency on malloc/free to be #ifdef'd out. --HG-- branch : trunk --- mojoshader.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mojoshader.c b/mojoshader.c index 776da238..a92ff686 100644 --- a/mojoshader.c +++ b/mojoshader.c @@ -4323,9 +4323,15 @@ static int parse_token(Context *ctx) } // parse_token +// #define this to force app to supply an allocator, so there's no reference +// to the C runtime's malloc() and free()... +#if MOJOSHADER_FORCE_ALLOCATOR +#define internal_malloc NULL +#define internal_free NULL +#else static void *internal_malloc(int bytes, void *d) { return malloc(bytes); } static void internal_free(void *ptr, void *d) { free(ptr); } - +#endif static int find_profile_id(const char *profile) {