#ifndef _SHAPE_H_ #define _SHAPE_H_ #include "common.h" #define VIRTUAL #define PRIVATE static #define ASSERT_CALL_VIRTUAL_METHOD() assert(!("can't call abstract method")) struct _virtual_table { VIRTUAL double (*area)(void *self); VIRTUAL void (*draw)(void *self); }; struct _shape { struct _shape *me; struct _virtual_table vtb; }; struct _shape *shape_new(void); double shape_area(void *self); void shape_draw(void *self); #endif