From 234c4df2f32e9517377321efc3802a9683794058 Mon Sep 17 00:00:00 2001 From: David Schleef Date: Thu, 15 Feb 2007 00:41:39 +0000 Subject: * examples/printcpu.c: * liboil/liboilcpu.c: * liboil/c/swab.c: * liboil/powerpc/md5.c: Compile fixes on OS/X (powerpc). --- examples/printcpu.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'examples') 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; } -- cgit v1.2.1