From 7f5ac2b7f98a1d5758626fa079b1e37a7797b21d Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Tue, 14 Dec 2010 07:53:19 -0700 Subject: [PATCH] restore Win64 fix to FFI that I had improperly added to "foreign.c" instead of the source --- collects/scribblings/foreign/types.scrbl | 10 +++++----- src/foreign/foreign.c | 4 ++-- src/foreign/foreign.rktc | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/collects/scribblings/foreign/types.scrbl b/collects/scribblings/foreign/types.scrbl index 6d6400d685..96d485ad8c 100644 --- a/collects/scribblings/foreign/types.scrbl +++ b/collects/scribblings/foreign/types.scrbl @@ -386,11 +386,11 @@ used. There are no restrictions on the Racket procedure; in particular, its lexical context is properly preserved. The optional @scheme[abi] keyword argument determines the foreign ABI -that is used. @scheme[#f] or @scheme['default] will use a -platform-dependent default; other possible values are -@scheme['stdcall] and @scheme['sysv] (the latter corresponds to -``cdecl''). This is especially important on Windows, where most -system functions are @scheme['stdcall], which is not the default. +that is used. Supplying @scheme[#f] or @scheme['default] indicates the +platform-dependent default. The other possible +values---@scheme['stdcall]and @scheme['sysv] (i.e., ``cdecl'')---are +currently supported only for 32-bit Windows; using them on other +platforms raises an exception. If @scheme[atomic?] is true, then when a Racket procedure is given this procedure type and called from foreign code, then the Racket diff --git a/src/foreign/foreign.c b/src/foreign/foreign.c index b0fd55bed5..baa90c0dc3 100644 --- a/src/foreign/foreign.c +++ b/src/foreign/foreign.c @@ -1047,13 +1047,13 @@ ffi_abi sym_to_abi(char *who, Scheme_Object *sym) if (SCHEME_FALSEP(sym) || SAME_OBJ(sym, default_sym)) return FFI_DEFAULT_ABI; else if (SAME_OBJ(sym, sysv_sym)) { -#ifdef WINDOWS_DYNAMIC_LOAD +#if defined(WINDOWS_DYNAMIC_LOAD) && !defined(_WIN64) return FFI_SYSV; #else scheme_signal_error("%s: ABI not implemented: %V", who, sym); #endif } else if (SAME_OBJ(sym, stdcall_sym)) { -#ifdef WINDOWS_DYNAMIC_LOAD +#if defined(WINDOWS_DYNAMIC_LOAD) && !defined(_WIN64) return FFI_STDCALL; #else scheme_signal_error("%s: ABI not implemented: %V", who, sym); diff --git a/src/foreign/foreign.rktc b/src/foreign/foreign.rktc index de0a0609b0..f911a197f1 100755 --- a/src/foreign/foreign.rktc +++ b/src/foreign/foreign.rktc @@ -880,13 +880,13 @@ ffi_abi sym_to_abi(char *who, Scheme_Object *sym) if (SCHEME_FALSEP(sym) || SAME_OBJ(sym, default_sym)) return FFI_DEFAULT_ABI; else if (SAME_OBJ(sym, sysv_sym)) { -#ifdef WINDOWS_DYNAMIC_LOAD +#if defined(WINDOWS_DYNAMIC_LOAD) && !defined(_WIN64) return FFI_SYSV; #else scheme_signal_error("%s: ABI not implemented: %V", who, sym); #endif } else if (SAME_OBJ(sym, stdcall_sym)) { -#ifdef WINDOWS_DYNAMIC_LOAD +#if defined(WINDOWS_DYNAMIC_LOAD) && !defined(_WIN64) return FFI_STDCALL; #else scheme_signal_error("%s: ABI not implemented: %V", who, sym);