From: Takaaki Tateishi Date: 2003-10-22T23:07:48+09:00 Subject: [ruby-list:38633] Re: dl and win32 API call 立石です。 Takaaki Tateishi said: > gcc/cygwinについては時間できたら調べてみます。 とりあえずcygwinのgccでは以下の通りにコンパイルされるようです。 -- call.c -- int __stdcall test_stdcall(int a, int b) { return 0; } int __cdecl test_cdecl(int a, int b) { return 0; } int main(int argc, char *argv[]) { test_stdcall(0, 0); test_cdecl(0, 0); return 0; } -- call.s -- .file "call.c" .text .globl _test_stdcall@8 .def _test_stdcall@8; .scl 2; .type 32; .endef _test_stdcall@8: pushl %ebp movl %esp, %ebp movl $0, %eax popl %ebp ret $8 .globl _test_cdecl .def _test_cdecl; .scl 2; .type 32; .endef _test_cdecl: pushl %ebp movl %esp, %ebp movl $0, %eax popl %ebp ret .def ___main; .scl 2; .type 32; .endef .globl _main .def _main; .scl 2; .type 32; .endef _main: pushl %ebp movl %esp, %ebp subl $24, %esp andl $-16, %esp movl $0, %eax movl %eax, -4(%ebp) movl -4(%ebp), %eax call __alloca call ___main movl $0, 4(%esp) movl $0, (%esp) call _test_stdcall@8 subl $8, %esp movl $0, 4(%esp) movl $0, (%esp) call _test_cdecl movl $0, %eax leave ret -- Takaaki Tateishi