PIC_USE_CALLCC -> PIC_USE_CONT

cont.c now contains not only call/cc but also shift/reset
This commit is contained in:
Yuichi Nishiwaki 2017-05-13 01:02:10 +09:00
parent 80740c83bc
commit 3aaa5f29b3
4 changed files with 10 additions and 11 deletions

View File

@ -7,7 +7,7 @@
#include "../object.h" #include "../object.h"
#include "../state.h" #include "../state.h"
#if PIC_USE_CALLCC #if PIC_USE_CONT
/* /*
* [(reset e)]k = k ([e] halt ()) * [(reset e)]k = k ([e] halt ())

View File

@ -6,14 +6,13 @@
* enable libc * enable libc
*/ */
/* When PIC_USE_LIBC=0, users must supply panicf which never returns. */
/* #define PIC_USE_LIBC 1 */ /* #define PIC_USE_LIBC 1 */
/** /**
* enable specific features * enable specific features
*/ */
/* #define PIC_USE_CALLCC 1 */ /* #define PIC_USE_CONT 1 */
/* #define PIC_USE_PORT 1 */ /* #define PIC_USE_PORT 1 */
/* #define PIC_USE_READ 1 */ /* #define PIC_USE_READ 1 */
/* #define PIC_USE_WRITE 1 */ /* #define PIC_USE_WRITE 1 */

View File

@ -12,8 +12,8 @@
# define PIC_USE_PORT 1 # define PIC_USE_PORT 1
#endif #endif
#ifndef PIC_USE_CALLCC #ifndef PIC_USE_CONT
# define PIC_USE_CALLCC 1 # define PIC_USE_CONT 1
#endif #endif
#ifndef PIC_USE_READ #ifndef PIC_USE_READ
@ -48,14 +48,14 @@
#if !PIC_USE_LIBC && PIC_USE_FILE #if !PIC_USE_LIBC && PIC_USE_FILE
# error PIC_USE_FILE requires PIC_USE_LIBC # error PIC_USE_FILE requires PIC_USE_LIBC
#endif #endif
#if !PIC_USE_LIBC && PIC_USE_CALLCC #if !PIC_USE_LIBC && PIC_USE_CONT
# error PIC_USE_CALLCC requires PIC_USE_LIBC # error PIC_USE_CONT requires PIC_USE_LIBC
#endif #endif
#if !PIC_USE_CALLCC && PIC_USE_ERROR #if !PIC_USE_CONT && PIC_USE_ERROR
# error PIC_USE_ERROR requires PIC_USE_CALLCC # error PIC_USE_ERROR requires PIC_USE_CONT
#endif #endif
#if PIC_USE_CALLCC #if PIC_USE_CONT
# include <setjmp.h> # include <setjmp.h>
# define PIC_JMPBUF jmp_buf # define PIC_JMPBUF jmp_buf
# define PIC_SETJMP(buf) setjmp(buf) # define PIC_SETJMP(buf) setjmp(buf)

View File

@ -66,7 +66,7 @@ pic_init_core(pic_state *pic)
pic_init_attr(pic); DONE; pic_init_attr(pic); DONE;
pic_init_state(pic); DONE; pic_init_state(pic); DONE;
#if PIC_USE_CALLCC #if PIC_USE_CONT
pic_init_cont(pic); DONE; pic_init_cont(pic); DONE;
#endif #endif
#if PIC_USE_READ #if PIC_USE_READ