efl/src/lib/eio
Felipe Magno de Almeida 4e5b01f8a0 eio: Rename EAPI macro to EIO_API in Eio library
Summary:
Patch from a series of patches to rename EAPI symbols to specific
library DSOs.

=  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: vtorri, woohyun, lucas, jptiz

Reviewed By: vtorri, lucas

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D12210
2020-12-14 11:45:35 -03:00
..
Eio.h eio: Rename EAPI macro to EIO_API in Eio library 2020-12-14 11:45:35 -03:00
Eio.hh cxx: Modify how to generate C++ headers and allow cyclic dependencies 2017-01-18 22:47:04 -02:00
Eio_Eo.h efl_model : rename all efl_model based classes. 2019-01-31 14:59:37 +09:00
Eio_Legacy.h eio: Rename EAPI macro to EIO_API in Eio library 2020-12-14 11:45:35 -03:00
efl_io_manager.c eio: work around the lack of integration between Ecore_Thread and Eina_Future. 2019-03-27 15:03:33 -07:00
efl_io_manager.eo eo-files: convert all Eina.Strbuf & Eina.Binbuf 2020-06-09 10:29:29 +02:00
efl_io_model.c efl_io_model: next try to fix this race condition 2019-09-19 14:50:42 -07:00
efl_io_model.eo docs: minor tweaks to efl_io_model 2019-09-05 17:01:02 +02:00
efl_io_model_private.h eio: remove unecessary use of weak reference. 2019-03-27 15:03:26 -07:00
eio_dir.c eio: Rename EAPI macro to EIO_API in Eio library 2020-12-14 11:45:35 -03:00
eio_eet.c eio: Rename EAPI macro to EIO_API in Eio library 2020-12-14 11:45:35 -03:00
eio_file.c eio: Rename EAPI macro to EIO_API in Eio library 2020-12-14 11:45:35 -03:00
eio_inline_helper.x Eio: avoid symbolic link on Windows 2019-05-21 13:35:01 -04:00
eio_main.c eio: Rename EAPI macro to EIO_API in Eio library 2020-12-14 11:45:35 -03:00
eio_map.c eio: Rename EAPI macro to EIO_API in Eio library 2020-12-14 11:45:35 -03:00
eio_monitor.c eio: Rename EAPI macro to EIO_API in Eio library 2020-12-14 11:45:35 -03:00
eio_monitor_cocoa.c efl_io_model: next try to fix this race condition 2019-09-19 14:50:42 -07:00
eio_monitor_inotify.c efl_io_model: next try to fix this race condition 2019-09-19 14:50:42 -07:00
eio_monitor_kevent.c Get rid of trailing whitespaces (9 / 14) 2020-06-23 10:30:26 +02:00
eio_monitor_poll.c eio: Rename EAPI macro to EIO_API in Eio library 2020-12-14 11:45:35 -03:00
eio_monitor_win32.c efl_io_model: next try to fix this race condition 2019-09-19 14:50:42 -07:00
eio_private.h Fix typos - (Part #5) 2020-06-25 09:03:07 +02:00
eio_sentry.c Remove individual class BETA guards 2019-02-13 18:09:17 +01:00
eio_sentry.eo eolian: enable checking of beta/stable contexts in all classes 2019-03-11 13:42:29 +01:00
eio_sentry_private.h eio/sentry: destroy event handlers when deleting sentry 2018-08-17 22:19:32 +02:00
eio_single.c eio: Rename EAPI macro to EIO_API in Eio library 2020-12-14 11:45:35 -03:00
eio_xattr.c eio: Rename EAPI macro to EIO_API in Eio library 2020-12-14 11:45:35 -03:00
meson.build eio: Rename EAPI macro to EIO_API in Eio library 2020-12-14 11:45:35 -03:00