Commit 8a84de23b8f8fc63338dfcc58f572e33c428c1b7

Authored by j_mayer
1 parent a5b85f79

Fix compilation on Darwin platform, avoiding the use of gcc function attributes

(problem reported by Andreas Farber).
: ----------------------------------------------------------------------


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3292 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 3 changed files with 20 additions and 6 deletions
exec-all.h
... ... @@ -38,7 +38,7 @@
38 38 #endif
39 39  
40 40 #ifndef always_inline
41   -#if __GNUC__ < 3
  41 +#if (__GNUC__ < 3) || defined(__APPLE__)
42 42 #define always_inline inline
43 43 #else
44 44 #define always_inline __attribute__ (( always_inline )) inline
... ...
hw/ppc.c
... ... @@ -445,7 +445,7 @@ uint32_t cpu_ppc_load_tbl (CPUState *env)
445 445 return tb & 0xFFFFFFFF;
446 446 }
447 447  
448   -uint32_t cpu_ppc_load_tbu (CPUState *env)
  448 +static inline uint32_t _cpu_ppc_load_tbu (CPUState *env)
449 449 {
450 450 ppc_tb_t *tb_env = env->tb_env;
451 451 uint64_t tb;
... ... @@ -460,6 +460,11 @@ uint32_t cpu_ppc_load_tbu (CPUState *env)
460 460 return tb >> 32;
461 461 }
462 462  
  463 +uint32_t cpu_ppc_load_tbu (CPUState *env)
  464 +{
  465 + return _cpu_ppc_load_tbu(env);
  466 +}
  467 +
463 468 static inline void cpu_ppc_store_tb (ppc_tb_t *tb_env, int64_t *tb_offsetp,
464 469 uint64_t value)
465 470 {
... ... @@ -483,7 +488,7 @@ void cpu_ppc_store_tbl (CPUState *env, uint32_t value)
483 488 cpu_ppc_store_tb(tb_env, &tb_env->tb_offset, tb | (uint64_t)value);
484 489 }
485 490  
486   -void cpu_ppc_store_tbu (CPUState *env, uint32_t value)
  491 +static inline void _cpu_ppc_store_tbu (CPUState *env, uint32_t value)
487 492 {
488 493 ppc_tb_t *tb_env = env->tb_env;
489 494 uint64_t tb;
... ... @@ -494,6 +499,11 @@ void cpu_ppc_store_tbu (CPUState *env, uint32_t value)
494 499 ((uint64_t)value << 32) | tb);
495 500 }
496 501  
  502 +void cpu_ppc_store_tbu (CPUState *env, uint32_t value)
  503 +{
  504 + _cpu_ppc_store_tbu(env, value);
  505 +}
  506 +
497 507 uint32_t cpu_ppc_load_atbl (CPUState *env)
498 508 {
499 509 ppc_tb_t *tb_env = env->tb_env;
... ... @@ -738,10 +748,14 @@ clk_setup_cb cpu_ppc601_rtc_init (CPUState *env)
738 748 }
739 749  
740 750 void cpu_ppc601_store_rtcu (CPUState *env, uint32_t value)
741   -__attribute__ (( alias ("cpu_ppc_store_tbu") ));
  751 +{
  752 + _cpu_ppc_store_tbu(env, value);
  753 +}
742 754  
743 755 uint32_t cpu_ppc601_load_rtcu (CPUState *env)
744   -__attribute__ (( alias ("cpu_ppc_load_tbu") ));
  756 +{
  757 + return _cpu_ppc_load_tbu(env);
  758 +}
745 759  
746 760 void cpu_ppc601_store_rtcl (CPUState *env, uint32_t value)
747 761 {
... ...
... ... @@ -110,7 +110,7 @@ static inline char *realpath(const char *path, char *resolved_path)
110 110 #endif
111 111  
112 112 #ifndef always_inline
113   -#if __GNUC__ < 3
  113 +#if (__GNUC__ < 3) || defined(__APPLE__)
114 114 #define always_inline inline
115 115 #else
116 116 #define always_inline __attribute__ (( always_inline )) inline
... ...