Mercurial > mplayer.hg
annotate osdep/setenv.c @ 22697:2fe9bd97a7f6
Fix configure -march detection for athlon-xp
The configure script uses SSE support to distinguish between athlon and
athlon-xp, but SSE support was tested _after_ deciding the basic CPU
type. Thus athlon-xp was always misdetected as athlon. Fix this by
moving the CPU extensions check before the CPU type check. Patch from
Andrew Savchenko, bircoph list ru.
author | uau |
---|---|
date | Sun, 18 Mar 2007 13:38:55 +0000 |
parents | 936209c39ed1 |
children | 5cfef41a1771 |
rev | line source |
---|---|
17245 | 1 /* setenv implementation for systems lacking it. */ |
2 | |
21853 | 3 #include "config.h" |
17245 | 4 |
5 #include <stdlib.h> | |
6 #include <string.h> | |
7 #ifndef MP_DEBUG | |
8 #define NDEBUG | |
9 #endif | |
10 #include <assert.h> | |
11 | |
12 int setenv(const char *name, const char *val, int overwrite) | |
13 { | |
14 int len = strlen(name) + strlen(val) + 2; | |
15 char *env = malloc(len); | |
16 if (!env) { return -1; } | |
17 | |
18 assert(overwrite != 0); | |
19 | |
20 strcpy(env, name); | |
21 strcat(env, "="); | |
22 strcat(env, val); | |
23 putenv(env); | |
24 | |
25 return 0; | |
26 } |