diff mbox series

[2/4] arch: add missing predefines for PPC

Message ID 20191127022351.68902-3-luc.vanoostenryck@gmail.com (mailing list archive)
State Mainlined, archived
Headers show
Series More arch specific fixes | expand

Commit Message

Luc Van Oostenryck Nov. 27, 2019, 2:23 a.m. UTC
The macros __PPC, _ARCH_PPC & _ARCH_PPC64 are predefined by
GCC for powperpc (well, it seems __PPC isn't anymore but
it was, at least on my old tolchain for ppc32).

So, do the same here too.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
 lib.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Ramsay Jones Nov. 27, 2019, 4:57 p.m. UTC | #1
On 27/11/2019 02:23, Luc Van Oostenryck wrote:
> The macros __PPC, _ARCH_PPC & _ARCH_PPC64 are predefined by
> GCC for powperpc (well, it seems __PPC isn't anymore but
> it was, at least on my old tolchain for ppc32).

s/tolchain/toolchain/

ATB,
Ramsay Jones

> 
> So, do the same here too.
> 
> Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
> ---
>  lib.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/lib.c b/lib.c
> index 28ca49c7c..f0b546889 100644
> --- a/lib.c
> +++ b/lib.c
> @@ -1574,12 +1574,15 @@ static void predefined_macros(void)
>  		predefine("__powerpc64__", 1, "1");
>  		predefine("__ppc64__", 1, "1");
>  		predefine("__PPC64__", 1, "1");
> +		predefine("_ARCH_PPC64", 1, "1");
>  		/* fall-through */
>  	case MACH_PPC32:
>  		predefine("__powerpc__", 1, "1");
>  		predefine("__powerpc", 1, "1");
>  		predefine("__ppc__", 1, "1");
>  		predefine("__PPC__", 1, "1");
> +		predefine("__PPC", 1, "1");
> +		predefine("_ARCH_PPC", 1, "1");
>  		if (arch_big_endian)
>  			predefine("_BIG_ENDIAN", 1, "1");
>  		break;
>
diff mbox series

Patch

diff --git a/lib.c b/lib.c
index 28ca49c7c..f0b546889 100644
--- a/lib.c
+++ b/lib.c
@@ -1574,12 +1574,15 @@  static void predefined_macros(void)
 		predefine("__powerpc64__", 1, "1");
 		predefine("__ppc64__", 1, "1");
 		predefine("__PPC64__", 1, "1");
+		predefine("_ARCH_PPC64", 1, "1");
 		/* fall-through */
 	case MACH_PPC32:
 		predefine("__powerpc__", 1, "1");
 		predefine("__powerpc", 1, "1");
 		predefine("__ppc__", 1, "1");
 		predefine("__PPC__", 1, "1");
+		predefine("__PPC", 1, "1");
+		predefine("_ARCH_PPC", 1, "1");
 		if (arch_big_endian)
 			predefine("_BIG_ENDIAN", 1, "1");
 		break;