// ioctlsocket function doesn't work for normal file-descriptors.
#define _GLIBCXX_NO_IOCTL 1
+// See libstdc++/51135
+// Class constructors/destructors have __thiscall calling-convention on
+// IA 32-bit
+#if defined (__i386__)
+#define _GLIBCXX_CDTOR_CALLABI __thiscall
+#endif
+
#endif
// ioctlsocket function doesn't work for normal file-descriptors.
#define _GLIBCXX_NO_IOCTL 1
+// See libstdc++/51135
+// Class constructors/destructors have __thiscall calling-convention on
+// IA 32-bit
+#if defined (__i386__)
+#define _GLIBCXX_CDTOR_CALLABI __thiscall
+#endif
+
#endif
#include <bits/cxxabi_tweaks.h>
#include <bits/cxxabi_forced.h>
+#ifndef _GLIBCXX_CDTOR_CALLABI
+#define _GLIBCXX_CDTOR_CALLABI
+#endif
+
#ifdef __cplusplus
namespace __cxxabiv1
{
// Throw the exception.
void
- __cxa_throw(void*, std::type_info*, void (*) (void *))
+ __cxa_throw(void*, std::type_info*, void (_GLIBCXX_CDTOR_CALLABI *) (void *))
__attribute__((__noreturn__));
// Used to implement exception handlers.
extern "C" void
__cxxabiv1::__cxa_throw (void *obj, std::type_info *tinfo,
- void (*dest) (void *))
+ void (_GLIBCXX_CDTOR_CALLABI *dest) (void *))
{
// Definitely a primary.
__cxa_refcounted_exception *header
{
// Manage the exception object itself.
std::type_info *exceptionType;
- void (*exceptionDestructor)(void *);
+ void (_GLIBCXX_CDTOR_CALLABI *exceptionDestructor)(void *);
// The C++ standard has entertaining rules wrt calling set_terminate
// and set_unexpected in the middle of the exception cleanup process.