diff --git a/include/picrin.h b/include/picrin.h index fe8cdedf..151ca445 100644 --- a/include/picrin.h +++ b/include/picrin.h @@ -128,13 +128,15 @@ struct pic_lib *pic_make_library(pic_state *, pic_value); struct pic_lib *pic_find_library(pic_state *, pic_value); #define DEFLIBRARY(pic,name) \ - { \ + do { \ struct pic_lib *lib__ = pic->lib; \ pic_make_library(pic, pic_parse(pic, name)); \ - pic_in_library(pic, pic_parse(pic, name)); + pic_in_library(pic, pic_parse(pic, name)); \ + do #define ENDLIBRARY(pic) \ + while (0); \ pic->lib = lib__; \ - } + } while (0) void pic_export(pic_state *, pic_sym); diff --git a/src/file.c b/src/file.c index 307a6688..2be87800 100644 --- a/src/file.c +++ b/src/file.c @@ -114,5 +114,5 @@ pic_init_file(pic_state *pic) pic_defun(pic, "file-exists?", pic_file_exists_p); pic_defun(pic, "delete-file", pic_file_delete); } - ENDLIBRARY(pic) + ENDLIBRARY(pic); } diff --git a/src/macro.c b/src/macro.c index 156ecaa0..354f059d 100644 --- a/src/macro.c +++ b/src/macro.c @@ -655,5 +655,5 @@ pic_init_macro(pic_state *pic) pic_defun(pic, "identifier?", pic_macro_identifier_p); pic_defun(pic, "identifier=?", pic_macro_identifier_eq_p); } - ENDLIBRARY(pic) + ENDLIBRARY(pic); } diff --git a/src/port.c b/src/port.c index 32b4294d..793ddac1 100644 --- a/src/port.c +++ b/src/port.c @@ -342,5 +342,5 @@ pic_init_port(pic_state *pic) { pic_defun(pic, "write", pic_port_write); } - ENDLIBRARY(pic) + ENDLIBRARY(pic); } diff --git a/src/system.c b/src/system.c index 0e0fbbb1..eb59b8a7 100644 --- a/src/system.c +++ b/src/system.c @@ -130,5 +130,5 @@ pic_init_system(pic_state *pic) pic_defun(pic, "get-environment-variable", pic_system_getenv); pic_defun(pic, "get-environment-variables", pic_system_getenvs); } - ENDLIBRARY(pic) + ENDLIBRARY(pic); } diff --git a/src/time.c b/src/time.c index 9bdd8aa0..5500ebb7 100644 --- a/src/time.c +++ b/src/time.c @@ -43,5 +43,5 @@ pic_init_time(pic_state *pic) pic_defun(pic, "current-jiffy", pic_current_jiffy); pic_defun(pic, "jiffies-per-second", pic_jiffies_per_second); } - ENDLIBRARY(pic) + ENDLIBRARY(pic); }