[asterisk-scf-commits] asterisk-scf/integration/ice.git branch "icebox-lib-path" created.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Fri Feb 18 12:42:57 CST 2011


branch "icebox-lib-path" has been created
        at  e5ecd3176d4b92de9f90773d79a18ea3987e64f3 (commit)

- Log -----------------------------------------------------------------
commit e5ecd3176d4b92de9f90773d79a18ea3987e64f3
Author: David M. Lee <dlee at digium.com>
Date:   Fri Oct 1 13:04:24 2010 -0500

    Changed split between libPath and libName from / to @.  Makes more
    sense, since libName isn't actually the file name.

diff --git a/cpp/src/Ice/DynamicLibrary.cpp b/cpp/src/Ice/DynamicLibrary.cpp
index 6fd0605..254fa32 100755
--- a/cpp/src/Ice/DynamicLibrary.cpp
+++ b/cpp/src/Ice/DynamicLibrary.cpp
@@ -48,10 +48,14 @@ IceInternal::DynamicLibrary::~DynamicLibrary()
 IceInternal::DynamicLibrary::symbol_type
 IceInternal::DynamicLibrary::loadEntryPoint(const string& entryPoint, bool useIceVersion)
 {
+    // entryPoint format: [libPath@]libName[,version]:funcName
     string::size_type colon = entryPoint.rfind(':');
     string::size_type comma = entryPoint.find(',');
+    string::size_type at = entryPoint.find('@');
     if(colon == string::npos || colon == entryPoint.size() - 1 ||
-        (comma != string::npos && (comma > colon || comma == colon - 1)))
+        (comma != string::npos && (comma > colon || comma == colon - 1)) ||
+        (at != string::npos && (at >= colon - 1 ||
+            (comma != string::npos && at >= comma - 1))))
     {
         _err = "invalid entry point format `" + entryPoint + "'";
         return 0;
@@ -87,22 +91,12 @@ IceInternal::DynamicLibrary::loadEntryPoint(const string& entryPoint, bool useIc
         version = libSpec.substr(comma + 1);
     }
 
-    string lib;
-    string libPath;
+    string lib, libPath;
 
-    string::size_type lastSlash = libName.rfind('/');
-#ifdef _WIN32
-    // on Windows, also search for backslash
-    if (lastSlash == string::npos)
-    {
-        lastSlash = libName.rfind('\\');
-    }
-#endif
-
-    if (lastSlash != string::npos)
+    if (at != string::npos)
     {
-        libPath = libName.substr(0, lastSlash + 1);
-        libName = libName.substr(lastSlash + 1);
+        libPath = libName.substr(0, at) + '/';
+        libName = libName.substr(at + 1);
     }
 
 

commit eae93248c9ebcea554e699d9e9b1d3e8992e84f4
Author: David M. Lee <dlee at digium.com>
Date:   Fri Oct 1 12:53:27 2010 -0500

    Fixed Windows compile issues.

diff --git a/cpp/src/Ice/DynamicLibrary.cpp b/cpp/src/Ice/DynamicLibrary.cpp
index 6e19cfe..6fd0605 100755
--- a/cpp/src/Ice/DynamicLibrary.cpp
+++ b/cpp/src/Ice/DynamicLibrary.cpp
@@ -108,9 +108,10 @@ IceInternal::DynamicLibrary::loadEntryPoint(const string& entryPoint, bool useIc
 
 #ifdef _WIN32
     // convert forward slash to back slash
-    while ((string::size_type slash = libPath.find('/')) != string::npos)
+    string::size_type slash;
+    while ((slash = libPath.find('/')) != string::npos)
     {
-        libPath.replace(slash, '\\');
+        libPath.replace(slash, 1, 1, '\\');
     }
     lib = libPath + libName;
 

commit 4a8ee9d55fa972dec7700303697c3842a9b3a27e
Author: David M. Lee <dlee at digium.com>
Date:   Tue Sep 28 13:32:42 2010 -0500

    Add path to lib name

diff --git a/cpp/src/Ice/DynamicLibrary.cpp b/cpp/src/Ice/DynamicLibrary.cpp
old mode 100644
new mode 100755
index c9be971..6e19cfe
--- a/cpp/src/Ice/DynamicLibrary.cpp
+++ b/cpp/src/Ice/DynamicLibrary.cpp
@@ -88,9 +88,31 @@ IceInternal::DynamicLibrary::loadEntryPoint(const string& entryPoint, bool useIc
     }
 
     string lib;
+    string libPath;
 
+    string::size_type lastSlash = libName.rfind('/');
 #ifdef _WIN32
-    lib = libName;
+    // on Windows, also search for backslash
+    if (lastSlash == string::npos)
+    {
+        lastSlash = libName.rfind('\\');
+    }
+#endif
+
+    if (lastSlash != string::npos)
+    {
+        libPath = libName.substr(0, lastSlash + 1);
+        libName = libName.substr(lastSlash + 1);
+    }
+
+
+#ifdef _WIN32
+    // convert forward slash to back slash
+    while ((string::size_type slash = libPath.find('/')) != string::npos)
+    {
+        libPath.replace(slash, '\\');
+    }
+    lib = libPath + libName;
 
 #   ifdef COMPSUFFIX
     //
@@ -112,14 +134,14 @@ IceInternal::DynamicLibrary::loadEntryPoint(const string& entryPoint, bool useIc
 
     lib += ".dll";
 #elif defined(__APPLE__)
-    lib = "lib" + libName;
+    lib = libPath + "lib" + libName;
     if(!version.empty()) 
     {
         lib += "." + version;
     }
     lib += ".dylib";
 #elif defined(__hpux)
-    lib = "lib" + libName;
+    lib = libPath + "lib" + libName;
     if(!version.empty())
     {
         lib += "." + version;
@@ -129,14 +151,14 @@ IceInternal::DynamicLibrary::loadEntryPoint(const string& entryPoint, bool useIc
         lib += ".sl";
     }
 #elif defined(_AIX)
-    lib = "lib" + libName + ".a(lib" + libName + ".so";
+    lib = libPath + "lib" + libName + ".a(lib" + libName + ".so";
     if(!version.empty())
     {
         lib += "." + version;
     }
     lib += ")";
 #else
-    lib = "lib" + libName + ".so";
+    lib = libPath + "lib" + libName + ".so";
     if(!version.empty())
     {
         lib += "." + version;

-----------------------------------------------------------------------


-- 
asterisk-scf/integration/ice.git



More information about the asterisk-scf-commits mailing list