Seems to me there is little benefit of inlining this function, but this
also had a pervert effect on Windows and C++ with some recent mingw
versions. Mingw failed its implementation of pthread_cleanup_pop(). It
does not compile when compiled in C++. There is a type mismatch that is
caught by the compiler, and everything goes nuts...
This made the EFL build fail because some files of ecore_win32 are C++
sources, and they require Eina... so this macro appears in a C++ code
indirectly, because of its inlining.
By removing the inlining, this build issue is fixed. Will also fix
builds of other programs that would have used Eina.h in their C++
programs :)
pthread_testcancel();
}
+EAPI void *
+eina_thread_cancellable_run(Eina_Thread_Cancellable_Run_Cb cb, Eina_Free_Cb cleanup_cb, void *data)
+{
+ Eina_Bool old = EINA_FALSE;
+ void *ret;
+
+ EINA_THREAD_CLEANUP_PUSH(cleanup_cb, data);
+ eina_thread_cancellable_set(EINA_TRUE, &old); // is a cancellation point
+ ret = cb(data); // may not run if was previously canceled
+ EINA_THREAD_CLEANUP_POP(EINA_TRUE);
+ eina_thread_cancellable_set(old, NULL);
+ return ret;
+}
+
EAPI const void *EINA_THREAD_JOIN_CANCELED = PTHREAD_CANCELED;
Eina_Bool
*
* @since 1.19
*/
-static inline void *
-eina_thread_cancellable_run(Eina_Thread_Cancellable_Run_Cb cb, Eina_Free_Cb cleanup_cb, void *data)
-{
- Eina_Bool old = EINA_FALSE;
- void *ret;
-
- EINA_THREAD_CLEANUP_PUSH(cleanup_cb, data);
- eina_thread_cancellable_set(EINA_TRUE, &old); // is a cancellation point
- ret = cb(data); // may not run if was previously canceled
- EINA_THREAD_CLEANUP_POP(EINA_TRUE);
- eina_thread_cancellable_set(old, NULL);
- return ret;
-}
+EAPI void *eina_thread_cancellable_run(Eina_Thread_Cancellable_Run_Cb cb, Eina_Free_Cb cleanup_cb, void *data);
/**
* @}