1
0
Fork 0

Types: Add Lth_Vector macro

master
Marrub 2016-10-19 10:00:41 -04:00
parent 22421f7eeb
commit 668f77010f
2 changed files with 7 additions and 1 deletions

View File

@ -30,6 +30,8 @@ Lth_X(SIGUPDATE , update, void, struct Lth_Control *)
#elif !defined(lithos3__Lth_callback_h)
#define lithos3__Lth_callback_h
#include "Lth_types.h"
#define Lth_Callback(name) ((Lth_Callback_t)(name))
#define Lth_Call(name, ...) \
do \
@ -70,7 +72,7 @@ typedef void (*Lth_Callback_t)(void);
typedef struct Lth_CallbackSet
{
#define Lth_X(sig, name, ret, ...) \
struct { Lth_##sig##_t *data; size_t size; } name;
Lth_Vector(Lth_##sig##_t) name;
#include "Lth_callback.h"
} Lth_CallbackSet;

View File

@ -16,6 +16,10 @@
#define Lth_Inherits(name) [[__anonymous]] name _super
#define Lth_Mixin(name) [[__anonymous]] name _##name
#define Lth_Vector(type) struct { type *data; size_t size; }
#define Lth_VectorForEach(tmpv, vec) \
for(tmpv = (vec).data; tmpv != (vec).data + (vec).size; tmpv++)
// Type Definitions ----------------------------------------------------------|