Commit 1eff7fbf116790aaacc8f89def68be11149626cc

Authored by malc
1 parent 291c6ff9

Do not rely on __powerpc__ being defined as a feature test macro

__powerpc__ is not defined on AIX and Darwin, Makefile.target adds
it to CPPFLAGS for target specific code which cache-utils are not.

Since there's not common definition which can safely be used on all
platforms use HOST_PPC provided by config-host.h

The problem was originally reported by C. W. Betts

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6292 c046a42c-6fe2-441c-8c8c-71466251a162
cache-utils.c
1 #include "cache-utils.h" 1 #include "cache-utils.h"
2 2
3 -#ifdef __powerpc__ 3 +#ifdef HOST_PPC
4 struct qemu_cache_conf qemu_cache_conf = { 4 struct qemu_cache_conf qemu_cache_conf = {
5 .dcache_bsize = 16, 5 .dcache_bsize = 16,
6 .icache_bsize = 16 6 .icache_bsize = 16
@@ -68,4 +68,4 @@ void qemu_cache_utils_init(char **envp) @@ -68,4 +68,4 @@ void qemu_cache_utils_init(char **envp)
68 } 68 }
69 #endif 69 #endif
70 70
71 -#endif /* __powerpc__ */ 71 +#endif /* HOST_PPC */
cache-utils.h
1 #ifndef QEMU_CACHE_UTILS_H 1 #ifndef QEMU_CACHE_UTILS_H
2 #define QEMU_CACHE_UTILS_H 2 #define QEMU_CACHE_UTILS_H
3 3
4 -#ifdef __powerpc__ 4 +#include "config-host.h"
  5 +
  6 +#ifdef HOST_PPC
5 struct qemu_cache_conf { 7 struct qemu_cache_conf {
6 unsigned long dcache_bsize; 8 unsigned long dcache_bsize;
7 unsigned long icache_bsize; 9 unsigned long icache_bsize;