diff options
Diffstat (limited to 'builtins')
| -rw-r--r-- | builtins/datatypes.h | 4 | ||||
| -rw-r--r-- | builtins/types.h | 2 |
2 files changed, 6 insertions, 0 deletions
diff --git a/builtins/datatypes.h b/builtins/datatypes.h index a9c9ac27..20dede35 100644 --- a/builtins/datatypes.h +++ b/builtins/datatypes.h @@ -30,4 +30,8 @@ typedef struct table_s { void *default_value; } table_t; +typedef struct { + void *fn, *userdata; +} closure_t; + // vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1,\:0 diff --git a/builtins/types.h b/builtins/types.h index 397e14c1..533ffb86 100644 --- a/builtins/types.h +++ b/builtins/types.h @@ -52,6 +52,8 @@ typedef struct TypeInfo { .tag=TableInfo, .TableInfo.key=key_expr, .TableInfo.value=value_expr}) #define $FunctionInfo(typestr) &((TypeInfo){.size=sizeof(void*), .align=__alignof__(void*), \ .tag=FunctionInfo, .FunctionInfo.type_str=typestr}) +#define $ClosureInfo(typestr) &((TypeInfo){.size=2*sizeof(void*), .align=__alignof__(void*), \ + .tag=FunctionInfo, .FunctionInfo.type_str=typestr}) #define $TypeInfoInfo(typestr) &((TypeInfo){.size=sizeof(TypeInfo), .align=__alignof__(TypeInfo), \ .tag=TypeInfoInfo, .TypeInfoInfo.type_str=typestr}) |
