Skip to content

Commit 51a4ad8

Browse files
committed
1 parent e19c181 commit 51a4ad8

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/libgap-api.h

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,20 +61,24 @@ static inline int GAP_Error_Postjmp_(int JumpRet)
6161
// will result in crashes if the error handler is entered recursively (you
6262
// don't want the GAP error handling code to cause a longjmp into the error
6363
// callback itself since then the error callback will never be returned from).
64-
#ifdef __GNUC__
64+
#ifndef __GNUC__
6565
#define GAP_EnterStack() \
6666
do { \
6767
GAP_ENTER_DEBUG_MESSAGE("EnterStack", __FILE__, __LINE__); \
6868
GAP_EnterStack_(__builtin_frame_address(0)); \
6969
} while (0)
70+
#elif defined(USE_GASMAN)
71+
#error GASMAN requires a way to get the current stack frame base address \
72+
for the GAP_EnterStack() macro; normally this uses the \
73+
__builtin_frame_address GNU extension so if this is not available \
74+
it is necessary to provide your own implementation here.
7075
#else
71-
// Generic fallback, should work in most cases (see e.g. GenStackFuncBags
72-
// in gasman.c)
76+
// If we're not using GASMAN in the first place GAP_EnterStack_() is not
77+
// strictly needed, and can just be called with a dummy value
7378
#define GAP_EnterStack() \
7479
do { \
7580
GAP_ENTER_DEBUG_MESSAGE("EnterStack", __FILE__, __LINE__); \
76-
int _gap_dummy[1]; \
77-
GAP_EnterStack(_gap_dummy);
81+
GAP_EnterStack_(0); \
7882
} while (0)
7983
#endif
8084

0 commit comments

Comments
 (0)