mojoshader_preprocessor.c
changeset 557 ef6a607a5618
parent 555 940821555fda
child 558 314c86ff14dd
equal deleted inserted replaced
556:04282775cc2c 557:ef6a607a5618
   302 
   302 
   303     Free(ctx, ctx);
   303     Free(ctx, ctx);
   304 } // preprocessor_end
   304 } // preprocessor_end
   305 
   305 
   306 
   306 
   307 void preprocessor_clearerror(Preprocessor *_ctx)
   307 const char *preprocessor_error(Preprocessor *_ctx)
   308 {
   308 {
   309     Context *ctx = (Context *) _ctx;
   309     Context *ctx = (Context *) _ctx;
   310     ctx->isfail = 0;
   310     if (ctx->isfail)
   311 } // preprocessor_clearerror
   311     {
   312 
   312         ctx->isfail = 0;
   313 
   313         return ctx->failstr;
   314 const char *preprocessor_error(Preprocessor *_ctx)
   314     } // if
   315 {
   315 
   316     Context *ctx = (Context *) _ctx;
   316     return NULL;
   317     return ctx->isfail ? ctx->failstr : NULL;
       
   318 } // preprocessor_error
   317 } // preprocessor_error
   319 
   318 
   320 
   319 
   321 int preprocessor_outofmemory(Preprocessor *_ctx)
   320 int preprocessor_outofmemory(Preprocessor *_ctx)
   322 {
   321 {
   668                     prev->next = error;
   667                     prev->next = error;
   669 
   668 
   670                 error_count++;
   669                 error_count++;
   671             } // else
   670             } // else
   672 
   671 
   673             preprocessor_clearerror(pp);
       
   674             continue;
   672             continue;
   675         } // if
   673         } // if
   676 
   674 
   677         if (out_of_memory)
   675         if (out_of_memory)
   678         {
   676         {