mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-16 09:17:35 +02:00
Added Cyc_check_argc macro to help w/new functions
This commit is contained in:
parent
2afd1b48b7
commit
23249133af
1 changed files with 9 additions and 0 deletions
|
@ -76,6 +76,15 @@ void gc_init_heap(long heap_size);
|
||||||
} \
|
} \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define Cyc_check_argc(data, fnc_name, argc, expected) { \
|
||||||
|
if (expected > argc) { \
|
||||||
|
char buf[128]; \
|
||||||
|
snprintf(buf, 127, "Expected %d arguments to %s but received %ld", \
|
||||||
|
expected, fnc_name, argc); \
|
||||||
|
Cyc_rt_raise_msg(data, buf); \
|
||||||
|
} \
|
||||||
|
}
|
||||||
|
|
||||||
#define Cyc_verify_mutable(data, obj) { \
|
#define Cyc_verify_mutable(data, obj) { \
|
||||||
if (immutable(obj)) Cyc_immutable_obj_error(data, obj); }
|
if (immutable(obj)) Cyc_immutable_obj_error(data, obj); }
|
||||||
#define Cyc_verify_immutable(data, obj) { \
|
#define Cyc_verify_immutable(data, obj) { \
|
||||||
|
|
Loading…
Add table
Reference in a new issue