Skip to content

Commit

Permalink
- undefine macros if they exist because we really need to
Browse files Browse the repository at this point in the history
  replace them in that context because the already defined 
  ones contain references to undeclared variables.

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@11828 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adrpo committed Apr 29, 2012
1 parent bf89fcd commit 8edc12e
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions Compiler/susan_codegen/SimCode/CodegenC.tpl
Expand Up @@ -2298,12 +2298,15 @@ template functionsFile(String filePrefix,
<<
#include "<%filePrefix%>.h"
#include "modelica.h"
#if !defined(MODELICA_ASSERT)
#define MODELICA_ASSERT(info,msg) { printInfo(stderr,info); fprintf(stderr,"Modelica Assert: %s!\n", msg); fflush(NULL); }
#endif
#if !defined(MODELICA_TERMINATE)
#define MODELICA_TERMINATE(msg) { fprintf(stderr,"Modelica Terminate: %s!\n", msg); fflush(NULL); }
/* undefine them if they are defined */
#if defined(MODELICA_ASSERT)
#undef MODELICA_ASSERT
#endif
#if defined(MODELICA_TERMINATE)
#undef MODELICA_TERMINATE
#endif
#define MODELICA_ASSERT(info,msg) { printInfo(stderr,info); fprintf(stderr,"Modelica Assert: %s!\n", msg); fflush(NULL); }
#define MODELICA_TERMINATE(msg) { fprintf(stderr,"Modelica Terminate: %s!\n", msg); fflush(NULL); }

<%match mainFunction case SOME(fn) then functionBody(fn,true)%>
<%functionBodies(functions)%>
Expand Down

0 comments on commit 8edc12e

Please sign in to comment.