do-not-redefine-jmp-buf.diff 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. Index: sid/libguile/__scm.h
  2. ===================================================================
  3. --- sid.orig/libguile/__scm.h
  4. +++ sid/libguile/__scm.h
  5. @@ -386,21 +386,23 @@
  6. #ifdef vms
  7. # ifndef CHEAP_CONTINUATIONS
  8. - typedef int jmp_buf[17];
  9. - extern int setjump(jmp_buf env);
  10. - extern int longjump(jmp_buf env, int ret);
  11. -# define setjmp setjump
  12. -# define longjmp longjump
  13. + typedef int scm_jmp_buf[17];
  14. + extern int setjump(scm_jmp_buf env);
  15. + extern int longjump(scm_jmp_buf env, int ret);
  16. +# define scm_setjmp setjump
  17. +# define scm_longjmp longjump
  18. +# define SCM_DEFINES_JMP_BUF
  19. # else
  20. # include <setjmp.h>
  21. # endif
  22. #else /* ndef vms */
  23. # ifdef _CRAY1
  24. - typedef int jmp_buf[112];
  25. - extern int setjump(jmp_buf env);
  26. - extern int longjump(jmp_buf env, int ret);
  27. -# define setjmp setjump
  28. -# define longjmp longjump
  29. + typedef int scm_jmp_buf[112];
  30. + extern int setjump(scm_jmp_buf env);
  31. + extern int longjump(scm_jmp_buf env, int ret);
  32. +# define scm_setjmp setjump
  33. +# define scm_longjmp longjump
  34. +# define SCM_DEFINES_JMP_BUF
  35. # else /* ndef _CRAY1 */
  36. # if defined (__ia64__)
  37. /* For IA64, emulate the setjmp API using getcontext. */
  38. @@ -409,15 +411,19 @@
  39. typedef struct {
  40. ucontext_t ctx;
  41. int fresh;
  42. - } jmp_buf;
  43. -# define setjmp(JB) \
  44. + } scm_jmp_buf;
  45. +# define scm_setjmp(JB) \
  46. ( (JB).fresh = 1, \
  47. getcontext (&((JB).ctx)), \
  48. ((JB).fresh ? ((JB).fresh = 0, 0) : 1) )
  49. -# define longjmp(JB,VAL) scm_ia64_longjmp (&(JB), VAL)
  50. - void scm_ia64_longjmp (jmp_buf *, int);
  51. +# define scm_longjmp(JB,VAL) scm_ia64_longjmp (&(JB), VAL)
  52. + void scm_ia64_longjmp (scm_jmp_buf *, int);
  53. +# define SCM_DEFINES_JMP_BUF
  54. # else /* ndef __ia64__ */
  55. # include <setjmp.h>
  56. + typedef jmp_buf scm_jmp_buf;
  57. +# define scm_setjmp setjmp
  58. +# define scm_longjmp longjmp
  59. # endif /* ndef __ia64__ */
  60. # endif /* ndef _CRAY1 */
  61. #endif /* ndef vms */
  62. Index: sid/libguile/_scm.h
  63. ===================================================================
  64. --- sid.orig/libguile/_scm.h
  65. +++ sid/libguile/_scm.h
  66. @@ -60,6 +60,12 @@
  67. #include <errno.h>
  68. #include "libguile/__scm.h"
  69. +#ifdef SCM_DEFINES_JMP_BUF
  70. +typedef scm_jmp_buf jmp_buf;
  71. +#define setjmp(JB) scm_setjmp(JB)
  72. +#define longjmp(JB,VAL) scm_longjmp(JB,VAL)
  73. +#endif
  74. +
  75. /* Include headers for those files central to the implementation. The
  76. rest should be explicitly #included in the C files themselves. */
  77. #include "libguile/error.h" /* Everyone signals errors. */
  78. Index: sid/libguile/continuations.h
  79. ===================================================================
  80. --- sid.orig/libguile/continuations.h
  81. +++ sid/libguile/continuations.h
  82. @@ -43,7 +43,7 @@
  83. typedef struct
  84. {
  85. SCM throw_value;
  86. - jmp_buf jmpbuf;
  87. + scm_jmp_buf jmpbuf;
  88. SCM dynenv;
  89. #ifdef __ia64__
  90. void *backing_store;
  91. Index: sid/libguile/threads.h
  92. ===================================================================
  93. --- sid.orig/libguile/threads.h
  94. +++ sid/libguile/threads.h
  95. @@ -107,7 +107,7 @@
  96. /* For keeping track of the stack and registers. */
  97. SCM_STACKITEM *base;
  98. SCM_STACKITEM *top;
  99. - jmp_buf regs;
  100. + scm_jmp_buf regs;
  101. #ifdef __ia64__
  102. void *register_backing_store_base;
  103. scm_t_contregs *pending_rbs_continuation;