summaryrefslogtreecommitdiff
path: root/src/lib/eina (unfollow)
AgeCommit message (Collapse)Author
3 dayseina: Rename EAPI macro to EINA_API in Eina libraryFelipe Magno de Almeida
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 <jpaulotiz@gmail.com> Co-authored-by: Ricardo Campos <ricardo.campos@expertise.dev> Co-authored-by: Lucas Cavalcante de Sousa <lucks.sousa@gmail.com> Reviewers: jptiz, lucas, woohyun, vtorri, raster Reviewed By: jptiz, lucas, vtorri Subscribers: ProhtMeyhet, cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D12188
2020-10-08Evil : move mkstemp(s) and mkdtemp in eina_file directlyVincent Torri
Summary: Also replace all mkstemp(s) and mkdtemp with the eina_file functions in the source Test Plan: run eina_file test Reviewers: raster Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D12170
2020-10-05eina - eina eifle - rename eina_file.c to indicate its for posixCarsten Haitzler (Rasterman)
2020-10-03singularize srand in eina_init - only once in one placeCarsten Haitzler (Rasterman)
simplify down to having a single srand() in eina_init and use urandom if it works and is there - if not, time(NULL) will do. it's the best we can...
2020-09-19eina thread - check return of pthread_attr_initCarsten Haitzler (Rasterman)
fix CID 1401031
2020-09-01efl: remove unused functionsMarcel Hollerbach
these are not used, if they are used again in the future, they can be get back via git.
2020-08-30eina - statgen (stat generation) - fix enable api to actually enableCarsten Haitzler (Rasterman)
it wasn't being enabled thus missing an entire optimization limiting stats to "once per frame" etc. to avoid overly syscall+io happy code from having as much of an impact @fix
2020-08-24eina file - fd close - handle fbsd 11 syscall abi as it broke in 12Carsten Haitzler (Rasterman)
2020-08-21eina file - fix getdents64 on older glibc's and use raw syscallCarsten Haitzler (Rasterman)
2020-08-21eina - eina_file_close_from - handle coverity theory that closes changeCarsten Haitzler (Rasterman)
this won't happen as the setup should not have the # of fd's found in 2st pass and 2nd pass for a dirfd change as nothing should interfere. comment to that effect and add a paranoid change num_closes to the number found
2020-08-20ecore - don't do anything with heap between fork and execCarsten Haitzler (Rasterman)
this avoids a possibgle deadlock if a malloc impl is holding a lock and has not released it at the time we fork. @fix
2020-08-17eina: Use INVALID_FILE_ATTRIBUTES instead of magic numberJoão Paulo Taylor Ienczak Zanette
Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org> Reviewed-by: Vincent Torri <vincent.torri@gmail.com> Differential Revision: https://phab.enlightenment.org/D12106
2020-07-30eina vpath - fix windows ~username handling to only error when usedCarsten Haitzler (Rasterman)
we would always rrturn 0 on windows ... missing {} in block. fix that. @fix
2020-07-19Eina log: flush stderr on mintty-based terminalsVincent Torri
Summary: on those terminal, stderr is never flushed, so errors messages are not displayed when, for example, the app crashes Test Plan: test program : ```#include <Eina.h> #define ERR(...) EINA_LOG_DOM_ERR(log_dom, __VA_ARGS__) int main() { int log_dom = -1; eina_init(); log_dom = eina_log_domain_register("eet", EINA_COLOR_CYAN); if (log_dom < 0) { printf("error register\n"); return 0; } ERR("an error."); while (1) { } return 0; } ``` without the patch, nothing is displayed, even after a Ctrl-C to finish the program with the patch, the error message is displayed Reviewers: raster Reviewed By: raster Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D12058
2020-07-14docs: Correct the wrong API group name and typo in Evas, Eet, Eina, Eio and ↵Myoungwoon Roy, Kim
Elementary Summary: I found wrong API reference group name in mapbuf, Evas, Eet, Eina, Eio and fixed them. Test Plan: API reference documentation modification only Reviewers: segfaultxavi, stefan_schmidt Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D12052
2020-07-03Protect EINA_(UN)LIKELY with parenthesis around the exprWander Lairson Costa
Without it an expression like !EINA_LIKELY(a && b) expands !a && b Reviewed-by: Cedric BAIL <cedric.bail@free.fr> Reviewed-by: Vincent Torri <vincent.torri@gmail.com> Differential Revision: https://phab.enlightenment.org/D12041
2020-06-26Native Windows: Eina: Resolve bad comparison while using windows strerror_sLucas Cavalcante de Sousa
`strerror_s` is the windows alternative of `strerror_r` used by EFL. `strerror_s` never return the error code with the message as `strerror_r` does, because of that, while comparing the first 14 characters of `Unknown error ` to the message from unknown code 4096 (`Unknown error`) they were accusing being different - in UNIX this works because the message returned is `Unknown error 4096`. This error was noticeable at `eina_error_test_failures` test case. This Diff adds the error code to the message in case of an `Unknown error`, making the windows implementation compliant with UNIX. Reviewed-by: Vincent Torri <vincent.torri@gmail.com> Reviewed-by: Wander Lairson Costa <wander.lairson@gmail.com> Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org> Differential Revision: https://phab.enlightenment.org/D12033
2020-06-26Windows: fix eina_file_map_new()Vincent Torri
the offset passed to MapViewOfFile() must be a multiple of the granularity. https://docs.microsoft.com/en-us/windows/win32/memory/creating-a-view-within-a-file is taken as basis for this patch Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org> Reviewed-by: Wander Lairson Costa <wander.lairson@gmail.com> Differential Revision: https://phab.enlightenment.org/D12031
2020-06-25eina_array: micro optimize eina_array_pushMarcel Hollerbach
This commit does two things: - Tell the compiler that it is unlikely that we need to grow, and that it is unlikely that data is NULL. Sometimes the if check for data would get dropped out by the compiler when it can be ensured that it is != NULL. However, if we for example efl_add something and eina_push the result, the condition would not be removed, as there is no assertion efl_add would be != NULL. - Do not hide the array assignment in a branch, but make it the default branch, this way instruction cache caches the correct instruction, as branch prediction will now hopefully, due to the hinting, take the correct branch. While benchmarking this here (simply in elementary_perf), this reduced pipeline faults in eina_array_push quite a bit. (Btw. it is hard to track *which* exact calls to eina_array_push do cause that, as mostly this API gets inlined, so it was easier optimizing that, instead of the method arround) Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org> Differential Revision: https://phab.enlightenment.org/D11997
2020-06-23Get rid of trailing whitespaces (8 / 14)Elyes HAOUAS
Remove trailing whitespaces Differential Revision: https://phab.enlightenment.org/D12007
2020-06-22eina_strbuf: introduce change last occurrence functionAli Alzyod
Reviewers: cedric, woohyun, bowonryu Reviewed By: cedric Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8757 Differential Revision: https://phab.enlightenment.org/D11990
2020-06-22eina_strbuf: if readonly strbuf is malloc, then it will stop being readonlyAli Alzyod
Reviewers: cedric Reviewed By: cedric Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8757 Differential Revision: https://phab.enlightenment.org/D11992
2020-06-22eina_strbuf_manage_new: update documentationAli Alzyod
Reviewers: cedric Reviewed By: cedric Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8757 Differential Revision: https://phab.enlightenment.org/D11991
2020-06-22eina_strbuf: resolve segfault when replace used with read_only bufferAli Alzyod
Summary: when eina_strbuf_replace is used by read_only buffer, this will cause segfault (access invalid memory) Reviewers: cedric Reviewed By: cedric Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8757 Differential Revision: https://phab.enlightenment.org/D11989
2020-06-20eina_unicode: have explicit type conversionsBoris Faure
Summary: Found by running terminology's tests with UBSAN: include/eina-1/eina/eina_inline_unicode.x: runtime error: implicit conversion from type 'char' of value -62 (8-bit, signed) to type 'unsigned char' changed the value to 194 (8-bit, unsigned) Reviewers: #reviewers, vtorri Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11972
2020-06-18meson: add Solaris supportVincent Torri
Summary: Add Solaris support for meson Test Plan: test on OpenIndiana Reviewers: raster, bu5hm4n, stefan_schmidt Reviewed By: raster, stefan_schmidt Subscribers: alarcher, stefan_schmidt, bu5hm4n, cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11973
2020-06-11eina: only enable EINA_LOG_BACKTRACE when backtrace API is presentDaniel Kolesa
This prevents build breakage on platforms that either don't have backtrace() or don't have the appropriate library for it installed.
2020-06-10Use extern after EAPIVincent Torri
Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org> Differential Revision: https://phab.enlightenment.org/D11961
2020-06-09eina - prefix - use smaller buffers for building stringsCarsten Haitzler (Rasterman)
use less stack space but no features as buffers are big enough for all content used or alloca'd now.
2020-06-09eina - abstratc content - smaller stack buffer for limited size stringCarsten Haitzler (Rasterman)
no need for a 4k buffer when 128 bytes will be plenty - short string.
2020-05-28build: make eina drag in the -lm flagMarcel Hollerbach
eina uses math.h we need to drag in this flag everywhere. Differential Revision: https://phab.enlightenment.org/D11896
2020-05-28build: rely on automatic pkg file generation for einaMarcel Hollerbach
this automatically brings it to efl-one, which makes this easier. Differential Revision: https://phab.enlightenment.org/D11892
2020-05-27build: add correct flags to efl-one.pcMarcel Hollerbach
they are required, and normally dragged in via eina.
2020-05-27refactor buildMarcel Hollerbach
libraries are split into deps, external deps, and pub deps. Evas engines are refactored to use the predefined engine deps. this is preparation work for efl-one. Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org> Differential Revision: https://phab.enlightenment.org/D11806
2020-05-26build: lib: harmonize the use of package_c_args in all libsStefan Schmidt
Add it to subprojects which are not using it and remove and old ELEMENTARY_BUILD define we no longer use. This allows us to have a central place in the main meson.build file to set this variable. Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de> Reviewed-by: Vincent Torri <vincent.torri@gmail.com> Reviewed-by: João Paulo Taylor Ienczak Zanette <joao.tiz@expertisesolutions.com.br> Differential Revision: https://phab.enlightenment.org/D11854
2020-05-25eina - dont use SCHED_BATCH or SCHED_IDLE unless they are definedCarsten Haitzler (Rasterman)
2020-05-23ecore thread - feedback threads should not be background threads...Carsten Haitzler (Rasterman)
if try_no_queue is used - its a thread that clearly wantt to be out of the queue to run on its own so probably wants to wake up accurately and thus not be a backgroun rpriority task but and urgent one. ensure we set up priority accordingly as we didn't before. this should fix scheduling when under load for vsync @fix
2020-05-18Revert "Fix EAPI definition by defining EFL_BUILD for each built DLL"Carsten Haitzler (Rasterman)
This reverts commit 3ade45cbc82bea1772c7ad1afb7e1ba5dd67d930.
2020-05-18Fix EAPI definition by defining EFL_BUILD for each built DLLVincent Torri
Summary: EAPI must be defined to dllexport when building DLL, and to dllimport when using these DLL. To achieve this, define EFL_BUILD for each library and module, and set DLL_EXPORT unconditionally. Static library are and will be not supported Test Plan: compilation Reviewers: zmike, raster, jptiz Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11834
2020-05-18systemd - make libsystemd use/supprot entirely runtime "dlopened"Carsten Haitzler (Rasterman)
so i've moved all systemd and elogind support to be runtime only with dlopen (eina_module) of libsystemd.so.0 (or libelogind.so.0 for elput) and finding of symbols manually at runtime (if the right code paths or env vars are set), thus remvoing the need to decide at compile time if efl needs systemd support or not as it no longer needs systemd headers/libs at compile time and just at runtime. this simplifies building a bit and makes efl more adaptive to the final target system at runtime.
2020-05-12build: fix void* use in pointer mathsMike Blumenkrantz
Summary: void* is an invalid type for calculating pointer offsets, so ensure that this is always cast to something else (e.g., char*) in the few cases where it's been misused Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11816
2020-05-09eina: resolve float comparison warningsMike Blumenkrantz
Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11786
2020-05-08doxygen docs: Put Eina XAttrs in their own groupXavi Artigas
To stop polluting the Eina Tools group.
2020-05-08doxygen docs: Complete docs for Eina ThreadXavi Artigas
2020-05-08doxygen docs: Fix grouping mess in Eina Simple XMLXavi Artigas
Seriously, who came up with such convoluted doxygen code?
2020-05-08doxygen docs: Complete docs for Eina ModuleXavi Artigas
And fix yet another doxygen grouping mess
2020-05-08doxygen docs: Complete docs for Eina LogXavi Artigas
2020-05-08doxygen docs: Complete docs for Eina CPU functionsXavi Artigas
2020-05-08doxygen docs: Complete docs for Eina_RectangleXavi Artigas
2020-05-07Use __func__ C99 identifier instead of __FUNCTION__ compiler extensionVincent Torri
Summary: see http://www.open-std.org/JTC1/SC22/wg14/www/docs/n1124.pdf section 6.4.2.2 page 52 Test Plan: compilation Reviewers: raster, devilhorns Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11785