+/* $Id$
+ * CAPTIVE_STDCALL calling by hand as GCC has it broken
+ * Copyright (C) 2003 Jan Kratochvil <project-captive@jankratochvil.net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; exactly version 2 of June 1991 is required
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+
+/*
+ * typedef gpointer CAPTIVE_STDCALL (*CaptiveStdCallFunc4 )(gpointer arg0);
+ * gpointer captive_stdcall_call_4 (CaptiveStdCallFunc4 func,gpointer arg0);
+ */
+ .globl captive_stdcall_call_4
+captive_stdcall_call_4:
+ pushl %ebp /* std stack frame */
+ movl %esp,%ebp /* std stack frame */
+ pushl 12(%ebp) /* arg0 */
+ movl 8(%ebp),%eax /* func */
+ call *%eax
+ /* keep '%eax' return value */
+ leave
+ ret
+
+/*
+ * typedef gpointer CAPTIVE_STDCALL (*CaptiveStdCallFunc8 )(gpointer arg0,gpointer arg1);
+ * gpointer captive_stdcall_call_8 (CaptiveStdCallFunc8 func,gpointer arg0,gpointer arg1);
+ */
+ .globl captive_stdcall_call_8
+captive_stdcall_call_8:
+ pushl %ebp /* std stack frame */
+ movl %esp,%ebp /* std stack frame */
+ pushl 16(%ebp) /* arg1 */
+ pushl 12(%ebp) /* arg0 */
+ movl 8(%ebp),%eax /* func */
+ call *%eax
+ /* keep '%eax' return value */
+ leave
+ ret
+
+/*
+ * typedef gpointer CAPTIVE_STDCALL (*CaptiveStdCallFunc12)(gpointer arg0,gpointer arg1,gpointer arg2);
+ * gpointer captive_stdcall_call_12(CaptiveStdCallFunc12 func,gpointer arg0,gpointer arg1,gpointer arg2);
+ */
+ .globl captive_stdcall_call_12
+captive_stdcall_call_12:
+ pushl %ebp /* std stack frame */
+ movl %esp,%ebp /* std stack frame */
+ pushl 20(%ebp) /* arg2 */
+ pushl 16(%ebp) /* arg1 */
+ pushl 12(%ebp) /* arg0 */
+ movl 8(%ebp),%eax /* func */
+ call *%eax
+ /* keep '%eax' return value */
+ leave
+ ret