Bläddra i källkod

Support MinGW 4.7 ABIs on Clang.

Joshua Cearley 10 år sedan
förälder
incheckning
0b2228b7cd

+ 1 - 1
Source/ThirdParty/AngelScript/source/as_callfunc_x86.cpp

@@ -1287,7 +1287,7 @@ endcopy:
 		"subl  $4, %%ecx       \n"
 		"jne   copyloop3       \n"
 		"endcopy3:             \n"
-#if defined(__MINGW32__) && ((__GNUC__ == 4 && __GNUC_MINOR__ >= 7) || __GNUC__ > 4)
+#ifdef AS_MINGW47_WORKAROUND
         // MinGW made some strange choices with 4.7, and the thiscall calling convention
         // when returning an object in memory is completely different from when not returning
         // in memory

+ 9 - 0
Source/ThirdParty/AngelScript/source/as_config.h

@@ -772,8 +772,17 @@
 			#undef AS_NO_THISCALL_FUNCTOR_METHOD
 
 			// As of version 4.7 MinGW changed the ABI, presumably
+
 			// to be better aligned with how MSVC works
 			#if (__GNUC__ == 4 && __GNUC_MINOR__ >= 7) || __GNUC__ > 4
+			    #define AS_MINGW47_WORKAROUND
+			#endif
+
+			#if (__clang_major__ == 3 && __clang_minor__ > 4)
+			    #define AS_MINGW47_WORKAROUND
+			#endif
+
+			#ifdef AS_MINGW47_WORKAROUND
 				#undef  CALLEE_POPS_HIDDEN_RETURN_POINTER
 				#define THISCALL_CALLEE_POPS_ARGUMENTS
 			#else