From 3aab0064e544b4b82ad815178e90c4fee3f415da Mon Sep 17 00:00:00 2001 From: Juergen Keil Date: Mon, 21 Jan 2002 09:52:48 +0000 Subject: provide a "setenv" implementation, when it's missing in libc CVS patchset: 1433 CVS date: 2002/01/21 09:52:48 --- src/xine-utils/xineutils.h | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/xine-utils/xineutils.h b/src/xine-utils/xineutils.h index fda43ad98..609e14f29 100644 --- a/src/xine-utils/xineutils.h +++ b/src/xine-utils/xineutils.h @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: xineutils.h,v 1.6 2002/01/02 18:16:08 jkeil Exp $ + * $Id: xineutils.h,v 1.7 2002/01/21 09:52:48 jkeil Exp $ * */ #ifndef XINEUTILS_H @@ -699,6 +699,24 @@ static inline char *_x_strsep(char **stringp, const char *delim) { #endif +#ifdef HAVE_SETENV +#define xine_setenv setenv +#else +static inline void _x_setenv(const char *name, const char *val, int _xx) +{ + int len = strlen(name) + strlen(val) + 2; + char *env = malloc(len); + + if (env != NULL) { + strcpy(env, name); + strcat(env, "="); + strcat(env, val); + putenv(env); + } +} +#define xine_setenv _x_setenv +#endif + #ifdef __cplusplus } #endif -- cgit v1.2.3