You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2009/04/27 16:51:13 UTC
svn commit: r769008 -
/activemq/activemq-cpp/branches/activemq-cpp-2.x/src/main/decaf/lang/System.cpp
Author: tabish
Date: Mon Apr 27 14:51:12 2009
New Revision: 769008
URL: http://svn.apache.org/viewvc?rev=769008&view=rev
Log:
Fix for AMQCPP-210
Modified:
activemq/activemq-cpp/branches/activemq-cpp-2.x/src/main/decaf/lang/System.cpp
Modified: activemq/activemq-cpp/branches/activemq-cpp-2.x/src/main/decaf/lang/System.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/branches/activemq-cpp-2.x/src/main/decaf/lang/System.cpp?rev=769008&r1=769007&r2=769008&view=diff
==============================================================================
--- activemq/activemq-cpp/branches/activemq-cpp-2.x/src/main/decaf/lang/System.cpp (original)
+++ activemq/activemq-cpp/branches/activemq-cpp-2.x/src/main/decaf/lang/System.cpp Mon Apr 27 14:51:12 2009
@@ -208,29 +208,14 @@
return buffer;
}
-#elif defined(_APPLE_)
-
-////////////////////////////////////////////////////////////////////////////////
-char*** _NSGetEnviron();
-
-////////////////////////////////////////////////////////////////////////////////
-std::vector<std::string> System::getEnvArray() {
-
- std::vector<std::string> buffer;
-
- char **environ = *_NSGetEnviron();
-
- for( int i = 0; *(environ + i); i++ ){
- buffer.push_back( environ[i] );
- }
-
- return buffer;
-}
-
#else
-////////////////////////////////////////////////////////////////////////////////
-extern char** environ;
+#if defined(__APPLE__)
+ #include <crt_externs.h>
+ #define environ (*_NSGetEnviron())
+#else
+ extern char** environ;
+#endif
////////////////////////////////////////////////////////////////////////////////
std::vector<std::string> System::getEnvArray() {
@@ -245,3 +230,4 @@
}
#endif
+