efl/src/lib/eldbus
Felipe Magno de Almeida 1304d95717 eldbus: Rename EAPI macro to ELDBUS_API in Eldbus 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

Subscribers: raster, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D12270
2021-05-23 20:47:13 +01:00
..
Eldbus.h eldbus: Rename EAPI macro to ELDBUS_API in Eldbus library 2021-05-23 20:47:13 +01:00
Eldbus_Model.h headers: ensure Efl.h is always included behind BETA define guards 2019-03-08 12:06:22 -08:00
eldbus_api.h eldbus: Rename EAPI macro to ELDBUS_API in Eldbus library 2021-05-23 20:47:13 +01:00
eldbus_connection.h eldbus: Rename EAPI macro to ELDBUS_API in Eldbus library 2021-05-23 20:47:13 +01:00
eldbus_core.c eldbus: Rename EAPI macro to ELDBUS_API in Eldbus library 2021-05-23 20:47:13 +01:00
eldbus_freedesktop.c eldbus: Rename EAPI macro to ELDBUS_API in Eldbus library 2021-05-23 20:47:13 +01:00
eldbus_freedesktop.h eldbus: Rename EAPI macro to ELDBUS_API in Eldbus library 2021-05-23 20:47:13 +01:00
eldbus_introspection.c eldbus: Rename EAPI macro to ELDBUS_API in Eldbus library 2021-05-23 20:47:13 +01:00
eldbus_introspection.h eldbus: Rename EAPI macro to ELDBUS_API in Eldbus library 2021-05-23 20:47:13 +01:00
eldbus_message.c eldbus: Rename EAPI macro to ELDBUS_API in Eldbus library 2021-05-23 20:47:13 +01:00
eldbus_message.h eldbus: Rename EAPI macro to ELDBUS_API in Eldbus library 2021-05-23 20:47:13 +01:00
eldbus_message_eina_value.h eldbus: Rename EAPI macro to ELDBUS_API in Eldbus library 2021-05-23 20:47:13 +01:00
eldbus_message_from_eina_value.c eldbus: Rename EAPI macro to ELDBUS_API in Eldbus library 2021-05-23 20:47:13 +01:00
eldbus_message_helper.c eldbus: Rename EAPI macro to ELDBUS_API in Eldbus library 2021-05-23 20:47:13 +01:00
eldbus_message_helper.h eldbus: Rename EAPI macro to ELDBUS_API in Eldbus library 2021-05-23 20:47:13 +01:00
eldbus_message_to_eina_value.c eldbus: Rename EAPI macro to ELDBUS_API in Eldbus library 2021-05-23 20:47:13 +01:00
eldbus_model.c eldbus: properly cleanup local variable during destruction. 2019-10-07 10:04:18 -04:00
eldbus_model.eo eolian: enable checking of beta/stable contexts in all classes 2019-03-11 13:42:29 +01:00
eldbus_model_arguments.c eldbus: connection are destroyed on invalidate, there is no point for any object to not cleanup on invalidate. 2019-10-07 10:04:12 -04:00
eldbus_model_arguments.eo eo files: Avoid container<ptr(value_type)> usage. 2019-11-29 17:22:07 -03:00
eldbus_model_arguments_private.h efl: make Efl.Model.properties_get return an Iterator<string>. 2018-11-23 10:13:58 -08:00
eldbus_model_connection.c ecore: remove data parameters of Efl.Loop_Consumer.promise_new to reduce the risk of inadvertently using the wrong data. 2019-01-16 14:33:26 -08:00
eldbus_model_connection.eo eolian: enable checking of beta/stable contexts in all classes 2019-03-11 13:42:29 +01:00
eldbus_model_connection_private.h eldbus: migrate and refactor eldbus.model to new efl.model API. 2018-04-30 14:21:11 -07:00
eldbus_model_method.c eldbus: properly call parent finalize during creation of Eldbus.Model_Method. 2019-10-07 10:03:58 -04:00
eldbus_model_method.eo eolian: drop @cref 2019-08-29 13:58:16 +02:00
eldbus_model_method_private.h eldbus: migrate and refactor eldbus.model to new efl.model API. 2018-04-30 14:21:11 -07:00
eldbus_model_object.c efl: use eina_streq for all property operation in model to avoid crash on NULL property name. 2019-07-10 21:10:23 +02:00
eldbus_model_object.eo eolian: enable checking of beta/stable contexts in all classes 2019-03-11 13:42:29 +01:00
eldbus_model_object_private.h eldbus: migrate and refactor eldbus.model to new efl.model API. 2018-04-30 14:21:11 -07:00
eldbus_model_private.h ecore: remove data parameters of Efl.Loop_Consumer.promise_new to reduce the risk of inadvertently using the wrong data. 2019-01-16 14:33:26 -08:00
eldbus_model_proxy.c eldbus: only free the data when the future is resolved or rejected. 2019-11-18 11:46:11 +01:00
eldbus_model_proxy.eo eolian: drop @cref 2019-08-29 13:58:16 +02:00
eldbus_model_proxy_private.h eldbus: migrate and refactor eldbus.model to new efl.model API. 2018-04-30 14:21:11 -07:00
eldbus_model_signal.c eldbus: connection are destroyed on invalidate, there is no point for any object to not cleanup on invalidate. 2019-10-07 10:04:12 -04:00
eldbus_model_signal.eo eldbus: connection are destroyed on invalidate, there is no point for any object to not cleanup on invalidate. 2019-10-07 10:04:12 -04:00
eldbus_model_signal_private.h
eldbus_object.c eldbus: Rename EAPI macro to ELDBUS_API in Eldbus library 2021-05-23 20:47:13 +01:00
eldbus_object.h eldbus: Rename EAPI macro to ELDBUS_API in Eldbus library 2021-05-23 20:47:13 +01:00
eldbus_pending.c eldbus: Rename EAPI macro to ELDBUS_API in Eldbus library 2021-05-23 20:47:13 +01:00
eldbus_pending.h eldbus: Rename EAPI macro to ELDBUS_API in Eldbus library 2021-05-23 20:47:13 +01:00
eldbus_private.h
eldbus_private_types.h
eldbus_proxy.c eldbus: Rename EAPI macro to ELDBUS_API in Eldbus library 2021-05-23 20:47:13 +01:00
eldbus_proxy.h eldbus: Rename EAPI macro to ELDBUS_API in Eldbus library 2021-05-23 20:47:13 +01:00
eldbus_service.c eldbus: Rename EAPI macro to ELDBUS_API in Eldbus library 2021-05-23 20:47:13 +01:00
eldbus_service.h eldbus: Rename EAPI macro to ELDBUS_API in Eldbus library 2021-05-23 20:47:13 +01:00
eldbus_signal_handler.c eldbus: Rename EAPI macro to ELDBUS_API in Eldbus library 2021-05-23 20:47:13 +01:00
eldbus_signal_handler.h eldbus: Rename EAPI macro to ELDBUS_API in Eldbus library 2021-05-23 20:47:13 +01:00
eldbus_types.eot eo files: Avoid container<ptr(value_type)> usage. 2019-11-29 17:22:07 -03:00
meson.build eldbus: Rename EAPI macro to ELDBUS_API in Eldbus library 2021-05-23 20:47:13 +01:00