Skip to content
Permalink
Browse files
Moved some simple things into mojoshader_common.c.
This lets you build without mojoshader.c at all, if you're doing just the
compiler, etc, and don't need all the bytecode parsing.
  • Loading branch information
icculus committed Jan 3, 2015
1 parent 44bf450 commit 24884bb0dfe1aca8bb92c035bd963a4936c7c912
Showing with 16 additions and 16 deletions.
  1. +0 −16 mojoshader.c
  2. +16 −0 mojoshader_common.c
@@ -270,22 +270,6 @@ typedef struct Profile
} Profile;


// 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
};


// !!! FIXME: cut and paste between every damned source file follows...
// !!! FIXME: We need to make some sort of ContextBase that applies to all
// !!! FIXME: files and move this stuff to mojoshader_common.c ...
@@ -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;

0 comments on commit 24884bb

Please sign in to comment.