[PATCH 3/6] [WineGcc]: on x86-64, don't define twice the fastcall macros

Eric Pouech eric.pouech at orange.fr
Mon Apr 19 15:33:33 CDT 2010




A+
---

 tools/winegcc/winegcc.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)


diff --git a/tools/winegcc/winegcc.c b/tools/winegcc/winegcc.c
index 7023ff4..a5f7004 100644
--- a/tools/winegcc/winegcc.c
+++ b/tools/winegcc/winegcc.c
@@ -360,6 +360,7 @@ static void compile(struct options* opts, const char* lang)
 
     if (gcc_defs)
     {
+        int fastcall_done = 0;
         if (opts->target_cpu == CPU_x86_64)
         {
             strarray_add(comp_args, "-D__stdcall=__attribute__((ms_abi))");
@@ -368,6 +369,7 @@ static void compile(struct options* opts, const char* lang)
             strarray_add(comp_args, "-D_cdecl=__attribute__((ms_abi))");
             strarray_add(comp_args, "-D__fastcall=__attribute__((ms_abi))");
             strarray_add(comp_args, "-D_fastcall=__attribute__((ms_abi))");
+            fastcall_done = 1;
         }
         else if (opts->target_platform == PLATFORM_APPLE)
         {
@@ -385,8 +387,11 @@ static void compile(struct options* opts, const char* lang)
             strarray_add(comp_args, "-D_cdecl=__attribute__((__cdecl__))");
         }
 
-	strarray_add(comp_args, "-D__fastcall=__attribute__((__fastcall__))");
-	strarray_add(comp_args, "-D_fastcall=__attribute__((__fastcall__))");
+	if (!fastcall_done)
+        {
+            strarray_add(comp_args, "-D__fastcall=__attribute__((__fastcall__))");
+            strarray_add(comp_args, "-D_fastcall=__attribute__((__fastcall__))");
+        }
 	strarray_add(comp_args, "-D__declspec(x)=__declspec_##x");
 	strarray_add(comp_args, "-D__declspec_align(x)=__attribute__((aligned(x)))");
 	strarray_add(comp_args, "-D__declspec_allocate(x)=__attribute__((section(x)))");






More information about the wine-patches mailing list