diff options
author | Juergen Keil <jkeil@users.sourceforge.net> | 2002-01-21 09:52:48 +0000 |
---|---|---|
committer | Juergen Keil <jkeil@users.sourceforge.net> | 2002-01-21 09:52:48 +0000 |
commit | 3aab0064e544b4b82ad815178e90c4fee3f415da (patch) | |
tree | 0e0211fade9f959cfde9968cab98340600d17dfd /src | |
parent | b5be48a4424324693d34788dfd7a50fdd608744a (diff) | |
download | xine-lib-3aab0064e544b4b82ad815178e90c4fee3f415da.tar.gz xine-lib-3aab0064e544b4b82ad815178e90c4fee3f415da.tar.bz2 |
provide a "setenv" implementation, when it's missing in libc
CVS patchset: 1433
CVS date: 2002/01/21 09:52:48
Diffstat (limited to 'src')
-rw-r--r-- | src/xine-utils/xineutils.h | 20 |
1 files changed, 19 insertions, 1 deletions
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 |