From 7f69abea30d4f4dc0c6002e7f8a435bff868322d Mon Sep 17 00:00:00 2001 From: prascle Date: Mon, 17 Jan 2005 12:58:54 +0000 Subject: [PATCH] PR: add a #if defined __GNUC__ to use setenv or putenv. todo: replace by an autoconf macro to check existence of setenv --- src/Container/Component_i.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Container/Component_i.cxx b/src/Container/Component_i.cxx index 0e28bd47d..880bb0438 100644 --- a/src/Container/Component_i.cxx +++ b/src/Container/Component_i.cxx @@ -193,6 +193,10 @@ void Engines_Component_i::beginService(const char *serviceName) { const char* value; (*it).second >>= value; + // --- todo: replace __GNUC__ test by an autoconf macro AC_CHECK_FUNC... +#if defined __GNUC__ + int ret = setenv(cle.c_str(), value, overwrite); +#else //CCRT porting : setenv not defined in stdlib.h std::string s(cle); s+='='; @@ -200,7 +204,7 @@ void Engines_Component_i::beginService(const char *serviceName) //char* cast because 1st arg of linux putenv function is not a const char* !!! int ret=putenv((char *)s.c_str()); //End of CCRT porting - //int ret = setenv(cle.c_str(), value, overwrite); +#endif MESSAGE("--- setenv: "<