summaryrefslogtreecommitdiff
path: root/src/lib/evas/canvas/evas_grid_eo.h
diff options
context:
space:
mode:
authorFelipe Magno de Almeida <felipe@expertise.dev>2020-12-15 23:02:20 -0300
committerFelipe Magno de Almeida <felipe@expertise.dev>2020-12-15 23:06:12 -0300
commit0363fd8238c3df734c856a48cbb831b9651ed089 (patch)
tree951895156f0a5dd6aa7e88d8a602c58d79251c50 /src/lib/evas/canvas/evas_grid_eo.h
parent75f07e41c0242123f9e4e5dcbc303ad46ea0849b (diff)
downloadefl-0363fd8238c3df734c856a48cbb831b9651ed089.tar.gz
evas: Rename EAPI macro to EVAS_API in Evas 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, jptiz, lucas Reviewed By: vtorri, lucas Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D12214
Diffstat (limited to 'src/lib/evas/canvas/evas_grid_eo.h')
-rw-r--r--src/lib/evas/canvas/evas_grid_eo.h22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/lib/evas/canvas/evas_grid_eo.h b/src/lib/evas/canvas/evas_grid_eo.h
index 29477cc2c4..f6ce03d5b5 100644
--- a/src/lib/evas/canvas/evas_grid_eo.h
+++ b/src/lib/evas/canvas/evas_grid_eo.h
@@ -19,7 +19,7 @@ typedef Eo Evas_Grid;
*/
#define EVAS_GRID_CLASS evas_grid_class_get()
-EWAPI const Efl_Class *evas_grid_class_get(void) EINA_CONST;
+EVAS_API EVAS_API_WEAK const Efl_Class *evas_grid_class_get(void) EINA_CONST;
/**
* @brief Set the virtual resolution for the grid
@@ -32,7 +32,7 @@ EWAPI const Efl_Class *evas_grid_class_get(void) EINA_CONST;
*
* @ingroup Evas_Grid
*/
-EOAPI void evas_obj_grid_size_set(Eo *obj, int w, int h);
+EVAS_API EVAS_API_WEAK void evas_obj_grid_size_set(Eo *obj, int w, int h);
/**
* @brief Get the current virtual resolution
@@ -47,7 +47,7 @@ EOAPI void evas_obj_grid_size_set(Eo *obj, int w, int h);
*
* @ingroup Evas_Grid
*/
-EOAPI void evas_obj_grid_size_get(const Eo *obj, int *w, int *h);
+EVAS_API EVAS_API_WEAK void evas_obj_grid_size_get(const Eo *obj, int *w, int *h);
/**
* @brief Get the list of children for the grid.
@@ -65,7 +65,7 @@ EOAPI void evas_obj_grid_size_get(const Eo *obj, int *w, int *h);
*
* @ingroup Evas_Grid
*/
-EOAPI Eina_List *evas_obj_grid_children_get(const Eo *obj) EINA_WARN_UNUSED_RESULT;
+EVAS_API EVAS_API_WEAK Eina_List *evas_obj_grid_children_get(const Eo *obj) EINA_WARN_UNUSED_RESULT;
/**
* @brief Get an accessor to get random access to the list of children for the
@@ -81,7 +81,7 @@ EOAPI Eina_List *evas_obj_grid_children_get(const Eo *obj) EINA_WARN_UNUSED_RESU
*
* @ingroup Evas_Grid
*/
-EOAPI Eina_Accessor *evas_obj_grid_accessor_new(const Eo *obj) EINA_WARN_UNUSED_RESULT;
+EVAS_API EVAS_API_WEAK Eina_Accessor *evas_obj_grid_accessor_new(const Eo *obj) EINA_WARN_UNUSED_RESULT;
/**
* @brief Faster way to remove all child objects from a grid object.
@@ -93,7 +93,7 @@ EOAPI Eina_Accessor *evas_obj_grid_accessor_new(const Eo *obj) EINA_WARN_UNUSED_
*
* @ingroup Evas_Grid
*/
-EOAPI void evas_obj_grid_clear(Eo *obj, Eina_Bool clear);
+EVAS_API EVAS_API_WEAK void evas_obj_grid_clear(Eo *obj, Eina_Bool clear);
/**
* @brief Get an iterator to walk the list of children for the grid.
@@ -108,7 +108,7 @@ EOAPI void evas_obj_grid_clear(Eo *obj, Eina_Bool clear);
*
* @ingroup Evas_Grid
*/
-EOAPI Eina_Iterator *evas_obj_grid_iterator_new(const Eo *obj) EINA_WARN_UNUSED_RESULT;
+EVAS_API EVAS_API_WEAK Eina_Iterator *evas_obj_grid_iterator_new(const Eo *obj) EINA_WARN_UNUSED_RESULT;
/**
* @brief Create a grid that is child of a given element parent.
@@ -123,7 +123,7 @@ EOAPI Eina_Iterator *evas_obj_grid_iterator_new(const Eo *obj) EINA_WARN_UNUSED_
*
* @ingroup Evas_Grid
*/
-EOAPI Efl_Canvas_Object *evas_obj_grid_add_to(Eo *obj) EINA_WARN_UNUSED_RESULT;
+EVAS_API EVAS_API_WEAK Efl_Canvas_Object *evas_obj_grid_add_to(Eo *obj) EINA_WARN_UNUSED_RESULT;
/**
* @brief Remove child from grid.
@@ -141,7 +141,7 @@ EOAPI Efl_Canvas_Object *evas_obj_grid_add_to(Eo *obj) EINA_WARN_UNUSED_RESULT;
*
* @ingroup Evas_Grid
*/
-EOAPI Eina_Bool evas_obj_grid_unpack(Eo *obj, Efl_Canvas_Object *child) EINA_ARG_NONNULL(2);
+EVAS_API EVAS_API_WEAK Eina_Bool evas_obj_grid_unpack(Eo *obj, Efl_Canvas_Object *child) EINA_ARG_NONNULL(2);
/**
* @brief Get the pack options for a grid child
@@ -162,7 +162,7 @@ EOAPI Eina_Bool evas_obj_grid_unpack(Eo *obj, Efl_Canvas_Object *child) EINA_ARG
*
* @ingroup Evas_Grid
*/
-EOAPI Eina_Bool evas_obj_grid_pack_get(const Eo *obj, Efl_Canvas_Object *child, int *x, int *y, int *w, int *h);
+EVAS_API EVAS_API_WEAK Eina_Bool evas_obj_grid_pack_get(const Eo *obj, Efl_Canvas_Object *child, int *x, int *y, int *w, int *h);
/**
* @brief Add a new child to a grid object.
@@ -180,6 +180,6 @@ EOAPI Eina_Bool evas_obj_grid_pack_get(const Eo *obj, Efl_Canvas_Object *child,
*
* @ingroup Evas_Grid
*/
-EOAPI Eina_Bool evas_obj_grid_pack(Eo *obj, Efl_Canvas_Object *child, int x, int y, int w, int h) EINA_ARG_NONNULL(2);
+EVAS_API EVAS_API_WEAK Eina_Bool evas_obj_grid_pack(Eo *obj, Efl_Canvas_Object *child, int x, int y, int w, int h) EINA_ARG_NONNULL(2);
#endif