Add new macros _DEF_AS so that
user can define its own name for the generated types.
This commit is contained in:
1 parent
63eee6bba3
commit
e04b120d41
4 files changed
+80
-6
No files matched your search
@@ -38,6 +38,9 @@ ARRAY_DEF(array_min3_z, testobj_t, (CLEAR(testobj_clear)))
|
||||
|
||||
ARRAY_DEF(array_ulong, uint64_t)
|
||||
|
||||
ARRAY_DEF_AS(array_double, ArrayDouble, ArrayDoubleIt, double)
|
||||
#define M_OPL_ArrayDouble() ARRAY_OPLIST(array_double, M_DEFAULT_OPLIST)
|
||||
|
||||
static void test_uint(void)
|
||||
{
|
||||
array_uint_t v;
|
||||
@@ -350,10 +353,22 @@ static void test_d(void)
|
||||
array_uint_clear(a2);
|
||||
}
|
||||
|
||||
static void test_double(void)
|
||||
{
|
||||
M_LET( (tab, 0.0, 1.0, 2.0, 3.0), ArrayDouble) {
|
||||
double ref = 0.0;
|
||||
for M_EACH(i, tab, ArrayDouble) {
|
||||
assert (*i == ref);
|
||||
ref += 1.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
test_uint();
|
||||
test_mpz();
|
||||
test_d();
|
||||
test_double();
|
||||
exit(0);
|
||||
}
|
||||
Reference in new issue
Block a user