[asterisk-scf-commits] asterisk-scf/release/ice.git branch "icebox-lib-path" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Fri Oct 1 13:05:02 CDT 2010


branch "icebox-lib-path" has been updated
       via  e5ecd3176d4b92de9f90773d79a18ea3987e64f3 (commit)
       via  eae93248c9ebcea554e699d9e9b1d3e8992e84f4 (commit)
      from  4a8ee9d55fa972dec7700303697c3842a9b3a27e (commit)

Summary of changes:
 cpp/src/Ice/DynamicLibrary.cpp |   29 ++++++++++++-----------------
 1 files changed, 12 insertions(+), 17 deletions(-)


- 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;
 

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


-- 
asterisk-scf/release/ice.git



More information about the asterisk-scf-commits mailing list