diff options
author | David Schleef <ds@schleef.org> | 2007-02-15 00:41:39 +0000 |
---|---|---|
committer | David Schleef <ds@schleef.org> | 2007-02-15 00:41:39 +0000 |
commit | 234c4df2f32e9517377321efc3802a9683794058 (patch) | |
tree | 23225ec9f7b523dd6668c7b82e60a85060e2d105 /examples | |
parent | 928749c87cf769dbcd3840b972948ca8178e58ab (diff) | |
download | liboil-234c4df2f32e9517377321efc3802a9683794058.tar.gz |
* examples/printcpu.c:
* liboil/liboilcpu.c:
* liboil/c/swab.c:
* liboil/powerpc/md5.c:
Compile fixes on OS/X (powerpc).
Diffstat (limited to 'examples')
-rw-r--r-- | examples/printcpu.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/examples/printcpu.c b/examples/printcpu.c index a93b539..00b4154 100644 --- a/examples/printcpu.c +++ b/examples/printcpu.c @@ -46,7 +46,7 @@ string_append (char *str, const char *append) if (str) { size_t size = strlen (str) + 2 + strlen (append) + 1; ret = malloc (size); - snprintf (ret, size, "%s, %s", str, append); + snprintf (ret, size, "%s %s", str, append); free (str); } else { ret = strdup (append); @@ -57,10 +57,8 @@ string_append (char *str, const char *append) static char * oil_cpu_flags_to_string (unsigned int flags) { - char *ret; + char *ret = NULL; - ret = strdup (""); - #if defined(__i386__) || defined(__amd64__) if (flags & OIL_IMPL_FLAG_CMOV) ret = string_append (ret, "cmov"); @@ -79,10 +77,13 @@ oil_cpu_flags_to_string (unsigned int flags) if (flags & OIL_IMPL_FLAG_SSE3) ret = string_append (ret, "sse3"); #endif -#if defined(__powerpc__) +#if defined(__powerpc__) || defined(__ppc__) || defined(__PPC__) if (flags & OIL_IMPL_FLAG_ALTIVEC) ret = string_append (ret, "altivec"); #endif + if (ret == NULL) { + ret = strdup (""); + } return ret; } |