File tree 2 files changed +31
-1
lines changed 2 files changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -149,6 +149,26 @@ EXTRALIB += -defaultlib:advapi32
149
149
SUFFIX = obj
150
150
PSUFFIX = pobj
151
151
LIBSUFFIX = lib
152
+ ifeq ($(C_COMPILER), GCC)
153
+ #Test for supporting MS_ABI
154
+ GCCVERSIONGTEQ4 := $(shell expr `$(CC) -dumpversion | cut -f1 -d.` \>= 4)
155
+ GCCVERSIONGT4 := $(shell expr `$(CC) -dumpversion | cut -f1 -d.` \> 4)
156
+ GCCMINORVERSIONGTEQ7 := $(shell expr `$(CC) -dumpversion | cut -f2 -d.` \>= 7)
157
+ ifeq ($(GCCVERSIONGT4), 1)
158
+ # GCC Majar version > 4
159
+ # It is compatible with MSVC ABI.
160
+ CCOMMON_OPT += -DMS_ABI
161
+ endif
162
+
163
+ ifeq ($(GCCVERSIONGTEQ4), 1)
164
+ ifeq ($(GCCMINORVERSIONGTEQ7), 1)
165
+ # GCC Version >=4.7
166
+ # It is compatible with MSVC ABI.
167
+ CCOMMON_OPT += -DMS_ABI
168
+ endif
169
+ endif
170
+
171
+ endif
152
172
endif
153
173
154
174
ifeq ($(OSNAME), Interix)
Original file line number Diff line number Diff line change 1541
1541
popl %ebx
1542
1542
popl %esi
1543
1543
popl %edi
1544
- /*remove the hidden return value address from the stack.*/
1544
+ #if defined(OS_WINNT) || defined(OS_CYGWIN_NT) || defined(OS_INTERIX)
1545
+ #ifdef MS_ABI
1546
+ /* For MingW GCC >= 4.7. It is compatible with MSVC ABI. http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36834 */
1547
+ ret
1548
+ #else
1549
+ /* remove the hidden return value address from the stack. For MingW GCC < 4.7 */
1545
1550
ret $0x4
1551
+ #endif
1552
+ #else
1553
+ /*remove the hidden return value address from the stack on Linux.*/
1554
+ ret $0x4
1555
+ #endif
1546
1556
EPILOGUE
You can’t perform that action at this time.
0 commit comments