mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-02 13:00:26 +02:00
make SCM_I_SETJMP and SCM_I_LONGJMP private
* libguile/_scm.h (SCM_I_SETJMP, SCM_I_LONGJMP): Move to this private header. * libguile/__scm.h (scm_i_jmp_buf): Only define the scm_i_jmp_buf type in this public header.
This commit is contained in:
parent
2acdd822fb
commit
04245bb72f
2 changed files with 44 additions and 30 deletions
|
@ -337,54 +337,33 @@ typedef void *scm_t_subr;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Setjmp and longjmp
|
/* scm_i_jmp_buf
|
||||||
|
*
|
||||||
|
* The corresponding SCM_I_SETJMP and SCM_I_LONGJMP are defined in the
|
||||||
|
* _scm.h private header.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if defined (vms)
|
#if defined (vms)
|
||||||
/* VMS: Implement setjmp in terms of setjump. */
|
typedef int scm_i_jmp_buf[17];
|
||||||
typedef int jmp_buf[17];
|
|
||||||
extern int setjump(jmp_buf env);
|
|
||||||
extern int longjump(jmp_buf env, int ret);
|
|
||||||
# define setjmp setjump
|
|
||||||
# define longjmp longjump
|
|
||||||
|
|
||||||
#elif defined (_CRAY1)
|
#elif defined (_CRAY1)
|
||||||
/* Cray: Implement setjmp in terms of setjump. */
|
typedef int scm_i_jmp_buf[112];
|
||||||
typedef int jmp_buf[112];
|
|
||||||
extern int setjump(jmp_buf env);
|
|
||||||
extern int longjump(jmp_buf env, int ret);
|
|
||||||
# define setjmp setjump
|
|
||||||
# define longjmp longjump
|
|
||||||
|
|
||||||
#elif defined (__ia64__)
|
#elif defined (__ia64__)
|
||||||
/* IA64: Implement setjmp in terms of getcontext. */
|
|
||||||
# include <signal.h>
|
# include <signal.h>
|
||||||
# include <ucontext.h>
|
# include <ucontext.h>
|
||||||
typedef struct {
|
typedef struct {
|
||||||
ucontext_t ctx;
|
ucontext_t ctx;
|
||||||
int fresh;
|
int fresh;
|
||||||
} scm_i_jmp_buf;
|
} scm_i_jmp_buf;
|
||||||
# define SCM_I_SETJMP(JB) \
|
|
||||||
( (JB).fresh = 1, \
|
|
||||||
getcontext (&((JB).ctx)), \
|
|
||||||
((JB).fresh ? ((JB).fresh = 0, 0) : 1) )
|
|
||||||
# define SCM_I_LONGJMP(JB,VAL) scm_ia64_longjmp (&(JB), VAL)
|
|
||||||
void scm_ia64_longjmp (scm_i_jmp_buf *, int);
|
|
||||||
|
|
||||||
#else
|
#else
|
||||||
/* All other systems just use setjmp.h. */
|
|
||||||
# include <setjmp.h>
|
# include <setjmp.h>
|
||||||
|
typedef jmp_buf scm_i_jmp_buf;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* For any platform where SCM_I_SETJMP hasn't been defined in some
|
|
||||||
special way above, map SCM_I_SETJMP, SCM_I_LONGJMP and
|
|
||||||
scm_i_jmp_buf to setjmp, longjmp and jmp_buf. */
|
|
||||||
#ifndef SCM_I_SETJMP
|
|
||||||
#define scm_i_jmp_buf jmp_buf
|
|
||||||
#define SCM_I_SETJMP setjmp
|
|
||||||
#define SCM_I_LONGJMP longjmp
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* If stack is not longword aligned then
|
/* If stack is not longword aligned then
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -191,6 +191,41 @@
|
||||||
#define scm_from_off64_t scm_from_int64
|
#define scm_from_off64_t scm_from_int64
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#if defined (vms)
|
||||||
|
/* VMS: Implement SCM_I_SETJMP in terms of setjump. */
|
||||||
|
extern int setjump(scm_i_jmp_buf env);
|
||||||
|
extern int longjump(scm_i_jmp_buf env, int ret);
|
||||||
|
#define SCM_I_SETJMP setjump
|
||||||
|
#define SCM_I_LONGJMP longjump
|
||||||
|
|
||||||
|
#elif defined (_CRAY1)
|
||||||
|
/* Cray: Implement SCM_I_SETJMP in terms of setjump. */
|
||||||
|
extern int setjump(scm_i_jmp_buf env);
|
||||||
|
extern int longjump(scm_i_jmp_buf env, int ret);
|
||||||
|
#define SCM_I_SETJMP setjump
|
||||||
|
#define SCM_I_LONGJMP longjump
|
||||||
|
|
||||||
|
#elif defined (__ia64__)
|
||||||
|
/* IA64: Implement SCM_I_SETJMP in terms of getcontext. */
|
||||||
|
# define SCM_I_SETJMP(JB) \
|
||||||
|
( (JB).fresh = 1, \
|
||||||
|
getcontext (&((JB).ctx)), \
|
||||||
|
((JB).fresh ? ((JB).fresh = 0, 0) : 1) )
|
||||||
|
# define SCM_I_LONGJMP(JB,VAL) scm_ia64_longjmp (&(JB), VAL)
|
||||||
|
void scm_ia64_longjmp (scm_i_jmp_buf *, int);
|
||||||
|
|
||||||
|
#else
|
||||||
|
/* All other systems just use setjmp and longjmp. */
|
||||||
|
|
||||||
|
#define SCM_I_SETJMP setjmp
|
||||||
|
#define SCM_I_LONGJMP longjmp
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* The endianness marker in objcode. */
|
/* The endianness marker in objcode. */
|
||||||
#ifdef WORDS_BIGENDIAN
|
#ifdef WORDS_BIGENDIAN
|
||||||
# define SCM_OBJCODE_ENDIANNESS "BE"
|
# define SCM_OBJCODE_ENDIANNESS "BE"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue