From a877b4dce9c864aedf08275d804d36fee65ccf9d Mon Sep 17 00:00:00 2001 From: Trung Nguyen Date: Mon, 8 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 2305a55755..6ab98a4a02 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 e0e56cd2df..543ba9dd4f 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 e2fa55a345..1b56931492 100644 --- a/gcc/gcc/config/i386/haiku64.h +++ b/gcc/gcc/config/i386/haiku64.h @@ -42,9 +42,9 @@ Boston, MA 02111-1307, USA. */ { \ 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 ce43a66656..2b117fcb13 100644 --- a/gcc/gcc/config/m68k/haiku.h +++ b/gcc/gcc/config/m68k/haiku.h @@ -69,8 +69,6 @@ Boston, MA 02110-1301, USA. */ 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 870173d2e2..aa3dcded9f 100644 --- a/gcc/gcc/config/mips/haiku.h +++ b/gcc/gcc/config/mips/haiku.h @@ -27,8 +27,6 @@ Boston, MA 02111-1307, USA. */ 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 fee7c3c28f..8c2e8054b8 100644 --- a/gcc/gcc/config/rs6000/haiku.h +++ b/gcc/gcc/config/rs6000/haiku.h @@ -35,8 +35,6 @@ Boston, MA 02111-1307, USA. */ 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"); \