Change soft-fail to use the config, rather than env
[rbx.git] / shotgun / lib / metaclass.c
blob339e4c4db465e5aabd04073510d544a16ba3507a
1 #include "shotgun/lib/shotgun.h"
2 #include "shotgun/lib/module.h"
4 OBJECT metaclass_s_attach(STATE, OBJECT obj) {
5 OBJECT meta;
6 meta = metaclass_allocate(state);
7 meta->IsMeta = TRUE;
8 metaclass_set_attached_instance(meta, obj);
9 if(RTEST(state->global->hash) || RTEST(state->global->methtbl)) {
10 module_setup_fields(state, meta);
12 SET_CLASS(obj, meta);
13 return meta;
16 int metaclass_s_metaclass_p(STATE, OBJECT obj) {
17 return obj->IsMeta;