diff options
author | 2025-05-22 23:07:54 +0600 | |
---|---|---|
committer | 2025-05-22 23:41:24 +0600 | |
commit | 7475b4879cdc270c1d7723686ae7e9ad3c0e0736 (patch) | |
tree | 33e8c410ac086aeaac7fd00a0b32b23ae6e287a8 /src/cobj.h | |
parent | 29b8e5efb43bdb71737f1b417fedb3b1558bb9af (diff) | |
download | c-obp-example-7475b4879cdc270c1d7723686ae7e9ad3c0e0736.tar.gz c-obp-example-7475b4879cdc270c1d7723686ae7e9ad3c0e0736.zip |
Signed-off-by: Mubashshir <ahmubashshir@gmail.com>
Diffstat (limited to 'src/cobj.h')
-rw-r--r-- | src/cobj.h | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -6,7 +6,6 @@ # undef DefaultDelete # undef Define # undef Del -# undef DelF # undef Func # undef GET # undef Get @@ -71,10 +70,12 @@ # define New(klass, body, ...) \ klass klass ## _new(__VA_ARGS__) { \ klass self = (klass)malloc(sizeof(TYPE(klass))); \ - if(self != NULL) body; \ + if(self != NULL) { \ + self->destroy = (& klass ## _delete); \ + body; \ + } \ return self; \ } - # define Del(klass, body, ...) \ void klass ## _delete(klass self, ## __VA_ARGS__) \ body @@ -85,8 +86,6 @@ # define Func(klass, name) \ (self->name) = (& klass ## _ ## name) -# define DelF(klass) \ - (self->destroy) = (&klass ## _delete) # define Self(name) \ self->_property_ ## name |