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
This commit is contained in:
Avuton Olrich 2006-04-22 21:30:48 +00:00
parent d6d2ca7be8
commit 3accf44add

View File

@ -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] <conf file>\n",argv[0]);