Make Test class static
This commit is contained in:
parent
f222bb92af
commit
e288f4e098
1 changed files with 22 additions and 22 deletions
|
|
@ -7,8 +7,6 @@
|
||||||
static struct Object* static_method(struct Object* self);
|
static struct Object* static_method(struct Object* self);
|
||||||
static struct Object* instance_method(struct Object* self);
|
static struct Object* instance_method(struct Object* self);
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
struct Method Test_meta_methods[] = {
|
struct Method Test_meta_methods[] = {
|
||||||
{ .sel = "staticMethod", .impl = static_method },
|
{ .sel = "staticMethod", .impl = static_method },
|
||||||
};
|
};
|
||||||
|
|
@ -31,6 +29,8 @@ int main()
|
||||||
.methods_count = sizeof(Test_methods) / sizeof(struct Method),
|
.methods_count = sizeof(Test_methods) / sizeof(struct Method),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
msg_send((struct Object*)&Test, "staticMethod");
|
msg_send((struct Object*)&Test, "staticMethod");
|
||||||
|
|
||||||
struct Object* obj = msg_send((struct Object*)&Test, "alloc");
|
struct Object* obj = msg_send((struct Object*)&Test, "alloc");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue