remove of _class parameter

This commit is contained in:
overflowerror 2017-03-10 23:30:48 +01:00
parent 1d47d2e809
commit f0a9810fc1
5 changed files with 6 additions and 12 deletions

View file

@ -5,9 +5,7 @@
#define test construct(test)
class_t test_class;
class(test, test_class, object_class, true) {
class(test, object_class, true) {
extends(object_t);
const char* string;

View file

@ -70,6 +70,7 @@ class_t oop_get_class_from_obj(object_t* obj) {
}
// defined by class macro in h-file
class_t object_class;
void method(object, destruct)(object_t* obj) {

View file

@ -6,7 +6,7 @@
#include <stdio.h>
#define class(name, type, superclass, instanceable) __attribute__ ((constructor)) static void add_##name##_class(void) { type.id = oop_add_class(#name, superclass, instanceable);} typedef struct name
#define class(name, superclass, instanceable) class_t name##_class; __attribute__ ((constructor)) static void add_##name##_class(void) { name##_class.id = oop_add_class(#name, superclass, instanceable);} typedef struct name
#define method(class, method) class ##_method_## method
#define add_method(object, class, method) object->method = class ##_method_## method
@ -44,9 +44,8 @@ typedef struct meta_object {
class_id_t oop_add_class(const char*, class_t, bool);
#define object construct(object)
extern class_t object_class;
class(object, object_class, NO_SUPER_CLASS, true) {
extern class(object, NO_SUPER_CLASS, true) {
meta_object_t meta_obj;
void (*destruct)(defclass object*);
} object_t;

View file

@ -5,10 +5,7 @@
#include "../oop/oop.h"
#define strbuilder construct(strbuilder)
extern class_t strbuilder_class;
class(strbuilder, strbuilder_class, object_class, true) {
extern class(strbuilder, object_class, true) {
extends(object_t);
char* string;

View file

@ -4,8 +4,7 @@
#include "../../oop/oop.h"
#define exception construct(exception)
class_t exception_class;
class(exception, exception_class, object_class, true) {
class(exception, object_class, true) {
extends(object_t);
const char* msg;