Commit 723512ba by Dave Korn Committed by Dave Korn

re PR libffi/40807 (libffi.call/return_sc.c)

	PR libffi/40807
	* src/x86/ffi.c (ffi_prep_cif_machdep): Also use sign/zero-extending
	return types for X86_WIN32.
	* src/x86/win32.S (_ffi_call_SYSV): Handle omitted return types.
	(_ffi_call_STDCALL, _ffi_closure_SYSV, _ffi_closure_raw_SYSV,
	_ffi_closure_STDCALL): Likewise.

	* src/closures.c (is_selinux_enabled): Define to const 0 for Cygwin.
	(dlmmap, dlmunmap): Also use these functions on Cygwin.

From-SVN: r150042
parent 80927a56
2009-07-24 Dave Korn <dave.korn.cygwin@gmail.com>
PR libffi/40807
* src/x86/ffi.c (ffi_prep_cif_machdep): Also use sign/zero-extending
return types for X86_WIN32.
* src/x86/win32.S (_ffi_call_SYSV): Handle omitted return types.
(_ffi_call_STDCALL, _ffi_closure_SYSV, _ffi_closure_raw_SYSV,
_ffi_closure_STDCALL): Likewise.
* src/closures.c (is_selinux_enabled): Define to const 0 for Cygwin.
(dlmmap, dlmunmap): Also use these functions on Cygwin.
2009-07-11 Richard Sandiford <rdsandiford@googlemail.com>
PR testsuite/40699
......
......@@ -165,7 +165,15 @@ selinux_enabled_check (void)
#define is_selinux_enabled() 0
#endif
#endif /* !FFI_MMAP_EXEC_SELINUX */
#elif defined (__CYGWIN__)
#include <sys/mman.h>
/* Cygwin is Linux-like, but not quite that Linux-like. */
#define is_selinux_enabled() 0
#endif /* !defined(X86_WIN32) && !defined(X86_WIN64) */
/* Declare all functions defined in dlmalloc.c as static. */
......@@ -185,11 +193,11 @@ static int dlmalloc_trim(size_t) MAYBE_UNUSED;
static size_t dlmalloc_usable_size(void*) MAYBE_UNUSED;
static void dlmalloc_stats(void) MAYBE_UNUSED;
#if !defined(X86_WIN32) && !defined(X86_WIN64)
#if !(defined(X86_WIN32) || defined(X86_WIN64)) || defined (__CYGWIN__)
/* Use these for mmap and munmap within dlmalloc.c. */
static void *dlmmap(void *, size_t, int, int, int, off_t);
static int dlmunmap(void *, size_t);
#endif /* !defined(X86_WIN32) && !defined(X86_WIN64) */
#endif /* !(defined(X86_WIN32) || defined(X86_WIN64)) || defined (__CYGWIN__) */
#define mmap dlmmap
#define munmap dlmunmap
......@@ -199,7 +207,7 @@ static int dlmunmap(void *, size_t);
#undef mmap
#undef munmap
#if !defined(X86_WIN32) && !defined(X86_WIN64)
#if !(defined(X86_WIN32) || defined(X86_WIN64)) || defined (__CYGWIN__)
/* A mutex used to synchronize access to *exec* variables in this file. */
static pthread_mutex_t open_temp_exec_file_mutex = PTHREAD_MUTEX_INITIALIZER;
......@@ -514,7 +522,7 @@ segment_holding_code (mstate m, char* addr)
}
#endif
#endif /* !defined(X86_WIN32) && !defined(X86_WIN64) */
#endif /* !(defined(X86_WIN32) || defined(X86_WIN64)) || defined (__CYGWIN__) */
/* Allocate a chunk of memory with the given size. Returns a pointer
to the writable address, and sets *CODE to the executable
......
......@@ -155,7 +155,7 @@ ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
#ifdef X86
case FFI_TYPE_STRUCT:
#endif
#if defined(X86) || defined(X86_DARWIN) || defined(X86_WIN64)
#if defined(X86) || defined (X86_WIN32) || defined(X86_DARWIN) || defined(X86_WIN64)
case FFI_TYPE_UINT8:
case FFI_TYPE_UINT16:
case FFI_TYPE_SINT8:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment