aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2016-11-06 20:31:28 +0100
committerTristan Gingold <tgingold@free.fr>2016-11-06 20:31:28 +0100
commit619a818dde23dfc6361a2edce9fe0b18aa249d40 (patch)
tree8b43b0f0a3c27d8284c3c9aa98145cead58fdc31
parent2d6ebdf8202754df007c3d20e6626ba9c5caa900 (diff)
downloadghdl-619a818dde23dfc6361a2edce9fe0b18aa249d40.tar.gz
ghdl-619a818dde23dfc6361a2edce9fe0b18aa249d40.tar.bz2
ghdl-619a818dde23dfc6361a2edce9fe0b18aa249d40.zip
win32.c: install SEH handler only on i386
-rw-r--r--src/grt/config/win32.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/grt/config/win32.c b/src/grt/config/win32.c
index c473b246c..677943c4a 100644
--- a/src/grt/config/win32.c
+++ b/src/grt/config/win32.c
@@ -164,18 +164,22 @@ int
__ghdl_run_through_longjump (int (*func)(void))
{
int res;
+
+#ifdef __i386__
+ /* Install an SEH handler. */
struct exception_registration er;
struct exception_registration *prev;
/* Get current handler. */
- asm ("mov %%fs:(0),%0" : "=r" (prev));
+ asm volatile ("mov %%fs:(0),%0" : "=r" (prev));
/* Build regisration. */
er.prev = prev;
er.handler = ghdl_SEH_handler;
/* Register. */
- asm ("mov %0,%%fs:(0)" : : "r" (&er));
+ asm volatile ("mov %0,%%fs:(0)" : : "r" (&er));
+#endif
run_env_en = 1;
res = setjmp (run_env);
@@ -183,8 +187,10 @@ __ghdl_run_through_longjump (int (*func)(void))
res = (*func)();
run_env_en = 0;
+#ifdef __i386__
/* Restore. */
- asm ("mov %0,%%fs:(0)" : : "r" (prev));
+ asm volatile ("mov %0,%%fs:(0)" : : "r" (prev));
+#endif
return res;
}