mirror of
https://github.com/CPunch/Cosmo.git
synced 2025-09-29 14:50:05 +00:00
added support for NaN boxing (8 byte CValues!)
This commit is contained in:
12
src/cobj.h
12
src/cobj.h
@@ -90,12 +90,12 @@ typedef struct CObjUpval {
|
||||
#define IS_METHOD(x) isObjType(x, COBJ_METHOD)
|
||||
#define IS_CLOSURE(x) isObjType(x, COBJ_CLOSURE)
|
||||
|
||||
#define cosmoV_readString(x) ((CObjString*)cosmoV_readObj((x)))
|
||||
#define cosmoV_readObject(x) ((CObjObject*)cosmoV_readObj((x)))
|
||||
#define cosmoV_readFunction(x) ((CObjFunction*)cosmoV_readObj((x)))
|
||||
#define cosmoV_readCFunction(x) (((CObjCFunction*)cosmoV_readObj((x)))->cfunc)
|
||||
#define cosmoV_readMethod(x) ((CObjMethod*)cosmoV_readObj((x)))
|
||||
#define cosmoV_readClosure(x) ((CObjClosure*)cosmoV_readObj((x)))
|
||||
#define cosmoV_readString(x) ((CObjString*)cosmoV_readObj(x))
|
||||
#define cosmoV_readObject(x) ((CObjObject*)cosmoV_readObj(x))
|
||||
#define cosmoV_readFunction(x) ((CObjFunction*)cosmoV_readObj(x))
|
||||
#define cosmoV_readCFunction(x) (((CObjCFunction*)cosmoV_readObj(x))->cfunc)
|
||||
#define cosmoV_readMethod(x) ((CObjMethod*)cosmoV_readObj(x))
|
||||
#define cosmoV_readClosure(x) ((CObjClosure*)cosmoV_readObj(x))
|
||||
|
||||
static inline bool isObjType(CValue val, CObjType type) {
|
||||
return IS_OBJ(val) && cosmoV_readObj(val)->type == type;
|
||||
|
Reference in New Issue
Block a user