activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r722896 - /activemq/activemq-cpp/trunk/src/main/decaf/lang/System.cpp
Date Wed, 03 Dec 2008 14:15:12 GMT
Author: tabish
Date: Wed Dec  3 06:15:11 2008
New Revision: 722896

URL: http://svn.apache.org/viewvc?rev=722896&view=rev
Log:
http://issues.apache.org/activemq/browse/AMQCPP-210

Submitting user patch for Mac OS/X iphone link error.

Modified:
    activemq/activemq-cpp/trunk/src/main/decaf/lang/System.cpp

Modified: activemq/activemq-cpp/trunk/src/main/decaf/lang/System.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/lang/System.cpp?rev=722896&r1=722895&r2=722896&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/lang/System.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/decaf/lang/System.cpp Wed Dec  3 06:15:11 2008
@@ -208,21 +208,35 @@
     return buffer;
 }
 
-#else
+#elif defined(_APPLE_)
 
 ////////////////////////////////////////////////////////////////////////////////
-extern char** environ;
+char*** _NSGetEnviron();
 
 ////////////////////////////////////////////////////////////////////////////////
 std::vector<std::string> System::getEnvArray() {
 
     std::vector<std::string> buffer;
-    int count = 0;
+
+    char **environ = *_NSGetEnviron();
 
     for( int i = 0; *(environ + i); i++ ){
-        count++;
+        buffer.push_back( environ[i] );
     }
 
+    return buffer;
+}
+
+#else
+
+////////////////////////////////////////////////////////////////////////////////
+extern char** environ;
+
+////////////////////////////////////////////////////////////////////////////////
+std::vector<std::string> System::getEnvArray() {
+
+    std::vector<std::string> buffer;
+
     for( int i = 0; *(environ + i); i++ ){
         buffer.push_back( environ[i] );
     }



Mime
View raw message