diff --git a/extlib/benz/bool.c b/extlib/benz/bool.c index ff7d4a31..19c856cb 100644 --- a/extlib/benz/bool.c +++ b/extlib/benz/bool.c @@ -3,6 +3,7 @@ */ #include "picrin.h" +#include "picrin/object.h" #if PIC_NAN_BOXING diff --git a/extlib/benz/cont.c b/extlib/benz/cont.c index 80ce6c54..4a43c9cf 100644 --- a/extlib/benz/cont.c +++ b/extlib/benz/cont.c @@ -3,6 +3,7 @@ */ #include "picrin.h" +#include "picrin/object.h" void pic_wind(pic_state *pic, pic_checkpoint *here, pic_checkpoint *there) diff --git a/extlib/benz/eval.c b/extlib/benz/eval.c index 371651c6..43992d2e 100644 --- a/extlib/benz/eval.c +++ b/extlib/benz/eval.c @@ -3,6 +3,7 @@ */ #include "picrin.h" +#include "picrin/object.h" #include "picrin/opcode.h" static pic_value diff --git a/extlib/benz/include/picrin.h b/extlib/benz/include/picrin.h index 47d5b16e..606af64f 100644 --- a/extlib/benz/include/picrin.h +++ b/extlib/benz/include/picrin.h @@ -270,7 +270,6 @@ int pic_str_hash(pic_state *, struct pic_string *); #include "picrin/record.h" #include "picrin/string.h" #include "picrin/symbol.h" -#include "picrin/vector.h" void *pic_default_allocf(void *, void *, size_t); diff --git a/extlib/benz/include/picrin/object.h b/extlib/benz/include/picrin/object.h index bef9590f..b362f95c 100644 --- a/extlib/benz/include/picrin/object.h +++ b/extlib/benz/include/picrin/object.h @@ -9,6 +9,20 @@ extern "C" { #endif + +/* vector */ + +struct pic_vector { + PIC_OBJECT_HEADER + pic_value *data; + int len; +}; + +#define pic_vec_ptr(o) ((struct pic_vector *)pic_obj_ptr(o)) + + +/* weak */ + KHASH_DECLARE(weak, void *, pic_value) struct pic_weak { diff --git a/extlib/benz/include/picrin/vector.h b/extlib/benz/include/picrin/vector.h deleted file mode 100644 index bb5ddad1..00000000 --- a/extlib/benz/include/picrin/vector.h +++ /dev/null @@ -1,24 +0,0 @@ -/** - * See Copyright Notice in picrin.h - */ - -#ifndef PICRIN_VECTOR_H -#define PICRIN_VECTOR_H - -#if defined(__cplusplus) -extern "C" { -#endif - -struct pic_vector { - PIC_OBJECT_HEADER - pic_value *data; - int len; -}; - -#define pic_vec_ptr(o) ((struct pic_vector *)pic_obj_ptr(o)) - -#if defined(__cplusplus) -} -#endif - -#endif diff --git a/extlib/benz/proc.c b/extlib/benz/proc.c index c77c9a9a..b8b54339 100644 --- a/extlib/benz/proc.c +++ b/extlib/benz/proc.c @@ -3,6 +3,7 @@ */ #include "picrin.h" +#include "picrin/object.h" #include "picrin/opcode.h" #define MIN(x,y) ((x) < (y) ? (x) : (y)) diff --git a/extlib/benz/read.c b/extlib/benz/read.c index 172e02db..84738f2c 100644 --- a/extlib/benz/read.c +++ b/extlib/benz/read.c @@ -3,6 +3,7 @@ */ #include "picrin.h" +#include "picrin/object.h" KHASH_DEFINE(read, int, pic_value, kh_int_hash_func, kh_int_hash_equal) diff --git a/extlib/benz/vector.c b/extlib/benz/vector.c index 358ad54e..965d46e3 100644 --- a/extlib/benz/vector.c +++ b/extlib/benz/vector.c @@ -3,6 +3,7 @@ */ #include "picrin.h" +#include "picrin/object.h" struct pic_vector * pic_make_vec(pic_state *pic, int len) diff --git a/extlib/benz/write.c b/extlib/benz/write.c index 73bba09e..9e3e2a50 100644 --- a/extlib/benz/write.c +++ b/extlib/benz/write.c @@ -3,6 +3,7 @@ */ #include "picrin.h" +#include "picrin/object.h" KHASH_DECLARE(l, void *, int) KHASH_DECLARE(v, void *, int)