-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added: structarr.h -> Multi List Array.
- Loading branch information
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#ifndef ZAKAROUF__Z__STRUCTARR_H | ||
#define ZAKAROUF__Z__STRUCTARR_H | ||
|
||
#include "prep/args.h" | ||
#include "prep/map.h" | ||
#include "std/primitives.h" | ||
|
||
#define z__PRIV__Srr_apply_fields(x) zpp__PRIV__Args_get_1 x * zpp__PRIV__Args_get_2 x; | ||
#define z__Srr(...)\ | ||
struct { \ | ||
union { \ | ||
void *_raw[zpp__Args_Count(__VA_ARGS__)]; \ | ||
struct { \ | ||
zpp__Args_map( \ | ||
z__PRIV__Srr_apply_fields \ | ||
, __VA_ARGS__); \ | ||
}; \ | ||
}; \ | ||
z__size len; \ | ||
z__size lenUsed; \ | ||
} | ||
|
||
#define z__Srr_r(...)\ | ||
struct { \ | ||
union { \ | ||
void *_raw[zpp__Args_Count(__VA_ARGS__)]; \ | ||
struct { \ | ||
__VA_ARGS__; \ | ||
}; \ | ||
}; \ | ||
z__size len; \ | ||
z__size lenUsed; \ | ||
} | ||
|
||
#endif |