raster pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=8ed6324a31a3f07cee3c604ccf410d9a4d7048df

commit 8ed6324a31a3f07cee3c604ccf410d9a4d7048df
Author: Carsten Haitzler (Rasterman) <ras...@rasterman.com>
Date:   Fri Oct 11 08:13:35 2013 +0900

    ecore-con - followup commit to curl dynamic load - support win and osx names
---
 src/lib/ecore_con/ecore_con_url.c | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/src/lib/ecore_con/ecore_con_url.c 
b/src/lib/ecore_con/ecore_con_url.c
index 959ca94..4e4c19d 100644
--- a/src/lib/ecore_con/ecore_con_url.c
+++ b/src/lib/ecore_con/ecore_con_url.c
@@ -247,9 +247,26 @@ _c_init(void)
    if (_c_fail) return EINA_FALSE;
    _c = calloc(1, sizeof(Ecore_Con_Curl));
    if (!_c) goto error;
-   _c->mod = eina_module_new("libcurl.so.4");
+
+#define LOAD(x) \
+   if (!_c->mod) { \
+      if ((_c->mod = eina_module_new(x))) { \
+         if (!eina_module_load(_c->mod)) { \
+            eina_module_free(_c->mod); \
+            _c->mod = NULL; \
+         } \
+      } \
+   }
+#if defined(_WIN32) || defined(__CYGWIN__)
+   LOAD("libcurl.dll"); // try 1
+   LOAD("curllib.dll"); // if fail try 2
+#elif defined(__APPLE__) && defined(__MACH__)
+   LOAD("libcurl.4.dylib"); // try 1
+   LOAD("libcurl.so.4"); // if fail try 2
+#else   
+   LOAD("libcurl.so.4"); // try only
+#endif   
    if (!_c->mod) goto error;
-   if (!eina_module_load(_c->mod)) goto error;
 
 #define SYM(x) if (!(_c->x = eina_module_symbol_get(_c->mod, #x))) goto error
    SYM(curl_global_init);

-- 


Reply via email to