10 return ((int(*)())(intptr_t)0)();
17 /**************************************************************************/
18 /**************************************************************************/
20 /**************************************************************************/
21 /**************************************************************************/
22 #if defined(BUG1) /* incomplete exports: afbBindingV2data miss */
24 #define AFB_BINDING_VERSION 0
25 #include <afb/afb-binding.h>
26 const struct afb_binding_v2 afbBindingV2;
29 /**************************************************************************/
30 #if defined(BUG2) /* incomplete exports: afbBindingV2 miss */
32 #define AFB_BINDING_VERSION 0
33 #include <afb/afb-binding.h>
34 struct afb_binding_data_v2 afbBindingV2data;
37 /**************************************************************************/
38 #if defined(BUG3) /* zero filled structure */
40 #define AFB_BINDING_VERSION 0
41 #include <afb/afb-binding.h>
42 const struct afb_binding_v2 afbBindingV2;
43 struct afb_binding_data_v2 afbBindingV2data;
46 /**************************************************************************/
47 #if defined(BUG4) /* no verb definition */
49 #define AFB_BINDING_VERSION 2
50 #include <afb/afb-binding.h>
52 const struct afb_binding_v2 afbBindingV2 = {
58 /**************************************************************************/
59 #if defined(BUG5) /* preinit buggy */
61 #define AFB_BINDING_VERSION 2
62 #include <afb/afb-binding.h>
64 struct afb_verb_v2 verbs[] = {
67 const struct afb_binding_v2 afbBindingV2 = {
70 .preinit = (void*)bug,
74 /**************************************************************************/
75 #if defined(BUG6) /* buggy init */
77 #define AFB_BINDING_VERSION 2
78 #include <afb/afb-binding.h>
80 struct afb_verb_v2 verbs[] = {
83 const struct afb_binding_v2 afbBindingV2 = {
90 /**************************************************************************/
91 #if defined(BUG7) /* error in preinit */
93 #define AFB_BINDING_VERSION 2
94 #include <afb/afb-binding.h>
96 struct afb_verb_v2 verbs[] = {
99 const struct afb_binding_v2 afbBindingV2 = {
102 .preinit = (void*)err,
106 /**************************************************************************/
107 #if defined(BUG8) /* error in init */
109 #define AFB_BINDING_VERSION 2
110 #include <afb/afb-binding.h>
112 struct afb_verb_v2 verbs[] = {
115 const struct afb_binding_v2 afbBindingV2 = {
118 .preinit = (void*)ok,
122 /**************************************************************************/
123 #if defined(BUG9) /* no api name */
125 #define AFB_BINDING_VERSION 2
126 #include <afb/afb-binding.h>
128 struct afb_verb_v2 verbs[] = {
131 const struct afb_binding_v2 afbBindingV2 = {
133 .preinit = (void*)ok,
137 /**************************************************************************/
138 #if defined(BUG10) /* bad api name */
140 #define AFB_BINDING_VERSION 2
141 #include <afb/afb-binding.h>
143 struct afb_verb_v2 verbs[] = {
146 const struct afb_binding_v2 afbBindingV2 = {
149 .preinit = (void*)ok,
153 /**************************************************************************/
154 /**************************************************************************/
155 /*** BINDINGS V3 ***/
156 /**************************************************************************/
157 /**************************************************************************/
158 #if defined(BUG11) /* make a SEGV */
160 #define AFB_BINDING_VERSION 3
161 #include <afb/afb-binding.h>
162 int afbBindingEntry(afb_api_t api)
164 return ((int(*)())(intptr_t)0)();
167 /**************************************************************************/
168 #if defined(BUG12) /* no afbBindingV3 nor afbBindingV3entry */
170 #define AFB_BINDING_VERSION 0
171 #include <afb/afb-binding.h>
172 struct afb_api_x3 *afbBindingV3root;
175 /**************************************************************************/
176 #if defined(BUG13) /* no afbBindingV3root nor afbBindingV3entry */
178 #define AFB_BINDING_VERSION 0
179 #include <afb/afb-binding.h>
180 const struct afb_binding_v3 afbBindingV3;
181 int afbBindingV3entry(struct afb_api_x3 *rootapi) { return 0; }
184 /**************************************************************************/
185 #if defined(BUG14) /* no api name */
187 #define AFB_BINDING_VERSION 3
188 #include <afb/afb-binding.h>
190 const struct afb_binding_v3 afbBindingV3;
193 /**************************************************************************/
194 #if defined(BUG15) /* bad api name */
196 #define AFB_BINDING_VERSION 3
197 #include <afb/afb-binding.h>
199 const struct afb_binding_v3 afbBindingV3 = {
204 /**************************************************************************/
205 #if defined(BUG16) /* both entry and preinit */
207 #define AFB_BINDING_VERSION 3
208 #include <afb/afb-binding.h>
210 int afbBindingV3entry(struct afb_api_x3 *rootapi) { return 0; }
211 const struct afb_binding_v3 afbBindingV3 = {
213 .preinit = afbBindingV3entry
217 /**************************************************************************/
218 #if defined(BUG17) /* entry fails */
220 #define AFB_BINDING_VERSION 3
221 #include <afb/afb-binding.h>
223 int afbBindingV3entry(struct afb_api_x3 *rootapi) { errno = EAGAIN; return -1; }
225 /**************************************************************************/
226 #if defined(BUG18) /* preinit fails */
228 #define AFB_BINDING_VERSION 3
229 #include <afb/afb-binding.h>
231 const struct afb_binding_v3 afbBindingV3 = {
233 .preinit = (void*)err
237 /**************************************************************************/
238 #if defined(BUG19) /* preinit SEGV */
240 #define AFB_BINDING_VERSION 3
241 #include <afb/afb-binding.h>
243 const struct afb_binding_v3 afbBindingV3 = {
245 .preinit = (void*)bug
249 /**************************************************************************/
250 #if defined(BUG20) /* init fails */
252 #define AFB_BINDING_VERSION 3
253 #include <afb/afb-binding.h>
255 const struct afb_binding_v3 afbBindingV3 = {
261 /**************************************************************************/
262 #if defined(BUG21) /* init SEGV */
264 #define AFB_BINDING_VERSION 3
265 #include <afb/afb-binding.h>
267 const struct afb_binding_v3 afbBindingV3 = {
270 .provide_class = "a b c",
271 .require_class = "x y z",
272 .require_api = "bug4 bug5",
276 /**************************************************************************/