Browse Source

More clang revisions.

Brucey 3 years ago
parent
commit
8d212f2860
2 changed files with 12 additions and 7 deletions
  1. 2 2
      blitz.mod/blitz_ex.c
  2. 10 5
      blitz.mod/blitz_ex.h

+ 2 - 2
blitz.mod/blitz_ex.c

@@ -138,8 +138,8 @@ void bbExThrow( BBObject *p ){
 	--st->ex_sp;
 	--st->ex_sp;
 	st->ex_sp->ex = p;
 	st->ex_sp->ex = p;
 #ifdef __MINGW64__
 #ifdef __MINGW64__
-#ifdef __aarch64__
-	longjmp(st->ex_sp->buf, 1); // only allows status 1
+#ifdef __clang__
+	longjmp(st->ex_sp->buf, st->ex_sp->jmp_status);
 #else
 #else
 	__builtin_longjmp(st->ex_sp->buf, 1); // only allows status 1
 	__builtin_longjmp(st->ex_sp->buf, 1); // only allows status 1
 #endif
 #endif

+ 10 - 5
blitz.mod/blitz_ex.h

@@ -16,23 +16,28 @@ void*	bbArgp( int offset );
 #endif
 #endif
 
 
 #ifdef __MINGW64__
 #ifdef __MINGW64__
+#if __clang__
+typedef jmp_buf BBExJmpBuf;
+#else
 typedef intptr_t BBExJmpBuf[5];
 typedef intptr_t BBExJmpBuf[5];
+#endif
 #else
 #else
 typedef jmp_buf BBExJmpBuf;
 typedef jmp_buf BBExJmpBuf;
 #endif
 #endif
 
 
 // bbExTry can't be a function due to how setjmp works, so a macro it is
 // bbExTry can't be a function due to how setjmp works, so a macro it is
 #ifdef __MINGW64__
 #ifdef __MINGW64__
-#ifdef __aarch64__
-#define _jumpfunc setjmp
+#ifdef __clang__
+#define bbExTry \
+	BBExJmpBuf* buf = bbExEnter(); \
+	switch(setjmp(*buf))
 #else
 #else
-#define _jumpfunc __builtin_setjmp
-#endif
 #define bbExTry \
 #define bbExTry \
 	BBExJmpBuf* buf = bbExEnter(); \
 	BBExJmpBuf* buf = bbExEnter(); \
 	int jmp_status = 0; \
 	int jmp_status = 0; \
-	if(_jumpfunc(*buf)) jmp_status = bbExStatus(); \
+	if(__builtin_setjmp(*buf)) jmp_status = bbExStatus(); \
 	switch(jmp_status)
 	switch(jmp_status)
+#endif
 #elif __APPLE__
 #elif __APPLE__
 #define bbExTry \
 #define bbExTry \
 	BBExJmpBuf* buf = bbExEnter(); \
 	BBExJmpBuf* buf = bbExEnter(); \