[RICHED20] Sync with Wine Staging 4.18. CORE-16441
[reactos.git] / dll / win32 / riched20 / txthost.c
index d709502..5cdb8c0 100644 (file)
@@ -18,9 +18,6 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
-#include "config.h"
-#include "wine/port.h"
-
 #define COBJMACROS
 
 #include "editor.h"
@@ -28,6 +25,7 @@
 #include "richole.h"
 #include "imm.h"
 #include "textserv.h"
+#include "wine/asm.h"
 #include "wine/debug.h"
 #include "editstr.h"
 
@@ -497,37 +495,6 @@ DECLSPEC_HIDDEN HRESULT WINAPI ITextHostImpl_TxGetSelectionBarWidth(ITextHost *i
     *lSelBarWidth = (style & ES_SELECTIONBAR) ? 225 : 0; /* in HIMETRIC */
     return S_OK;
 }
-
-
-#ifdef __i386__  /* thiscall functions are i386-specific */
-
-#define THISCALL(func) (void *) __thiscall_ ## func
-#ifdef _MSC_VER
-#define DEFINE_THISCALL_WRAPPER(func,args) \
-    __declspec(naked) HRESULT __thiscall_##func(void) \
-    { \
-        __asm pop eax \
-        __asm push ecx \
-        __asm push eax \
-        __asm jmp func \
-    }
-#else /* _MSC_VER */
-#define DEFINE_THISCALL_WRAPPER(func,args) \
-   extern HRESULT __thiscall_ ## func(void); \
-   __ASM_GLOBAL_FUNC(__thiscall_ ## func, \
-                   "popl %eax\n\t" \
-                   "pushl %ecx\n\t" \
-                   "pushl %eax\n\t" \
-                   "jmp " __ASM_NAME(#func) __ASM_STDCALL(args) )
-#endif /* _MSC_VER */
-
-#else /* __i386__ */
-
-#define THISCALL(func) func
-#define DEFINE_THISCALL_WRAPPER(func,args) /* nothing */
-
-#endif /* __i386__ */
-
 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxGetDC,4)
 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxReleaseDC,8)
 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxShowScrollBar,12)
@@ -568,7 +535,7 @@ DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxImmGetContext,4)
 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxImmReleaseContext,8)
 DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxGetSelectionBarWidth,8)
 
-#ifdef __i386__  /* thiscall functions are i386-specific */
+#if defined(__i386__) && !defined(__MINGW32__)  /* thiscall functions are i386-specific */
 
 #define STDCALL(func) (void *) __stdcall_ ## func
 #ifdef _MSC_VER