FFI repairs for 64-bit big-endian
Based on a patch supplied by Stephen Lewis
This commit is contained in:
parent
8718a5dd62
commit
b3c7210a34
|
@ -1604,8 +1604,8 @@ void *scheme_extract_pointer(Scheme_Object *v) {
|
|||
* for both the function definition and calls */
|
||||
#ifdef SCHEME_BIG_ENDIAN
|
||||
#define C2SCHEME(ap,typ,src,delta,argsloc,gcsrc) c_to_scheme(ap,typ,src,delta,argsloc,gcsrc)
|
||||
#define REF_CTYPE(ctype) (((sizeof(ctype)<sizeof(int)) && args_loc) \
|
||||
? ((ctype)(((int*)W_OFFSET(src,delta))[0])) \
|
||||
#define REF_CTYPE(ctype) (((sizeof(ctype)<sizeof(intptr_t)) && args_loc) \
|
||||
? ((ctype)(((intptr_t*)W_OFFSET(src,delta))[0])) \
|
||||
: (((ctype *)W_OFFSET(src,delta))[0]))
|
||||
#else
|
||||
#define C2SCHEME(ap,typ,src,delta,argsloc,gcsrc) c_to_scheme(ap,typ,src,delta,gcsrc)
|
||||
|
|
|
@ -1383,8 +1383,8 @@ void *scheme_extract_pointer(Scheme_Object *v) {
|
|||
* for both the function definition and calls */
|
||||
#ifdef SCHEME_BIG_ENDIAN
|
||||
#define C2SCHEME(ap,typ,src,delta,argsloc,gcsrc) c_to_scheme(ap,typ,src,delta,argsloc,gcsrc)
|
||||
#define REF_CTYPE(ctype) (((sizeof(ctype)<sizeof(int)) && args_loc) \
|
||||
? ((ctype)(((int*)W_OFFSET(src,delta))[0])) \
|
||||
#define REF_CTYPE(ctype) (((sizeof(ctype)<sizeof(intptr_t)) && args_loc) \
|
||||
? ((ctype)(((intptr_t*)W_OFFSET(src,delta))[0])) \
|
||||
: (((ctype *)W_OFFSET(src,delta))[0]))
|
||||
#else
|
||||
#define C2SCHEME(ap,typ,src,delta,argsloc,gcsrc) c_to_scheme(ap,typ,src,delta,gcsrc)
|
||||
|
|
Loading…
Reference in New Issue
Block a user