comparison test/callback_suite_aggrs/cases.c @ 523:cd46e111bc4c

- new test/callback_suite_aggrs (currently ahead of checked-in dyncall code and won't compile, though, as with call_suite_aggrs; dc code will be checked in, soon)
author Tassilo Philipp
date Wed, 13 Apr 2022 14:59:57 +0200
parents
children
comparison
equal deleted inserted replaced
522:f7fec6699e21 523:cd46e111bc4c
1 /*
2
3 Package: dyncall
4 Library: test
5 File: test/callback_suite_aggrs/cases.c
6 Description:
7 License:
8
9 Copyright (c) 2022 Tassilo Philipp <tphilipp@potion-studios.com>
10
11 Permission to use, copy, modify, and distribute this software for any
12 purpose with or without fee is hereby granted, provided that the above
13 copyright notice and this permission notice appear in all copies.
14
15 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
16 WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
17 MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
18 ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
19 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
20 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
21 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22
23 */
24
25 #include "globals.h"
26
27 #define write_V_v(X, v) ( v);
28 #define write_V_B(X, v) (V_B[X] = v);
29 #define write_V_c(X, v) (V_c[X] = v);
30 #define write_V_s(X, v) (V_s[X] = v);
31 #define write_V_i(X, v) (V_i[X] = v);
32 #define write_V_j(X, v) (V_j[X] = v);
33 #define write_V_l(X, v) (V_l[X] = v);
34 #define write_V_C(X, v) (V_C[X] = v);
35 #define write_V_S(X, v) (V_S[X] = v);
36 #define write_V_I(X, v) (V_I[X] = v);
37 #define write_V_J(X, v) (V_J[X] = v);
38 #define write_V_L(X, v) (V_L[X] = v);
39 #define write_V_p(X, v) (V_p[X] = v);
40 #define write_V_f(X, v) (V_f[X] = v);
41 #define write_V_d(X, v) (V_d[X] = v);
42 #define write_V_a(X, v, t) (*(t*)V_a[X] = v);
43
44 #define v void
45 #define X(CH,T) typedef T CH;
46 DEF_TYPES
47 #undef X
48
49
50 #define AF(c,t,i,n) dcAggrField(a,c,offsetof(t,i),n);
51 #define AFa(t,i,n,f) dcAggrField(a,DC_SIGCHAR_AGGREGATE,offsetof(t,i),n,f_touch##f());
52
53 #include "dyncall.h"
54 #include <string.h>
55
56
57 /* Plan9 pcc and MSVC (when using C) do not allow empty structs */
58 #if defined(DC__C_MSVC) || defined(DC__OS_Plan9)
59 # include "nonemptyaggrs.h"
60 #else
61 # include "cases.h"
62 #endif
63
64 int G_ncases = sizeof(G_sigtab)/sizeof(G_sigtab[0]);
65 int G_naggs = sizeof(G_agg_sigs)/sizeof(G_agg_sigs[0]);
66