summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelipe Magno de Almeida <felipe@expertise.dev>2020-12-04 10:27:52 -0300
committerFelipe Magno de Almeida <felipe@expertise.dev>2020-12-04 10:35:35 -0300
commit8d18009419d5ea09f15d9fa27499fcf36123c057 (patch)
tree021e0cd02b472588d7323e213f03941c28ad3068
parent650578b57368babc6600d65549b62dae9b9e6423 (diff)
eolian: Add -e parameter to pass export symbol to eolian generator
Summary: Eolian generator must have a parameter so it can generate the correct symbol export/import macro for the API generated. This makes it possible to define the symbols as being local to a single DSO without the need to guard the generated headers or generated source files with #define and #undef preprocessor statements. = The Rationale = This patch is from a series of patches to rename EAPI symbols to specific library DSOs. EAPI was designed to be able to pass `__attribute__ ((visibility ("default")))` for symbols with GCC, which would mean that even if -fvisibility=hidden was used when compiling the library, the needed symbols would get exported. MSVC __almost__ works like GCC (or mingw) in which you can declare everything as export and it will just work (slower, but it will work). But there's a caveat: global variables will not work the same way for MSVC, but works for mingw and GCC. For global variables (as opposed to functions), MSVC requires correct DSO visibility for MSVC: instead of declaring a symbol as export for everything, you need to declare it as import when importing from another DSO and export when defining it locally. With current EAPI definitions, we get the following example working in mingw and MSVC (observe it doesn't define any global variables as exported symbols). Example 1: dll1: ``` EAPI void foo(void); EAPI void bar() { foo(); } ``` dll2: ``` EAPI void foo() { printf ("foo\n"); } ``` This works fine with API defined as __declspec(dllexport) in both cases and for gcc defining as `__atttribute__((visibility("default")))`. However, the following: Example 2: dll1: ``` EAPI extern int foo; EAPI void foobar(void); EAPI void bar() { foo = 5; foobar(); } ``` dll2: ``` EAPI int foo = 0; EAPI void foobar() { printf ("foo %d\n", foo); } ``` This will work on mingw but will not work for MSVC. And that's why LIBAPI is the only solution that works for MSVC. Co-authored-by: João Paulo Taylor Ienczak Zanette <jpaulotiz@gmail.com> Co-authored-by: Lucas Cavalcante de Sousa <lucks.sousa@gmail.com> Co-authored-by: Ricardo Campos <ricardo.campos@expertise.dev> Reviewers: q66, vtorri, woohyun, jptiz, lucas Reviewed By: vtorri, lucas Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D12197
-rw-r--r--src/bin/eolian/headers.c12
-rw-r--r--src/bin/eolian/main.c11
-rw-r--r--src/bin/eolian/sources.c10
-rw-r--r--src/bin/eolian/types.c8
-rw-r--r--src/tests/eolian/data/class_simple_ref.c6
-rw-r--r--src/tests/eolian/data/class_simple_ref_eo.h8
-rw-r--r--src/tests/eolian/data/docs_ref.h14
-rw-r--r--src/tests/eolian/data/function_as_argument_ref.c4
-rw-r--r--src/tests/eolian/data/function_as_argument_ref.h6
-rw-r--r--src/tests/eolian/data/override_ref.c16
-rw-r--r--src/tests/eolian/data/owning_ref.c4
-rw-r--r--src/tests/eolian/data/struct_ref.h6
-rw-r--r--src/tests/eolian/data/typedef_ref.h4
-rw-r--r--src/tests/eolian/eolian_generated_future.c3
-rw-r--r--src/tests/eolian/meson.build3
15 files changed, 70 insertions, 45 deletions
diff --git a/src/bin/eolian/headers.c b/src/bin/eolian/headers.c
index 6292fb4259..ebca0c9b75 100644
--- a/src/bin/eolian/headers.c
+++ b/src/bin/eolian/headers.c
@@ -1,6 +1,8 @@
1#include "main.h" 1#include "main.h"
2#include "docs.h" 2#include "docs.h"
3 3
4extern char* _eolian_api_symbol;
5
4static const char * 6static const char *
5_get_add_star(Eolian_Function_Type ftype, Eolian_Parameter_Direction pdir) 7_get_add_star(Eolian_Function_Type ftype, Eolian_Parameter_Direction pdir)
6{ 8{
@@ -118,7 +120,7 @@ _gen_func(const Eolian_State *state, const Eolian_Function *fid,
118 eina_strbuf_append_char(buf, '\n'); 120 eina_strbuf_append_char(buf, '\n');
119 eina_strbuf_free(dbuf); 121 eina_strbuf_free(dbuf);
120 } 122 }
121 eina_strbuf_append(buf, "EOAPI "); 123 eina_strbuf_append_printf(buf, "%s %s_WEAK ", _eolian_api_symbol, _eolian_api_symbol);
122 if (rtp) 124 if (rtp)
123 { 125 {
124 if (!rtps) 126 if (!rtps)
@@ -225,7 +227,8 @@ eo_gen_header_gen(const Eolian_State *state, const Eolian_Class *cl,
225 eina_strbuf_append_printf(buf, "#define %s %s()\n\n", mname, gname); 227 eina_strbuf_append_printf(buf, "#define %s %s()\n\n", mname, gname);
226 eina_stringshare_del(mname); 228 eina_stringshare_del(mname);
227 229
228 eina_strbuf_append_printf(buf, "EWAPI const Efl_Class *%s(void) EINA_CONST;\n", gname); 230 eina_strbuf_append_printf(buf, "%s %s_WEAK const Efl_Class *%s(void) EINA_CONST;\n",
231 _eolian_api_symbol, _eolian_api_symbol, gname);
229 eina_stringshare_del(gname); 232 eina_stringshare_del(gname);
230 233
231 /* method section */ 234 /* method section */
@@ -283,8 +286,9 @@ events:
283 if (!eolian_event_is_beta(ev) && evs == EOLIAN_SCOPE_PUBLIC) 286 if (!eolian_event_is_beta(ev) && evs == EOLIAN_SCOPE_PUBLIC)
284 eina_strbuf_append_char(buf, '\n'); 287 eina_strbuf_append_char(buf, '\n');
285 288
286 eina_strbuf_append_printf(buf, "EWAPI extern const " 289 eina_strbuf_append_printf(buf, "%s %s_WEAK extern const "
287 "Efl_Event_Description _%s;\n\n", evn); 290 "Efl_Event_Description _%s;\n\n",
291 _eolian_api_symbol, _eolian_api_symbol, evn);
288 292
289 Eina_Strbuf *evdbuf = eo_gen_docs_event_gen(state, ev, 293 Eina_Strbuf *evdbuf = eo_gen_docs_event_gen(state, ev,
290 eolian_class_c_name_get(cl)); 294 eolian_class_c_name_get(cl));
diff --git a/src/bin/eolian/main.c b/src/bin/eolian/main.c
index 8e965e25b2..b2167ef62d 100644
--- a/src/bin/eolian/main.c
+++ b/src/bin/eolian/main.c
@@ -7,6 +7,7 @@
7#include "sources.h" 7#include "sources.h"
8 8
9int _eolian_gen_log_dom = -1; 9int _eolian_gen_log_dom = -1;
10char* _eolian_api_symbol;
10 11
11enum 12enum
12{ 13{
@@ -44,6 +45,7 @@ _print_usage(const char *progn, FILE *outf)
44 " -o type:name specify a particular output filename\n" 45 " -o type:name specify a particular output filename\n"
45 " -h print this message and exit\n" 46 " -h print this message and exit\n"
46 " -v print version and exit\n" 47 " -v print version and exit\n"
48 " -e api symbol string to be used for import/export symbol"
47 "\n" 49 "\n"
48 "Available types:\n" 50 "Available types:\n"
49 " h: C header file (.eo.h/.eot.h)\n" 51 " h: C header file (.eo.h/.eot.h)\n"
@@ -494,6 +496,7 @@ main(int argc, char **argv)
494 NULL, NULL, NULL, NULL, NULL, NULL 496 NULL, NULL, NULL, NULL, NULL, NULL
495 }; 497 };
496 char *basen = NULL; 498 char *basen = NULL;
499 _eolian_api_symbol = strdup("EAPI");
497 Eina_List *includes = NULL; 500 Eina_List *includes = NULL;
498 501
499 eina_init(); 502 eina_init();
@@ -514,7 +517,7 @@ main(int argc, char **argv)
514 int gen_what = 0; 517 int gen_what = 0;
515 Eina_Bool scan_system = EINA_TRUE; 518 Eina_Bool scan_system = EINA_TRUE;
516 519
517 for (int opt; (opt = getopt(argc, argv, "SI:g:o:hv")) != -1;) 520 for (int opt; (opt = getopt(argc, argv, "SI:g:o:hve:")) != -1;)
518 switch (opt) 521 switch (opt)
519 { 522 {
520 case 0: 523 case 0:
@@ -526,6 +529,10 @@ main(int argc, char **argv)
526 /* just a pointer to argv contents, so it persists */ 529 /* just a pointer to argv contents, so it persists */
527 includes = eina_list_append(includes, optarg); 530 includes = eina_list_append(includes, optarg);
528 break; 531 break;
532 case 'e':
533 free(_eolian_api_symbol);
534 _eolian_api_symbol = strdup(optarg);
535 break;
529 case 'g': 536 case 'g':
530 for (const char *wstr = optarg; *wstr; ++wstr) 537 for (const char *wstr = optarg; *wstr; ++wstr)
531 switch (*wstr) 538 switch (*wstr)
@@ -665,6 +672,8 @@ end:
665 free(outs[i]); 672 free(outs[i]);
666 free(basen); 673 free(basen);
667 674
675 free(_eolian_api_symbol);
676
668 eolian_state_free(eos); 677 eolian_state_free(eos);
669 eolian_shutdown(); 678 eolian_shutdown();
670 eina_shutdown(); 679 eina_shutdown();
diff --git a/src/bin/eolian/sources.c b/src/bin/eolian/sources.c
index e5e8eb7a8b..543d7c8f51 100644
--- a/src/bin/eolian/sources.c
+++ b/src/bin/eolian/sources.c
@@ -7,6 +7,7 @@
7 */ 7 */
8static Eina_Hash *_funcs_params_init_get = NULL; 8static Eina_Hash *_funcs_params_init_get = NULL;
9static Eina_Hash *_funcs_params_init_set = NULL; 9static Eina_Hash *_funcs_params_init_set = NULL;
10extern char* _eolian_api_symbol;
10 11
11static const char * 12static const char *
12_get_add_star(Eolian_Function_Type ftype, Eolian_Parameter_Direction pdir) 13_get_add_star(Eolian_Function_Type ftype, Eolian_Parameter_Direction pdir)
@@ -475,7 +476,8 @@ static void
475_emit_class_function(Eina_Strbuf *buf, const Eolian_Function *fid, const Eolian_Function_Type ftype, const Eolian_Type *rtp, const char *rtpn, Eina_Strbuf *params_full, 476_emit_class_function(Eina_Strbuf *buf, const Eolian_Function *fid, const Eolian_Function_Type ftype, const Eolian_Type *rtp, const char *rtpn, Eina_Strbuf *params_full,
476 const char *ocnamel, const char *func_suffix, Eina_Strbuf *params, const char *function_name) 477 const char *ocnamel, const char *func_suffix, Eina_Strbuf *params, const char *function_name)
477{ 478{
478 eina_strbuf_append(buf, "EOAPI "); 479 eina_strbuf_append_printf(buf, "%s %s_WEAK", _eolian_api_symbol, _eolian_api_symbol);
480 eina_strbuf_append(buf, " ");
479 eina_strbuf_append(buf, rtpn); 481 eina_strbuf_append(buf, rtpn);
480 eina_strbuf_append(buf, " "); 482 eina_strbuf_append(buf, " ");
481 eina_strbuf_append(buf, function_name); 483 eina_strbuf_append(buf, function_name);
@@ -894,7 +896,8 @@ _gen_func(const Eolian_Class *cl, const Eolian_Function *fid,
894 eina_strbuf_append_printf(buf, "}\n\n"); 896 eina_strbuf_append_printf(buf, "}\n\n");
895 } 897 }
896 898
897 eina_strbuf_append(buf, "EOAPI EFL_"); 899 eina_strbuf_append_printf(buf, "%s %s_WEAK", _eolian_api_symbol, _eolian_api_symbol);
900 eina_strbuf_append(buf, " EFL_");
898 if (!strcmp(rtpn, "void")) 901 if (!strcmp(rtpn, "void"))
899 eina_strbuf_append(buf, "VOID_"); 902 eina_strbuf_append(buf, "VOID_");
900 eina_strbuf_append(buf, "FUNC_BODY"); 903 eina_strbuf_append(buf, "FUNC_BODY");
@@ -1125,7 +1128,8 @@ eo_gen_source_gen(const Eolian_Class *cl, Eina_Strbuf *buf)
1125 EINA_ITERATOR_FOREACH(itr, ev) 1128 EINA_ITERATOR_FOREACH(itr, ev)
1126 { 1129 {
1127 Eina_Stringshare *evn = eolian_event_c_macro_get(ev); 1130 Eina_Stringshare *evn = eolian_event_c_macro_get(ev);
1128 eina_strbuf_append(buf, "EWAPI const Efl_Event_Description _"); 1131 eina_strbuf_append_printf(buf, "%s %s_WEAK", _eolian_api_symbol, _eolian_api_symbol);
1132 eina_strbuf_append(buf, " const Efl_Event_Description _");
1129 eina_strbuf_append(buf, evn); 1133 eina_strbuf_append(buf, evn);
1130 eina_strbuf_append(buf, " =\n EFL_EVENT_DESCRIPTION"); 1134 eina_strbuf_append(buf, " =\n EFL_EVENT_DESCRIPTION");
1131 if (eolian_event_is_hot(ev)) 1135 if (eolian_event_is_hot(ev))
diff --git a/src/bin/eolian/types.c b/src/bin/eolian/types.c
index 9b44279d98..897da96e36 100644
--- a/src/bin/eolian/types.c
+++ b/src/bin/eolian/types.c
@@ -4,6 +4,8 @@
4#include "headers.h" 4#include "headers.h"
5#include "docs.h" 5#include "docs.h"
6 6
7extern char* _eolian_api_symbol;
8
7static Eina_Strbuf * 9static Eina_Strbuf *
8_type_generate(const Eolian_State *state, const Eolian_Typedecl *tp, 10_type_generate(const Eolian_State *state, const Eolian_Typedecl *tp,
9 Eina_Bool full) 11 Eina_Bool full)
@@ -226,7 +228,8 @@ _err_generate(const Eolian_State *state, const Eolian_Error *err)
226 if (!buf) buf = eina_strbuf_new(); 228 if (!buf) buf = eina_strbuf_new();
227 else eina_strbuf_append_char(buf, '\n'); 229 else eina_strbuf_append_char(buf, '\n');
228 230
229 eina_strbuf_prepend_printf(buf, "EWAPI Eina_Error %s_get(void);\n\n", fn); 231 eina_strbuf_prepend_printf(buf, "%s %s_WEAK Eina_Error %s_get(void);\n\n",
232 _eolian_api_symbol, _eolian_api_symbol, fn);
230 233
231 char *ufn = strdup(fn); 234 char *ufn = strdup(fn);
232 eina_str_toupper(&ufn); 235 eina_str_toupper(&ufn);
@@ -324,7 +327,8 @@ _source_gen_error(Eina_Strbuf *buf, const Eolian_Error *err)
324 *p = '_'; 327 *p = '_';
325 eina_str_tolower(&fn); 328 eina_str_tolower(&fn);
326 329
327 eina_strbuf_append_printf(buf, "EWAPI Eina_Error %s_get(void)\n{\n", fn); 330 eina_strbuf_append_printf(buf, "%s %s_WEAK Eina_Error %s_get(void)\n{\n",
331 _eolian_api_symbol, _eolian_api_symbol, fn);
328 free(fn); 332 free(fn);
329 333
330 const char *msg = eolian_error_message_get(err); 334 const char *msg = eolian_error_message_get(err);
diff --git a/src/tests/eolian/data/class_simple_ref.c b/src/tests/eolian/data/class_simple_ref.c
index d11055ae5e..d80b0e3b38 100644
--- a/src/tests/eolian/data/class_simple_ref.c
+++ b/src/tests/eolian/data/class_simple_ref.c
@@ -17,7 +17,7 @@ __eolian_class_simple_a_set_reflect(Eo *obj, Eina_Value val)
17 return r; 17 return r;
18} 18}
19 19
20EOAPI EFL_FUNC_BODYV(efl_canvas_object_simple_a_set, Eina_Bool, EINA_TRUE /* true */, EFL_FUNC_CALL(value), int value); 20EAPI EAPI_WEAK EFL_FUNC_BODYV(efl_canvas_object_simple_a_set, Eina_Bool, EINA_TRUE /* true */, EFL_FUNC_CALL(value), int value);
21 21
22int _class_simple_a_get(const Eo *obj, Evas_Simple_Data *pd); 22int _class_simple_a_get(const Eo *obj, Evas_Simple_Data *pd);
23 23
@@ -29,7 +29,7 @@ __eolian_class_simple_a_get_reflect(const Eo *obj)
29 return eina_value_int_init(val); 29 return eina_value_int_init(val);
30} 30}
31 31
32EOAPI EFL_FUNC_BODY_CONST(efl_canvas_object_simple_a_get, int, 100); 32EAPI EAPI_WEAK EFL_FUNC_BODY_CONST(efl_canvas_object_simple_a_get, int, 100);
33 33
34char *_class_simple_foo(Eo *obj, Evas_Simple_Data *pd, int a, char *b, double *c, int *d); 34char *_class_simple_foo(Eo *obj, Evas_Simple_Data *pd, int a, char *b, double *c, int *d);
35 35
@@ -39,7 +39,7 @@ static char *__eolian_class_simple_foo(Eo *obj, Evas_Simple_Data *pd, int a, cha
39 return _class_simple_foo(obj, pd, a, b, c, d); 39 return _class_simple_foo(obj, pd, a, b, c, d);
40} 40}
41 41
42EOAPI EFL_FUNC_BODYV(efl_canvas_object_simple_foo, char *, NULL /* null */, EFL_FUNC_CALL(a, b, c, d), int a, char *b, double *c, int *d); 42EAPI EAPI_WEAK EFL_FUNC_BODYV(efl_canvas_object_simple_foo, char *, NULL /* null */, EFL_FUNC_CALL(a, b, c, d), int a, char *b, double *c, int *d);
43 43
44static Eina_Bool 44static Eina_Bool
45_class_simple_class_initializer(Efl_Class *klass) 45_class_simple_class_initializer(Efl_Class *klass)
diff --git a/src/tests/eolian/data/class_simple_ref_eo.h b/src/tests/eolian/data/class_simple_ref_eo.h
index b9c49e9561..56142c569b 100644
--- a/src/tests/eolian/data/class_simple_ref_eo.h
+++ b/src/tests/eolian/data/class_simple_ref_eo.h
@@ -31,7 +31,7 @@ typedef Eo Class_Simple;
31 */ 31 */
32#define CLASS_SIMPLE_CLASS class_simple_class_get() 32#define CLASS_SIMPLE_CLASS class_simple_class_get()
33 33
34EWAPI const Efl_Class *class_simple_class_get(void) EINA_CONST; 34EAPI EAPI_WEAK const Efl_Class *class_simple_class_get(void) EINA_CONST;
35 35
36#ifdef EFL_BETA_API_SUPPORT 36#ifdef EFL_BETA_API_SUPPORT
37/** 37/**
@@ -48,7 +48,7 @@ EWAPI const Efl_Class *class_simple_class_get(void) EINA_CONST;
48 * 48 *
49 * @ingroup Class_Simple 49 * @ingroup Class_Simple
50 */ 50 */
51EOAPI Eina_Bool efl_canvas_object_simple_a_set(Eo *obj, int value); 51EAPI EAPI_WEAK Eina_Bool efl_canvas_object_simple_a_set(Eo *obj, int value);
52#endif /* EFL_BETA_API_SUPPORT */ 52#endif /* EFL_BETA_API_SUPPORT */
53 53
54#ifdef EFL_BETA_API_SUPPORT 54#ifdef EFL_BETA_API_SUPPORT
@@ -63,7 +63,7 @@ EOAPI Eina_Bool efl_canvas_object_simple_a_set(Eo *obj, int value);
63 * 63 *
64 * @ingroup Class_Simple 64 * @ingroup Class_Simple
65 */ 65 */
66EOAPI int efl_canvas_object_simple_a_get(const Eo *obj); 66EAPI EAPI_WEAK int efl_canvas_object_simple_a_get(const Eo *obj);
67#endif /* EFL_BETA_API_SUPPORT */ 67#endif /* EFL_BETA_API_SUPPORT */
68 68
69#ifdef EFL_BETA_API_SUPPORT 69#ifdef EFL_BETA_API_SUPPORT
@@ -82,7 +82,7 @@ EOAPI int efl_canvas_object_simple_a_get(const Eo *obj);
82 * 82 *
83 * @ingroup Class_Simple 83 * @ingroup Class_Simple
84 */ 84 */
85EOAPI char *efl_canvas_object_simple_foo(Eo *obj, int a, char *b, double *c, int *d); 85EAPI EAPI_WEAK char *efl_canvas_object_simple_foo(Eo *obj, int a, char *b, double *c, int *d);
86#endif /* EFL_BETA_API_SUPPORT */ 86#endif /* EFL_BETA_API_SUPPORT */
87 87
88#endif 88#endif
diff --git a/src/tests/eolian/data/docs_ref.h b/src/tests/eolian/data/docs_ref.h
index 79948b74ea..00bf52ee07 100644
--- a/src/tests/eolian/data/docs_ref.h
+++ b/src/tests/eolian/data/docs_ref.h
@@ -99,7 +99,7 @@ typedef struct _Opaque Opaque;
99 */ 99 */
100#define EO_DOCS_CLASS eo_docs_class_get() 100#define EO_DOCS_CLASS eo_docs_class_get()
101 101
102EWAPI const Efl_Class *eo_docs_class_get(void) EINA_CONST; 102EAPI EAPI_WEAK const Efl_Class *eo_docs_class_get(void) EINA_CONST;
103 103
104/** 104/**
105 * @brief Method documentation. 105 * @brief Method documentation.
@@ -115,7 +115,7 @@ EWAPI const Efl_Class *eo_docs_class_get(void) EINA_CONST;
115 * 115 *
116 * @ingroup Eo_Docs 116 * @ingroup Eo_Docs
117 */ 117 */
118EOAPI int eo_docs_meth(Eo *obj, int a, float *b, long *c); 118EAPI EAPI_WEAK int eo_docs_meth(Eo *obj, int a, float *b, long *c);
119 119
120/** 120/**
121 * @brief Property common documentation. 121 * @brief Property common documentation.
@@ -129,7 +129,7 @@ EOAPI int eo_docs_meth(Eo *obj, int a, float *b, long *c);
129 * 129 *
130 * @ingroup Eo_Docs 130 * @ingroup Eo_Docs
131 */ 131 */
132EOAPI void eo_docs_prop_set(Eo *obj, int val); 132EAPI EAPI_WEAK void eo_docs_prop_set(Eo *obj, int val);
133 133
134/** 134/**
135 * @brief Property common documentation. 135 * @brief Property common documentation.
@@ -144,9 +144,9 @@ EOAPI void eo_docs_prop_set(Eo *obj, int val);
144 * 144 *
145 * @ingroup Eo_Docs 145 * @ingroup Eo_Docs
146 */ 146 */
147EOAPI int eo_docs_prop_get(const Eo *obj); 147EAPI EAPI_WEAK int eo_docs_prop_get(const Eo *obj);
148 148
149EOAPI void eo_docs_no_doc_meth(Eo *obj); 149EAPI EAPI_WEAK void eo_docs_no_doc_meth(Eo *obj);
150 150
151/** No description supplied. 151/** No description supplied.
152 * 152 *
@@ -154,9 +154,9 @@ EOAPI void eo_docs_no_doc_meth(Eo *obj);
154 * 154 *
155 * @ingroup Eo_Docs 155 * @ingroup Eo_Docs
156 */ 156 */
157EOAPI void eo_docs_doc_with_empty_doc(Eo *obj); 157EAPI EAPI_WEAK void eo_docs_doc_with_empty_doc(Eo *obj);
158 158
159EWAPI extern const Efl_Event_Description _EO_DOCS_EVENT_CLICKED; 159EAPI EAPI_WEAK extern const Efl_Event_Description _EO_DOCS_EVENT_CLICKED;
160 160
161/** Event docs. 161/** Event docs.
162 * 162 *
diff --git a/src/tests/eolian/data/function_as_argument_ref.c b/src/tests/eolian/data/function_as_argument_ref.c
index 6d3a70d402..926d78693c 100644
--- a/src/tests/eolian/data/function_as_argument_ref.c
+++ b/src/tests/eolian/data/function_as_argument_ref.c
@@ -1,11 +1,11 @@
1 1
2void _function_as_argument_set_cb(Eo *obj, Function_As_Argument_Data *pd, void *cb_data, SimpleFunc cb, Eina_Free_Cb cb_free_cb); 2void _function_as_argument_set_cb(Eo *obj, Function_As_Argument_Data *pd, void *cb_data, SimpleFunc cb, Eina_Free_Cb cb_free_cb);
3 3
4EOAPI EFL_VOID_FUNC_BODYV(function_as_argument_set_cb, EFL_FUNC_CALL(cb_data, cb, cb_free_cb), void *cb_data, SimpleFunc cb, Eina_Free_Cb cb_free_cb); 4EAPI EAPI_WEAK EFL_VOID_FUNC_BODYV(function_as_argument_set_cb, EFL_FUNC_CALL(cb_data, cb, cb_free_cb), void *cb_data, SimpleFunc cb, Eina_Free_Cb cb_free_cb);
5 5
6char *_function_as_argument_call_cb(Eo *obj, Function_As_Argument_Data *pd, int a, double b); 6char *_function_as_argument_call_cb(Eo *obj, Function_As_Argument_Data *pd, int a, double b);
7 7
8EOAPI EFL_FUNC_BODYV(function_as_argument_call_cb, char *, NULL, EFL_FUNC_CALL(a, b), int a, double b); 8EAPI EAPI_WEAK EFL_FUNC_BODYV(function_as_argument_call_cb, char *, NULL, EFL_FUNC_CALL(a, b), int a, double b);
9 9
10static Eina_Bool 10static Eina_Bool
11_function_as_argument_class_initializer(Efl_Class *klass) 11_function_as_argument_class_initializer(Efl_Class *klass)
diff --git a/src/tests/eolian/data/function_as_argument_ref.h b/src/tests/eolian/data/function_as_argument_ref.h
index 2f522cd5fb..f79652eade 100644
--- a/src/tests/eolian/data/function_as_argument_ref.h
+++ b/src/tests/eolian/data/function_as_argument_ref.h
@@ -21,10 +21,10 @@ typedef Eo Function_As_Argument;
21 */ 21 */
22#define FUNCTION_AS_ARGUMENT_CLASS function_as_argument_class_get() 22#define FUNCTION_AS_ARGUMENT_CLASS function_as_argument_class_get()
23 23
24EWAPI const Efl_Class *function_as_argument_class_get(void) EINA_CONST; 24EAPI EAPI_WEAK const Efl_Class *function_as_argument_class_get(void) EINA_CONST;
25 25
26EOAPI void function_as_argument_set_cb(Eo *obj, void *cb_data, SimpleFunc cb, Eina_Free_Cb cb_free_cb); 26EAPI EAPI_WEAK void function_as_argument_set_cb(Eo *obj, void *cb_data, SimpleFunc cb, Eina_Free_Cb cb_free_cb);
27 27
28EOAPI char *function_as_argument_call_cb(Eo *obj, int a, double b) EFL_TRANSFER_OWNERSHIP EINA_WARN_UNUSED_RESULT; 28EAPI EAPI_WEAK char *function_as_argument_call_cb(Eo *obj, int a, double b) EFL_TRANSFER_OWNERSHIP EINA_WARN_UNUSED_RESULT;
29 29
30#endif 30#endif
diff --git a/src/tests/eolian/data/override_ref.c b/src/tests/eolian/data/override_ref.c
index dbbbbae263..e2dec87915 100644
--- a/src/tests/eolian/data/override_ref.c
+++ b/src/tests/eolian/data/override_ref.c
@@ -1,8 +1,8 @@
1EOAPI EFL_VOID_FUNC_BODY(override_a_set); 1EAPI EAPI_WEAK EFL_VOID_FUNC_BODY(override_a_set);
2 2
3void _override_a_get(const Eo *obj, Override_Data *pd); 3void _override_a_get(const Eo *obj, Override_Data *pd);
4 4
5EOAPI EFL_VOID_FUNC_BODY_CONST(override_a_get); 5EAPI EAPI_WEAK EFL_VOID_FUNC_BODY_CONST(override_a_get);
6 6
7static void __eolian_override_b_set(Eo *obj EINA_UNUSED, Override_Data *pd, int idx EINA_UNUSED, float a, char b, int c) 7static void __eolian_override_b_set(Eo *obj EINA_UNUSED, Override_Data *pd, int idx EINA_UNUSED, float a, char b, int c)
8{ 8{
@@ -11,23 +11,23 @@ static void __eolian_override_b_set(Eo *obj EINA_UNUSED, Override_Data *pd, int
11 pd->c = c; 11 pd->c = c;
12} 12}
13 13
14EOAPI EFL_VOID_FUNC_BODYV(override_b_set, EFL_FUNC_CALL(idx, a, b, c), int idx, float a, char b, int c); 14EAPI EAPI_WEAK EFL_VOID_FUNC_BODYV(override_b_set, EFL_FUNC_CALL(idx, a, b, c), int idx, float a, char b, int c);
15 15
16void _override_b_get(const Eo *obj, Override_Data *pd, int idx, float *a, char *b, int *c); 16void _override_b_get(const Eo *obj, Override_Data *pd, int idx, float *a, char *b, int *c);
17 17
18EOAPI EFL_VOID_FUNC_BODYV_CONST(override_b_get, EFL_FUNC_CALL(idx, a, b, c), int idx, float *a, char *b, int *c); 18EAPI EAPI_WEAK EFL_VOID_FUNC_BODYV_CONST(override_b_get, EFL_FUNC_CALL(idx, a, b, c), int idx, float *a, char *b, int *c);
19 19
20void _override_c_set(Eo *obj, Override_Data *pd, int idx, int c); 20void _override_c_set(Eo *obj, Override_Data *pd, int idx, int c);
21 21
22EOAPI EFL_VOID_FUNC_BODYV(override_c_set, EFL_FUNC_CALL(idx, c), int idx, int c); 22EAPI EAPI_WEAK EFL_VOID_FUNC_BODYV(override_c_set, EFL_FUNC_CALL(idx, c), int idx, int c);
23 23
24static int __eolian_override_c_get(const Eo *obj EINA_UNUSED, Override_Data *pd EINA_UNUSED, int idx EINA_UNUSED) 24static int __eolian_override_c_get(const Eo *obj EINA_UNUSED, Override_Data *pd EINA_UNUSED, int idx EINA_UNUSED)
25{ 25{
26 return 50; 26 return 50;
27} 27}
28 28
29EOAPI EFL_FUNC_BODYV_CONST(override_c_get, int, 50, EFL_FUNC_CALL(idx), int idx); 29EAPI EAPI_WEAK EFL_FUNC_BODYV_CONST(override_c_get, int, 50, EFL_FUNC_CALL(idx), int idx);
30EOAPI EFL_VOID_FUNC_BODY(override_foo); 30EAPI EAPI_WEAK EFL_VOID_FUNC_BODY(override_foo);
31 31
32static void __eolian_override_bar(Eo *obj EINA_UNUSED, Override_Data *pd EINA_UNUSED, int idx EINA_UNUSED, int *a, char **str) 32static void __eolian_override_bar(Eo *obj EINA_UNUSED, Override_Data *pd EINA_UNUSED, int idx EINA_UNUSED, int *a, char **str)
33{ 33{
@@ -35,7 +35,7 @@ static void __eolian_override_bar(Eo *obj EINA_UNUSED, Override_Data *pd EINA_UN
35 if (str) *str = NULL; 35 if (str) *str = NULL;
36} 36}
37 37
38EOAPI EFL_VOID_FUNC_BODYV(override_bar, EFL_FUNC_CALL(idx, a, str), int idx, int *a, char **str); 38EAPI EAPI_WEAK EFL_VOID_FUNC_BODYV(override_bar, EFL_FUNC_CALL(idx, a, str), int idx, int *a, char **str);
39 39
40void _override_base_constructor(Eo *obj, Override_Data *pd); 40void _override_base_constructor(Eo *obj, Override_Data *pd);
41 41
diff --git a/src/tests/eolian/data/owning_ref.c b/src/tests/eolian/data/owning_ref.c
index 6c9b30debe..6964944983 100644
--- a/src/tests/eolian/data/owning_ref.c
+++ b/src/tests/eolian/data/owning_ref.c
@@ -11,7 +11,7 @@ _owning_test1_ownership_fallback(Eina_List *test1, Eina_Iterator *test2, Eina_Ha
11 eina_accessor_free(test4); 11 eina_accessor_free(test4);
12} 12}
13 13
14EOAPI EFL_VOID_FUNC_BODYV_FALLBACK(owning_test1, _owning_test1_ownership_fallback(test1, test2, test3, test4);, EFL_FUNC_CALL(test1, test2, test3, test4), Eina_List *test1, Eina_Iterator *test2, Eina_Hash *test3, Eina_Accessor *test4); 14EAPI EAPI_WEAK EFL_VOID_FUNC_BODYV_FALLBACK(owning_test1, _owning_test1_ownership_fallback(test1, test2, test3, test4);, EFL_FUNC_CALL(test1, test2, test3, test4), Eina_List *test1, Eina_Iterator *test2, Eina_Hash *test3, Eina_Accessor *test4);
15 15
16void _owning_test2(Eo *obj, Owning_Data *pd, Eina_List *test1, Eina_Hash *test2); 16void _owning_test2(Eo *obj, Owning_Data *pd, Eina_List *test1, Eina_Hash *test2);
17 17
@@ -27,7 +27,7 @@ _owning_test2_ownership_fallback(Eina_List *test1, Eina_Hash *test2)
27 eina_hash_free(test2); 27 eina_hash_free(test2);
28} 28}
29 29
30EOAPI EFL_VOID_FUNC_BODYV_FALLBACK(owning_test2, _owning_test2_ownership_fallback(test1, test2);, EFL_FUNC_CALL(test1, test2), Eina_List *test1, Eina_Hash *test2); 30EAPI EAPI_WEAK EFL_VOID_FUNC_BODYV_FALLBACK(owning_test2, _owning_test2_ownership_fallback(test1, test2);, EFL_FUNC_CALL(test1, test2), Eina_List *test1, Eina_Hash *test2);
31 31
32static Eina_Bool 32static Eina_Bool
33_owning_class_initializer(Efl_Class *klass) 33_owning_class_initializer(Efl_Class *klass)
diff --git a/src/tests/eolian/data/struct_ref.h b/src/tests/eolian/data/struct_ref.h
index 61d3b85f89..189ef6b04c 100644
--- a/src/tests/eolian/data/struct_ref.h
+++ b/src/tests/eolian/data/struct_ref.h
@@ -52,7 +52,7 @@ typedef struct _Opaque Opaque;
52 */ 52 */
53#define STRUCT_CLASS struct_class_get() 53#define STRUCT_CLASS struct_class_get()
54 54
55EWAPI const Efl_Class *struct_class_get(void) EINA_CONST; 55EAPI EAPI_WEAK const Efl_Class *struct_class_get(void) EINA_CONST;
56 56
57/** 57/**
58 * @brief Foo docs. This is @c monospace. This is alone-standing $. 58 * @brief Foo docs. This is @c monospace. This is alone-standing $.
@@ -64,8 +64,8 @@ EWAPI const Efl_Class *struct_class_get(void) EINA_CONST;
64 * 64 *
65 * @ingroup Struct 65 * @ingroup Struct
66 */ 66 */
67EOAPI char *struct_foo(Eo *obj, int idx) EFL_TRANSFER_OWNERSHIP EINA_WARN_UNUSED_RESULT; 67EAPI EAPI_WEAK char *struct_foo(Eo *obj, int idx) EFL_TRANSFER_OWNERSHIP EINA_WARN_UNUSED_RESULT;
68 68
69EOAPI Named *struct_bar(Eo *obj); 69EAPI EAPI_WEAK Named *struct_bar(Eo *obj);
70 70
71#endif 71#endif
diff --git a/src/tests/eolian/data/typedef_ref.h b/src/tests/eolian/data/typedef_ref.h
index 155bb09d9d..616e0a38a7 100644
--- a/src/tests/eolian/data/typedef_ref.h
+++ b/src/tests/eolian/data/typedef_ref.h
@@ -68,8 +68,8 @@ typedef enum
68 */ 68 */
69#define TYPEDEF_CLASS typedef_class_get() 69#define TYPEDEF_CLASS typedef_class_get()
70 70
71EWAPI const Efl_Class *typedef_class_get(void) EINA_CONST; 71EAPI EAPI_WEAK const Efl_Class *typedef_class_get(void) EINA_CONST;
72 72
73EOAPI char *typedef_foo(Eo *obj, int idx) EFL_TRANSFER_OWNERSHIP EINA_WARN_UNUSED_RESULT; 73EAPI EAPI_WEAK char *typedef_foo(Eo *obj, int idx) EFL_TRANSFER_OWNERSHIP EINA_WARN_UNUSED_RESULT;
74 74
75#endif 75#endif
diff --git a/src/tests/eolian/eolian_generated_future.c b/src/tests/eolian/eolian_generated_future.c
index 556f55a1db..2b9c513c53 100644
--- a/src/tests/eolian/eolian_generated_future.c
+++ b/src/tests/eolian/eolian_generated_future.c
@@ -11,5 +11,8 @@
11struct Generated_Future_Data {}; 11struct Generated_Future_Data {};
12typedef struct Generated_Future_Data Generated_Future_Data; 12typedef struct Generated_Future_Data Generated_Future_Data;
13 13
14#define EOTEST_API
15#define EOTEST_API_WEAK
16
14#include "generated_future.eo.h" 17#include "generated_future.eo.h"
15#include "generated_future.eo.c" 18#include "generated_future.eo.c"
diff --git a/src/tests/eolian/meson.build b/src/tests/eolian/meson.build
index f4b6cdc6f1..cd9c4f185f 100644
--- a/src/tests/eolian/meson.build
+++ b/src/tests/eolian/meson.build
@@ -22,7 +22,8 @@ foreach eo_file : priv_eo_files
22 '-o', 'h:' + join_paths(meson.current_build_dir(), eo_file + '.h'), 22 '-o', 'h:' + join_paths(meson.current_build_dir(), eo_file + '.h'),
23 '-o', 'c:' + join_paths(meson.current_build_dir(), eo_file + '.c'), 23 '-o', 'c:' + join_paths(meson.current_build_dir(), eo_file + '.c'),
24 '-o', 'd:' + join_paths(meson.current_build_dir(), eo_file + '.d'), 24 '-o', 'd:' + join_paths(meson.current_build_dir(), eo_file + '.d'),
25 '-gchd', '@INPUT@']) 25 '-e', 'EOTEST_API',
26 '-gchd', '@INPUT@'])
26endforeach 27endforeach
27 28
28eolian_suite = executable('eolian_suite', 29eolian_suite = executable('eolian_suite',