From 3accf44add6471c5e5890e53bed8b95b6eb0b573 Mon Sep 17 00:00:00 2001 From: Avuton Olrich Date: Sat, 22 Apr 2006 21:30:48 +0000 Subject: Solaris is reported to not have a setenv() thus breaking compilation. This fixes that problem with a macro that emulates setenv() with putenv(). git-svn-id: https://svn.musicpd.org/mpd/trunk@4097 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- src/main.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index 2f0bf870a..d0e64a27e 100644 --- a/src/main.c +++ b/src/main.c @@ -67,6 +67,18 @@ typedef struct _Options { int updateDB; } Options; +/* Solaris has been reported to have no setenv + * putenv() will automatically overwrite, so + * the overwrite macro will go unused + */ +#ifndef setenv +#define setenv(name,value,overwrite) { \ + char * tmp = NULL; \ + sprintf(tmp,"%s=%s",name,value); \ + putenv(tmp); \ +} +#endif /* setenv */ + void usage(char * argv[]) { ERROR("usage:\n"); ERROR(" %s [options] \n",argv[0]); -- cgit v1.2.3