mojoshader.c
branchtrunk
changeset 195 5e68c48dac00
parent 194 8de489efc811
child 214 a4346bb8608b
equal deleted inserted replaced
194:8de489efc811 195:5e68c48dac00
  4321 
  4321 
  4322     return failf(ctx, "unknown token (%u)", (uint) *ctx->tokens);
  4322     return failf(ctx, "unknown token (%u)", (uint) *ctx->tokens);
  4323 } // parse_token
  4323 } // parse_token
  4324 
  4324 
  4325 
  4325 
       
  4326 // #define this to force app to supply an allocator, so there's no reference
       
  4327 //  to the C runtime's malloc() and free()...
       
  4328 #if MOJOSHADER_FORCE_ALLOCATOR
       
  4329 #define internal_malloc NULL
       
  4330 #define internal_free NULL
       
  4331 #else
  4326 static void *internal_malloc(int bytes, void *d) { return malloc(bytes); }
  4332 static void *internal_malloc(int bytes, void *d) { return malloc(bytes); }
  4327 static void internal_free(void *ptr, void *d) { free(ptr); }
  4333 static void internal_free(void *ptr, void *d) { free(ptr); }
  4328 
  4334 #endif
  4329 
  4335 
  4330 static int find_profile_id(const char *profile)
  4336 static int find_profile_id(const char *profile)
  4331 {
  4337 {
  4332     int i;
  4338     int i;
  4333     for (i = 0; i < STATICARRAYLEN(profiles); i++)
  4339     for (i = 0; i < STATICARRAYLEN(profiles); i++)