From a877b4dce9c864aedf08275d804d36fee65ccf9d Mon Sep 17 00:00:00 2001 From: Trung Nguyen Date: Mon, 08 May 2023 18:49:58 +1000 Subject: [PATCH] gcc/config: Drop cdecl and stdcall built-in defines Droped the `__cdecl` and `__stdcall` built-in macros except for 32-bit i386 compilation. These macros refer to calling conventions that are specific to 32-bit x86 and have no meaning for other architectures. Using them does nothing except producing a compiler warning. These macros were present in BeOS times but only for i386. At the time of writing, they are not used anywhere throughout the Haiku source tree, and some HaikuPorts recipes even have to provide workarounds for these macros' prescence. Change-Id: I70369a64a71d8e29ccc0bd6282ba93832c1a6adf Reviewed-on: https://review.haiku-os.org/c/buildtools/+/6384 Reviewed-by: Adrien Destugues Reviewed-by: Niels Sascha Reedijk --- gcc/gcc/config/aarch64/aarch64-haiku.h | 2 -- gcc/gcc/config/arm/haiku.h | 2 -- gcc/gcc/config/i386/haiku64.h | 4 ++-- gcc/gcc/config/m68k/haiku.h | 2 -- gcc/gcc/config/mips/haiku.h | 2 -- gcc/gcc/config/rs6000/haiku.h | 2 -- 6 files changed, 2 insertions(+), 12 deletions(-) diff --git a/gcc/gcc/config/aarch64/aarch64-haiku.h b/gcc/gcc/config/aarch64/aarch64-haiku.h index 2305a55..6ab98a4 100644 --- a/gcc/gcc/config/aarch64/aarch64-haiku.h +++ b/gcc/gcc/config/aarch64/aarch64-haiku.h @@ -26,8 +26,6 @@ do \ { \ builtin_define ("__HAIKU__"); \ - builtin_define ("__stdcall=__attribute__((__stdcall__))"); \ - builtin_define ("__cdecl=__attribute__((__cdecl__))"); \ builtin_define ("__STDC_ISO_10646__=201103L"); \ builtin_assert ("system=haiku"); \ } \ diff --git a/gcc/gcc/config/arm/haiku.h b/gcc/gcc/config/arm/haiku.h index e0e56cd..543ba9d 100644 --- a/gcc/gcc/config/arm/haiku.h +++ b/gcc/gcc/config/arm/haiku.h @@ -53,8 +53,6 @@ builtin_define ("__HAIKU__"); \ builtin_define ("__ARM__"); \ builtin_define ("__arm__"); \ - builtin_define ("__stdcall=__attribute__((__stdcall__))"); \ - builtin_define ("__cdecl=__attribute__((__cdecl__))"); \ builtin_define ("__STDC_ISO_10646__=201103L"); \ builtin_assert ("system=haiku"); \ TARGET_BPABI_CPP_BUILTINS(); \ diff --git a/gcc/gcc/config/i386/haiku64.h b/gcc/gcc/config/i386/haiku64.h index e2fa55a..1b56931 100644 --- a/gcc/gcc/config/i386/haiku64.h +++ b/gcc/gcc/config/i386/haiku64.h @@ -42,9 +42,9 @@ { \ builtin_define ("__INTEL__"); \ builtin_define ("__X86__"); \ + builtin_define ("__stdcall=__attribute__((__stdcall__))"); \ + builtin_define ("__cdecl=__attribute__((__cdecl__))"); \ } \ - builtin_define ("__stdcall=__attribute__((__stdcall__))"); \ - builtin_define ("__cdecl=__attribute__((__cdecl__))"); \ builtin_define ("__STDC_ISO_10646__=201103L"); \ builtin_assert ("system=haiku"); \ } \ diff --git a/gcc/gcc/config/m68k/haiku.h b/gcc/gcc/config/m68k/haiku.h index ce43a66..2b117fc 100644 --- a/gcc/gcc/config/m68k/haiku.h +++ b/gcc/gcc/config/m68k/haiku.h @@ -69,8 +69,6 @@ builtin_define ("__M68K__"); \ builtin_define_std ("mc68000"); \ builtin_define_std ("mc68020"); \ - builtin_define ("__stdcall=__attribute__((__stdcall__))"); \ - builtin_define ("__cdecl=__attribute__((__cdecl__))"); \ builtin_define ("__STDC_ISO_10646__=201103L"); \ builtin_assert ("system=haiku"); \ } \ diff --git a/gcc/gcc/config/mips/haiku.h b/gcc/gcc/config/mips/haiku.h index 870173d..aa3dcde 100644 --- a/gcc/gcc/config/mips/haiku.h +++ b/gcc/gcc/config/mips/haiku.h @@ -27,8 +27,6 @@ builtin_define ("__MIPS__"); \ builtin_define ("__MIPSEL__"); \ builtin_define ("_MIPSEL_"); \ - builtin_define ("__stdcall=__attribute__((__stdcall__))"); \ - builtin_define ("__cdecl=__attribute__((__cdecl__))"); \ builtin_define ("__STDC_ISO_10646__=201103L"); \ builtin_assert ("system=haiku"); \ if (flag_pic) \ diff --git a/gcc/gcc/config/rs6000/haiku.h b/gcc/gcc/config/rs6000/haiku.h index fee7c3c..8c2e805 100644 --- a/gcc/gcc/config/rs6000/haiku.h +++ b/gcc/gcc/config/rs6000/haiku.h @@ -35,8 +35,6 @@ builtin_define ("__HAIKU__"); \ builtin_define ("__POWERPC__"); \ builtin_define ("__powerpc__"); \ - builtin_define ("__stdcall=__attribute__((__stdcall__))"); \ - builtin_define ("__cdecl=__attribute__((__cdecl__))"); \ builtin_define ("__STDC_ISO_10646__=201103L"); \ builtin_assert ("system=haiku"); \ builtin_assert ("cpu=powerpc"); \ -- gitore 0.2.2