mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-29 08:23:01 +01:00
fix use of environ in shared library on OS X
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@8571 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
065f841eab
commit
25024467b9
1 changed files with 17 additions and 0 deletions
|
|
@ -23,7 +23,12 @@
|
|||
#include "pbd/epa.h"
|
||||
#include "pbd/strsplit.h"
|
||||
|
||||
#ifdef __APPLE__
|
||||
#include <crt_externs.h>
|
||||
#define environ (*_NSGetEnviron())
|
||||
#else
|
||||
extern char** environ;
|
||||
#endif
|
||||
|
||||
using namespace PBD;
|
||||
using namespace std;
|
||||
|
|
@ -55,14 +60,26 @@ EnvironmentalProtectionAgency::arm ()
|
|||
void
|
||||
EnvironmentalProtectionAgency::save ()
|
||||
{
|
||||
/* do this to avoid lots of calls to _NSGetEnviron() on OS X */
|
||||
char** the_environ = environ;
|
||||
|
||||
e.clear ();
|
||||
|
||||
<<<<<<< .mine
|
||||
for (size_t i = 0; the_environ[i]; ++i) {
|
||||
=======
|
||||
if (!_envname.empty()) {
|
||||
|
||||
/* fetch environment from named environment variable, rather than "environ"
|
||||
*/
|
||||
>>>>>>> .r8570
|
||||
|
||||
<<<<<<< .mine
|
||||
string estring = the_environ[i];
|
||||
string::size_type equal = estring.find_first_of ('=');
|
||||
=======
|
||||
const char* estr = getenv (_envname.c_str());
|
||||
>>>>>>> .r8570
|
||||
|
||||
if (!estr) {
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue