Skip to content

Commit

Permalink
Make it possible to ignore OMC_DISABLE_OPT
Browse files Browse the repository at this point in the history
By setting cflags to `-DOMC_DISABLE_OPT=`, you can force the C-compiler
to optimize all code fully (not recommended).

Belonging to [master]:
  - OpenModelica/OMCompiler#1889
  • Loading branch information
sjoelund authored and OpenModelica-Hudson committed Oct 11, 2017
1 parent 94e29a9 commit 024a75d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions SimulationRuntime/c/openmodelica.h
Expand Up @@ -178,11 +178,13 @@ static inline int sign(double v)
#define OMC_LABEL_UNUSED __attribute__((unused))
#endif

#if !defined(OMC_DISABLE_OPT)
#if defined(__clang__)
#define OMC_DISABLE_OPT __attribute__((optnone))
#elif defined(__GNUC__)
#define OMC_DISABLE_OPT __attribute__((optimize(0)))
#endif
#endif

#if defined(__cplusplus)
} /* end extern "C" */
Expand Down

0 comments on commit 024a75d

Please sign in to comment.