diff options
author | Wayne Meissner <wmeissner@gmail.com> | 2013-03-05 08:02:09 +1000 |
---|---|---|
committer | Wayne Meissner <wmeissner@gmail.com> | 2013-03-05 08:02:09 +1000 |
commit | 32b1a4e14314177197b18fe6ffcdbc03f2412b6c (patch) | |
tree | 6623a714082eabdaf07d0c4fd822d09cf07282b2 | |
parent | d4749a6348adffb68b84ec5683cdd30648d64dad (diff) | |
download | ffi-32b1a4e14314177197b18fe6ffcdbc03f2412b6c.tar.gz |
Check for the presence of FFI_STDCALL - some arches do not have it defined
-rw-r--r-- | ext/ffi_c/FunctionInfo.c | 2 | ||||
-rw-r--r-- | ext/ffi_c/Variadic.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/ext/ffi_c/FunctionInfo.c b/ext/ffi_c/FunctionInfo.c index ee4091c..2346fea 100644 --- a/ext/ffi_c/FunctionInfo.c +++ b/ext/ffi_c/FunctionInfo.c @@ -171,7 +171,7 @@ fntype_initialize(int argc, VALUE* argv, VALUE self) fnInfo->ffiReturnType = fnInfo->returnType->ffiType; -#if defined(_WIN32) || defined(__WIN32__) +#if (defined(_WIN32) || defined(__WIN32__)) && defined(FFI_STDCALL) rbConventionStr = (rbConvention != Qnil) ? rb_funcall2(rbConvention, rb_intern("to_s"), 0, NULL) : Qnil; fnInfo->abi = (rbConventionStr != Qnil && strcmp(StringValueCStr(rbConventionStr), "stdcall") == 0) ? FFI_STDCALL : FFI_DEFAULT_ABI; diff --git a/ext/ffi_c/Variadic.c b/ext/ffi_c/Variadic.c index 1585f8b..34ba9a7 100644 --- a/ext/ffi_c/Variadic.c +++ b/ext/ffi_c/Variadic.c @@ -107,7 +107,7 @@ variadic_initialize(VALUE self, VALUE rbFunction, VALUE rbParameterTypes, VALUE invoker->rbAddress = rbFunction; invoker->function = rbffi_AbstractMemory_Cast(rbFunction, rbffi_PointerClass)->address; -#if defined(_WIN32) || defined(__WIN32__) +#if (defined(_WIN32) || defined(__WIN32__)) && defined(FFI_STDCALL) rbConventionStr = rb_funcall2(convention, rb_intern("to_s"), 0, NULL); invoker->abi = (RTEST(convention) && strcmp(StringValueCStr(rbConventionStr), "stdcall") == 0) ? FFI_STDCALL : FFI_DEFAULT_ABI; |