Skip to content

Commit

Permalink
- properly use the old throw for now in Windows (switch to it when wo…
Browse files Browse the repository at this point in the history
…rking properly)

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@7193 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adrpo committed Nov 25, 2010
1 parent 6c08226 commit c6c0839
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion c_runtime/meta_modelica.h
Expand Up @@ -187,8 +187,9 @@ modelica_real mmc_prim_get_real(void *p);
#define mmc__unbox__string(X) MMC_STRINGDATA(X)
#define mmc__unbox__array(X) (*((base_array_t*)X))

#if !defined(OMDEV)
#include <setjmp.h>

#if !defined(__MINGW32__) && !defined(_MSC_VER)
extern jmp_buf mmc_jumper;
#define MMC_TRY() {jmp_buf old_mmc_jumper; *old_mmc_jumper = *mmc_jumper; if (setjmp(mmc_jumper) == 0) {
#define MMC_CATCH() *mmc_jumper = *old_mmc_jumper;} else {*mmc_jumper = *old_mmc_jumper;}}
Expand All @@ -202,6 +203,10 @@ extern jmp_buf mmc_jumper;
#define MMC_TRY() try {
#define MMC_CATCH() } catch (...) {}
#define MMC_THROW() throw 1

#define MMC_TRY_TOP() try{
#define MMC_CATCH_TOP(X) } catch (...) {}

#endif

#if defined(__cplusplus)
Expand Down

0 comments on commit c6c0839

Please sign in to comment.