efl/src/tests
Felipe Magno de Almeida 74204bccd7 ecore: Rename EAPI macro to ECORE_API in Ecore library
Summary:
=  The Rationale =

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
EAPI is the only solution that worked for MSVC.

Co-authored-by: João Paulo Taylor Ienczak Zanette <jpaulotiz@gmail.com>
Co-authored-by: Ricardo Campos <ricardo.campos@expertise.dev>
Co-authored-by: Lucas Cavalcante de Sousa <lucks.sousa@gmail.com>

Reviewers: vtorri, raster

Reviewed By: raster

Subscribers: raster, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D12271
2021-05-23 20:47:23 +01:00
..
ecore ecore: Rename EAPI macro to ECORE_API in Ecore library 2021-05-23 20:47:23 +01:00
ecore_audio_cxx cxx: Add license to CXX bindings. 2019-10-24 10:40:16 -03:00
ecore_con tests: ecore_con another cert update to extend the time its valid to 100 years 2020-05-11 17:05:44 +02:00
ecore_cxx cxx: Add license to CXX bindings. 2019-10-24 10:40:16 -03:00
ecore_wl2 efl - build again - test suite break in using undefined ERR macro 2020-06-10 19:30:14 +01:00
ector cmake: remove! 2018-12-20 20:07:26 +01:00
edje tests: edje: check result of evas_engine_info_set() 2020-06-15 15:04:22 +02:00
edje_cxx cxx: Add license to CXX bindings. 2019-10-24 10:40:16 -03:00
eet Evil : move mkstemp(s) and mkdtemp in eina_file directly 2020-10-08 11:58:11 +01:00
eet_cxx cxx: Add license to CXX bindings. 2019-10-24 10:40:16 -03:00
eeze cmake: remove! 2018-12-20 20:07:26 +01:00
efl tests/efl: use alloca for composite model test future to avoid leak 2020-04-15 19:26:39 +02:00
efl_js bindings-cxx: fix missing @since tags at stable c#/cpp tests 2020-02-05 17:15:33 +01:00
efl_mono Fix typos 2020-06-25 09:03:05 +02:00
efreet Merge efreet_mime efreet_trash into efreet 2020-05-26 10:15:30 +02:00
eina Implement eina_thread for native windows 2021-04-17 16:00:32 -03:00
eina_cxx bindings-cxx: fix missing @since tags at stable c#/cpp tests 2020-02-05 17:15:33 +01:00
eio eio_test_manager: Fix unchecked return value 2021-02-25 09:33:42 -05:00
eldbus eldbus_fake_server: Fix unchecked return value 2021-02-25 09:18:46 -05:00
eldbus_cxx cxx: Add license to CXX bindings. 2019-10-24 10:40:16 -03:00
elementary tests: fix efl_ui_suite 2021-04-01 15:22:57 +02:00
elementary_cxx cxx: Add license to CXX bindings. 2019-10-24 10:40:16 -03:00
elput here comes meson 2018-10-02 17:22:50 +02:00
elua elua test: fix undeclared variable 2020-10-09 23:26:00 +01:00
emile emile_test_base64: Fix memory leak 2019-05-02 13:48:22 +02:00
emotion meson: correctly use the correct dependency 2019-04-05 08:15:39 -04:00
eo eo: Rename EAPI macro to EO_API in Eo library 2020-12-09 13:52:25 -03:00
eo_cxx cxx: Add license to CXX bindings. 2019-10-24 10:40:16 -03:00
eolian eolian: Add -e parameter to pass export symbol to eolian generator 2020-12-04 10:35:35 -03:00
eolian_cxx eo: Rename EAPI macro to EO_API in Eo library 2020-12-09 13:52:25 -03:00
eolian_js bindings-cxx: fix missing @since tags at stable c#/cpp tests 2020-02-05 17:15:33 +01:00
evas TextBlock: Fix content Fit with Markup-font-size 2021-05-23 19:54:20 +01:00
evas_cxx cxx: Add license to CXX bindings. 2019-10-24 10:40:16 -03:00
evil Evil : move mkstemp(s) and mkdtemp in eina_file directly 2020-10-08 11:58:11 +01:00
.gitignore tests: add failsafe timeout for tests running in fork mode 2018-08-16 09:59:58 +02:00
efl_check.h efl_check.h: Replace stack allocated array by heap allocated 2020-06-23 17:21:22 +02:00
meson.build here comes meson 2018-10-02 17:22:50 +02:00
timeout.c tests: add failsafe timeout for tests running in fork mode 2018-08-16 09:59:58 +02:00