path: root/src/lib/evas
diff options
authorFelipe Magno de Almeida <>2020-11-25 09:35:48 -0300
committerFelipe Magno de Almeida <>2020-11-25 09:42:47 -0300
commitccc1849263d8019c712e0fee02673de15f30b3c5 (patch)
tree2ba060a4889090a8a86b707cd666d3f4ad1a7e41 /src/lib/evas
parent6b1f281f175a68dc50c788010f47bc4e256905d1 (diff)
eina: Rename EAPI macro to EINA_API in Eina library
Summary: Patch 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 EAPI is the only solution that worked for MSVC. Co-authored-by: João Paulo Taylor Ienczak Zanette <> Co-authored-by: Ricardo Campos <> Co-authored-by: Lucas Cavalcante de Sousa <> Reviewers: jptiz, lucas, woohyun, vtorri, raster Reviewed By: jptiz, lucas, vtorri Subscribers: ProhtMeyhet, cedric, #reviewers, #committers Tags: #efl Differential Revision:
Diffstat (limited to 'src/lib/evas')
2 files changed, 2 insertions, 1 deletions
diff --git a/src/lib/evas/common/evas_font_ot.h b/src/lib/evas/common/evas_font_ot.h
index e38e758b00..5e1906b419 100644
--- a/src/lib/evas/common/evas_font_ot.h
+++ b/src/lib/evas/common/evas_font_ot.h
@@ -33,6 +33,7 @@ struct _Evas_Font_OT_Info
33# endif 33# endif
34 34
35#include "evas_font.h" 35#include "evas_font.h"
36#include "Evas.h"
36 37
37EAPI int 38EAPI int
38evas_common_font_ot_cluster_size_get(const Evas_Text_Props *props, size_t char_index); 39evas_common_font_ot_cluster_size_get(const Evas_Text_Props *props, size_t char_index);
diff --git a/src/lib/evas/common/evas_op_blend/op_blend_master_sse3.c b/src/lib/evas/common/evas_op_blend/op_blend_master_sse3.c
index d265a79b10..57562ce78d 100644
--- a/src/lib/evas/common/evas_op_blend/op_blend_master_sse3.c
+++ b/src/lib/evas/common/evas_op_blend/op_blend_master_sse3.c
@@ -1,7 +1,7 @@
1#define NEED_SSE3 1 1#define NEED_SSE3 1
2 2
3#include "Eina.h" 3#include "Eina.h"
4 4#include "Evas.h"
5#include "evas_common_types.h" 5#include "evas_common_types.h"
6 6
7EAPI void evas_common_cpu_end_opt(void); 7EAPI void evas_common_cpu_end_opt(void);