Index: ext/dl/cfunc.c =================================================================== --- ext/dl/cfunc.c (revision 22688) +++ ext/dl/cfunc.c (working copy) @@ -367,7 +367,7 @@ switch( cfunc->type ){ case DLTYPE_VOID: #define CASE(n) case n: { \ - DECL_FUNC_STDCALL(f,void,DLSTACK_PROTO##n) = cfunc->ptr; \ + DECL_FUNC_STDCALL(f,void,DLSTACK_PROTO##n##_) = cfunc->ptr; \ f(DLSTACK_ARGS##n(stack)); \ result = Qnil; \ } @@ -376,7 +376,7 @@ break; case DLTYPE_VOIDP: #define CASE(n) case n: { \ - DECL_FUNC_STDCALL(f,void*,DLSTACK_PROTO##n) = cfunc->ptr; \ + DECL_FUNC_STDCALL(f,void*,DLSTACK_PROTO##n##_) = cfunc->ptr; \ void * ret; \ ret = f(DLSTACK_ARGS##n(stack)); \ result = PTR2NUM(ret); \ @@ -386,7 +386,7 @@ break; case DLTYPE_CHAR: #define CASE(n) case n: { \ - DECL_FUNC_STDCALL(f,char,DLSTACK_PROTO##n) = cfunc->ptr; \ + DECL_FUNC_STDCALL(f,char,DLSTACK_PROTO##n##_) = cfunc->ptr; \ char ret; \ ret = f(DLSTACK_ARGS##n(stack)); \ result = CHR2FIX(ret); \ @@ -396,7 +396,7 @@ break; case DLTYPE_SHORT: #define CASE(n) case n: { \ - DECL_FUNC_STDCALL(f,short,DLSTACK_PROTO##n) = cfunc->ptr; \ + DECL_FUNC_STDCALL(f,short,DLSTACK_PROTO##n##_) = cfunc->ptr; \ short ret; \ ret = f(DLSTACK_ARGS##n(stack)); \ result = INT2NUM((int)ret); \ @@ -406,7 +406,7 @@ break; case DLTYPE_INT: #define CASE(n) case n: { \ - DECL_FUNC_STDCALL(f,int,DLSTACK_PROTO##n) = cfunc->ptr; \ + DECL_FUNC_STDCALL(f,int,DLSTACK_PROTO##n##_) = cfunc->ptr; \ int ret; \ ret = f(DLSTACK_ARGS##n(stack)); \ result = INT2NUM(ret); \ @@ -416,7 +416,7 @@ break; case DLTYPE_LONG: #define CASE(n) case n: { \ - DECL_FUNC_STDCALL(f,long,DLSTACK_PROTO##n) = cfunc->ptr; \ + DECL_FUNC_STDCALL(f,long,DLSTACK_PROTO##n##_) = cfunc->ptr; \ long ret; \ ret = f(DLSTACK_ARGS##n(stack)); \ result = LONG2NUM(ret); \ Index: ext/dl/dl.h =================================================================== --- ext/dl/dl.h (revision 22688) +++ ext/dl/dl.h (working copy) @@ -49,7 +49,7 @@ stack[10],stack[11],stack[12],stack[13],stack[14],\ stack[15],stack[16],stack[17],stack[18],stack[19] -#define DLSTACK_PROTO0 +#define DLSTACK_PROTO0_ #define DLSTACK_PROTO1_ DLSTACK_TYPE #define DLSTACK_PROTO2_ DLSTACK_PROTO1_, DLSTACK_TYPE #define DLSTACK_PROTO3_ DLSTACK_PROTO2_, DLSTACK_TYPE Index: ext/dl/win32/lib/Win32API.rb =================================================================== --- ext/dl/win32/lib/Win32API.rb (revision 22688) +++ ext/dl/win32/lib/Win32API.rb (working copy) @@ -11,7 +11,7 @@ def initialize(dllname, func, import, export = "0") @proto = [import].join.tr("VPpNnLlIi", "0SSI").sub(/^(.)0*$/, '\1') handle = DLL[dllname] ||= DL.dlopen(dllname) - @func = DL::CFunc.new(handle[func], TYPEMAP[export.tr("VPpNnLlIi", "0SSI")], func) + @func = DL::CFunc.new(handle[func], TYPEMAP[export.tr("VPpNnLlIi", "0SSI")], func, :stdcall) rescue DL::DLError => e raise LoadError, e.message, e.backtrace end