efl/src/lib
Felipe Magno de Almeida c02b796fdb elementary: Add EOAPI definition in Elementary to allow removal in other libraries
Summary:
Patch from a series of patches to rename EAPI symbols to specific
library DSOs.

=  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/D12273
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 ecore_audio: Rename EAPI macro to ECORE_AUDIO_API in Ecore Audio library 2020-12-15 11:36:42 -03:00
ecore_avahi lib: add more c_args handling for places we missed before 2020-05-26 10:15:27 +02:00
ecore_buffer refactor build 2020-05-27 11:06:46 +02:00
ecore_cocoa Get rid of trailing whitespaces (4 / 14) 2020-06-23 10:29:14 +02:00
ecore_con efl_net_dialer_http: Do curl shutdown in destructor 2021-04-28 10:45:26 +01:00
ecore_drm Get rid of trailing whitespaces (4 / 14) 2020-06-23 10:29:14 +02:00
ecore_drm2 ecore drm - increase timeout for flips from 0.05 to 2.0 sec 2020-09-04 13:25:52 +01:00
ecore_evas ecore evas ews - deprecate/remove 2021-03-28 13:56:33 +01:00
ecore_fb Get rid of trailing whitespaces (4 / 14) 2020-06-23 10:29:14 +02:00
ecore_file ecore_file_monitor: add kevent backend. 2021-01-31 14:45:46 +00:00
ecore_imf Fix typos - (Part #2) 2020-07-06 10:52:49 +02:00
ecore_imf_evas refactor build 2020-05-27 11:06:46 +02:00
ecore_input freebsd: eeze support if enabled. 2021-04-10 08:58:38 +01:00
ecore_input_evas Get rid of trailing whitespaces (4 / 14) 2020-06-23 10:29:14 +02:00
ecore_ipc ecore_ipc: remove duplicated condition 2020-07-31 10:14:00 +02:00
ecore_sdl Get rid of trailing whitespaces (4 / 14) 2020-06-23 10:29:14 +02:00
ecore_wayland Get rid of trailing whitespaces (4 / 14) 2020-06-23 10:29:14 +02:00
ecore_win32 Ecore_Win32: add the API ecore_win32_window_maximized_set() 2020-10-13 15:19:39 +01:00
ecore_wl2 ecore_wl2: Remove legacy teamwork stuff 2021-03-01 11:22:58 -05:00
ecore_x Eina: use eina_fnmatch() instead of fnmatch() 2021-05-03 18:48:24 +01:00
ector ector image: Prevents drawing images outside buffer 2021-03-18 17:10:05 +09:00
edje edje: Add weak symbol 2021-05-23 20:47:23 +01:00
eet Eina: use eina_fnmatch() instead of fnmatch() 2021-05-03 18:48:24 +01:00
eeze freebsd: eeze support if enabled. 2021-04-10 08:58:38 +01:00
efl efl: Rename EAPI macro to EFL_API in Efl sub-library 2021-05-23 20:47:03 +01:00
efl_canvas_wl efl_canvas: fix a potentional error of null deref 2020-08-05 10:47:15 +02:00
efl_mono efl_mono: Create insert list/array c# wrapper for eina_value. 2020-02-13 15:26:50 -03:00
efreet Eina: use eina_fnmatch() instead of fnmatch() 2021-05-03 18:48:24 +01:00
eina Eina: use eina_fnmatch() instead of fnmatch() 2021-05-03 18:48:24 +01:00
eio efl_io_model: initialize memory 2021-04-10 13:11:07 +02:00
eldbus eldbus: Rename EAPI macro to ELDBUS_API in Eldbus library 2021-05-23 20:47:13 +01:00
elementary elementary: Add EOAPI definition in Elementary to allow removal in other libraries 2021-05-23 20:47:23 +01:00
elput elput: Fix formatting 2021-04-01 14:49:35 -04:00
elua elua: add searchpath impl for 5.1 compat 2020-07-31 19:01:59 +02:00
embryo Eina: use eina_fnmatch() instead of fnmatch() 2021-05-03 18:48:24 +01:00
emile eet, emile: safety++ 2021-02-04 10:11:33 +09:00
emotion emotion: emotion EAPI macro to EMOTION_API in Emotion library 2021-01-11 10:31:30 +00:00
eo Eina: use eina_fnmatch() instead of fnmatch() 2021-05-03 18:48:24 +01:00
eolian Evas, Eolian: install missing *_api.h files 2020-12-17 15:28:26 +00:00
eolian_cxx cxx: Fix uses of intrinsic eolian binbuf type 2020-06-09 10:29:32 +02:00
ephysics refactor build 2020-05-27 11:06:46 +02:00
ethumb Ethumb: reorder _init/shutdown functions, ecore and evas init/shutdown are useless, as ecore_evas already manages them 2020-09-25 10:30:04 +01:00
ethumb_client ethumb - fix asan complaint on mis-accessing struct after free in client 2021-01-24 15:59:55 +00:00
evas TextBlock: Fix content Fit with Markup-font-size 2021-05-23 19:54:20 +01:00
evil evil: Fix fcntl for F_SETLK and F_SETLKW wrong length calculation 2020-12-14 11:50:48 -03:00
.gitignore