efl/src/lib/ector/gl
Felipe Magno de Almeida 6f23a9daa1 ector: Rename EAPI macro to ECTOR_API in Ector library
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, woohyun, jptiz, lucas

Reviewed By: vtorri

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D12226
2021-01-01 17:34:01 -03:00
..
shader
Ector_GL.h ector: Rename EAPI macro to ECTOR_API in Ector library 2021-01-01 17:34:01 -03:00
ector_gl_buffer.c
ector_gl_buffer.eo eolian: enable checking of beta/stable contexts in all classes 2019-03-11 13:42:29 +01:00
ector_gl_private.h
ector_gl_shader.c
ector_gl_surface.c efl: use efl_add_ref to create objects which have no parent 2018-03-20 17:20:56 -07:00
ector_gl_surface.eo eo files: Avoid container<ptr(value_type)> usage. 2019-11-29 17:22:07 -03:00
ector_renderer_gl.c
ector_renderer_gl.eo eolian: enable checking of beta/stable contexts in all classes 2019-03-11 13:42:29 +01:00
ector_renderer_gl_gradient_linear.c eolian gen: enable constness generation on property getter impls 2018-04-17 20:31:55 +02:00
ector_renderer_gl_gradient_linear.eo eolian: move from eo_prefix to c_prefix 2019-05-09 16:17:44 +02:00
ector_renderer_gl_gradient_radial.c eolian gen: enable constness generation on property getter impls 2018-04-17 20:31:55 +02:00
ector_renderer_gl_gradient_radial.eo eolian: move from eo_prefix to c_prefix 2019-05-09 16:17:44 +02:00
ector_renderer_gl_shape.c efl gfx_path: remove EFL_GFX_PATH_EVENT_CHANGED 2018-12-28 12:20:15 +09:00
ector_renderer_gl_shape.eo eolian: move from eo_prefix to c_prefix 2019-05-09 16:17:44 +02:00
meson.build ector: Rename EAPI macro to ECTOR_API in Ector library 2021-01-01 17:34:01 -03:00