From 3fc49b59bed9fe294a3e237acdec78ece4011bc0 Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Mon, 19 Jan 2015 11:11:19 +0900 Subject: [PATCH] move symbol-related macros to symbol.h --- extlib/benz/codegen.c | 1 + extlib/benz/dict.c | 1 + extlib/benz/include/picrin.h | 3 --- extlib/benz/include/picrin/symbol.h | 3 +++ extlib/benz/lib.c | 1 + extlib/benz/macro.c | 1 + extlib/benz/read.c | 1 + extlib/benz/vm.c | 1 + extlib/benz/write.c | 1 + 9 files changed, 10 insertions(+), 3 deletions(-) diff --git a/extlib/benz/codegen.c b/extlib/benz/codegen.c index 8bac2f3e..a58d24c8 100644 --- a/extlib/benz/codegen.c +++ b/extlib/benz/codegen.c @@ -9,6 +9,7 @@ #include "picrin/lib.h" #include "picrin/macro.h" #include "picrin/dict.h" +#include "picrin/symbol.h" #if PIC_NONE_IS_FALSE # define OP_PUSHNONE OP_PUSHFALSE diff --git a/extlib/benz/dict.c b/extlib/benz/dict.c index bdfc40fd..b9c18cce 100644 --- a/extlib/benz/dict.c +++ b/extlib/benz/dict.c @@ -7,6 +7,7 @@ #include "picrin/cont.h" #include "picrin/pair.h" #include "picrin/error.h" +#include "picrin/symbol.h" struct pic_dict * pic_make_dict(pic_state *pic) diff --git a/extlib/benz/include/picrin.h b/extlib/benz/include/picrin.h index 8092fb96..c2a8c6ab 100644 --- a/extlib/benz/include/picrin.h +++ b/extlib/benz/include/picrin.h @@ -51,9 +51,6 @@ extern "C" { #include "picrin/util.h" #include "picrin/value.h" -#define pic_sym(v) pic_ptr(v) -#define pic_sym_p(v) (pic_type(v) == PIC_TT_SYMBOL) - typedef struct pic_code pic_code; struct pic_winder { diff --git a/extlib/benz/include/picrin/symbol.h b/extlib/benz/include/picrin/symbol.h index 84a706bc..629633e7 100644 --- a/extlib/benz/include/picrin/symbol.h +++ b/extlib/benz/include/picrin/symbol.h @@ -14,6 +14,9 @@ struct pic_symbol { pic_str *str; }; +#define pic_sym(v) pic_ptr(v) +#define pic_sym_p(v) (pic_type(v) == PIC_TT_SYMBOL) + #if defined(__cplusplus) } #endif diff --git a/extlib/benz/lib.c b/extlib/benz/lib.c index a4874156..217ba8d7 100644 --- a/extlib/benz/lib.c +++ b/extlib/benz/lib.c @@ -10,6 +10,7 @@ #include "picrin/string.h" #include "picrin/proc.h" #include "picrin/dict.h" +#include "picrin/symbol.h" struct pic_lib * pic_open_library(pic_state *pic, pic_value name) diff --git a/extlib/benz/macro.c b/extlib/benz/macro.c index ed3f85a0..5286f7d8 100644 --- a/extlib/benz/macro.c +++ b/extlib/benz/macro.c @@ -11,6 +11,7 @@ #include "picrin/error.h" #include "picrin/dict.h" #include "picrin/cont.h" +#include "picrin/symbol.h" pic_sym pic_add_rename(pic_state *pic, struct pic_senv *senv, pic_sym sym) diff --git a/extlib/benz/read.c b/extlib/benz/read.c index f7637dc1..00e6fe8c 100644 --- a/extlib/benz/read.c +++ b/extlib/benz/read.c @@ -11,6 +11,7 @@ #include "picrin/blob.h" #include "picrin/port.h" #include "picrin/proc.h" +#include "picrin/symbol.h" static pic_value read(pic_state *pic, struct pic_port *port, int c); static pic_value read_nullable(pic_state *pic, struct pic_port *port, int c); diff --git a/extlib/benz/vm.c b/extlib/benz/vm.c index db54e0ba..7bbaaf24 100644 --- a/extlib/benz/vm.c +++ b/extlib/benz/vm.c @@ -15,6 +15,7 @@ #include "picrin/error.h" #include "picrin/dict.h" #include "picrin/record.h" +#include "picrin/symbol.h" #define GET_OPERAND(pic,n) ((pic)->ci->fp[(n)]) diff --git a/extlib/benz/write.c b/extlib/benz/write.c index ee521079..ac374fe8 100644 --- a/extlib/benz/write.c +++ b/extlib/benz/write.c @@ -11,6 +11,7 @@ #include "picrin/dict.h" #include "picrin/record.h" #include "picrin/proc.h" +#include "picrin/symbol.h" static bool is_tagged(pic_state *pic, pic_sym tag, pic_value pair)