Eo: code in Documentation no longer compiles #13

Open
opened 2022-09-11 14:31:57 -07:00 by ylee · 2 comments

The code in the Documention on Eo no longer compiles:

gcc -o eo-classes eo_classes_main.c example_rectangle.c `pkg-config --cflags --libs eina efl elementary`

bombs out

example_rectangle.eo.h:24:1: error: unknown type name ‘EAPI’; did you mean ‘EWAPI’?

This breaks the associated Examples Repo, which also now no longer compiles the code in the /tutorial/c Folder.

This was tested using efl from git at commit 6c642eb12b : **efl: Disable examples by default **.

Further testing reveal that
efl 1.25.1 works, is not broken on this issue while the branch v-1.26.0 is broken.

Git bisect results:

138e9e5294bcc5994853c826da013f0220042c5c is the first bad commit```

commit 138e9e5294bcc5994853c826da013f0220042c5c
Author: Felipe Magno de Almeida <felipe@expertise.dev>
Date:   Wed Dec 9 13:50:29 2020 -0300
eo: Rename EAPI macro to EO_API in Eo library
The code in [the Documention](https://www.enlightenment.org/develop/tutorials/c/eo-classes.md) on Eo no longer compiles: ```gcc -o eo-classes eo_classes_main.c example_rectangle.c `pkg-config --cflags --libs eina efl elementary` ``` bombs out `example_rectangle.eo.h:24:1: error: unknown type name ‘EAPI’; did you mean ‘EWAPI’?` This breaks the associated [Examples Repo](https://git.enlightenment.org/enlightenment/examples/src/branch/master/tutorial), which also now no longer compiles the code in the **/tutorial/c** Folder. This was tested using efl from git at commit 6c642eb12b : **efl: Disable examples by default **. Further testing reveal that **efl 1.25.1** works, is not broken on this issue while the branch **v-1.26.0** is broken. Git bisect results: ``` 138e9e5294bcc5994853c826da013f0220042c5c is the first bad commit``` commit 138e9e5294bcc5994853c826da013f0220042c5c Author: Felipe Magno de Almeida <felipe@expertise.dev> Date: Wed Dec 9 13:50:29 2020 -0300 eo: Rename EAPI macro to EO_API in Eo library ```
Owner

that is because of an unfinished work from Felipe, it seems

that is because of an unfinished work from Felipe, it seems
raster self-assigned this 2022-09-13 06:41:01 -07:00
Contributor

Works for me (efl 1.26.99) if add in example_rectangle.c:

#include <Eo.h>

#ifdef EAPI
# undef EAPI
#endif
#ifdef EWAPI
# undef EWAPI
#endif
#ifdef EOAPI
# undef EOAPI
#endif

#ifdef _WIN32
# ifdef EFL_BUILD
#  ifdef DLL_EXPORT
#   define EAPI __declspec(dllexport)
#  else
#   define EAPI
#  endif
# else
#  define EAPI __declspec(dllimport)
# endif
# define EAPI_WEAK
#else
# ifdef __GNUC__
#  if __GNUC__ >= 4
#   define EAPI __attribute__ ((visibility("default")))
#   define EAPI_WEAK __attribute__ ((weak))
#  else
#   define EAPI
#   define EAPI_WEAK
#  endif
# else
#  define EAPI
#  define EAPI_WEAK
# endif
#endif

#define EWAPI EAPI EAPI_WEAK
#define EOAPI EAPI EAPI_WEAK

#include "example_rectangle.eo.h"
Works for me (efl 1.26.99) if add in example_rectangle.c: ``` #include <Eo.h> #ifdef EAPI # undef EAPI #endif #ifdef EWAPI # undef EWAPI #endif #ifdef EOAPI # undef EOAPI #endif #ifdef _WIN32 # ifdef EFL_BUILD # ifdef DLL_EXPORT # define EAPI __declspec(dllexport) # else # define EAPI # endif # else # define EAPI __declspec(dllimport) # endif # define EAPI_WEAK #else # ifdef __GNUC__ # if __GNUC__ >= 4 # define EAPI __attribute__ ((visibility("default"))) # define EAPI_WEAK __attribute__ ((weak)) # else # define EAPI # define EAPI_WEAK # endif # else # define EAPI # define EAPI_WEAK # endif #endif #define EWAPI EAPI EAPI_WEAK #define EOAPI EAPI EAPI_WEAK #include "example_rectangle.eo.h" ```
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: enlightenment/efl#13
No description provided.