diff --git a/libffi/ChangeLog b/libffi/ChangeLog index b58d0fb3..8f42ec07 100644 --- a/libffi/ChangeLog +++ b/libffi/ChangeLog @@ -1,3 +1,22 @@ +Sun Apr 22 15:50:08 2001 Anthony Green + + * include/ffi_common.h: Delete, after moving contents to... + * include/ffi_private.h: Subsume contents of ffi_common.h. + * include/Makefile.am (noinst_HEADERS): Remove ffi_common.h. + * include/Makefile.in: Rebuilt. + * arm/ffi.c, m68k/ffi.c, mips/ffi.c, powerpc/ffi.c, s390/ffi.c, + ia64/ffi.c: Include ffi_private.h, not ffi_common.h. + * alpha/ffi.c, sparc/ffi.c, x86/ffi.c: Don't include ffi_common.h. + * types.c, raw_api.c, java_raw_api.c, prep_cif.c: Don't include + ffi_common.h. + * debug.c: Include ffi_private.h instead of ffi_common.h. + + * mips/ffi.c (calc_n32_struct_flags): Make static. + (FIX_ARGP): Remove call to debugging routine ffi_stop_here. + + * mips/n32.S: Include ffi_private.h. + * mips/o32.S: Include ffi_private.h. + Sun Apr 22 12:37:44 2001 Anthony Green * README: Update some comments. diff --git a/libffi/README b/libffi/README index 05b0046b..7dc1fa5e 100644 --- a/libffi/README +++ b/libffi/README @@ -476,7 +476,7 @@ History Authors & Credits ================= -libffi was written by Anthony Green . +libffi was written by Anthony Green . Portions of libffi were derived from Gianni Mariani's free gencall library for Silicon Graphics machines. @@ -488,7 +488,7 @@ The initial Sparc port was derived from code contributed by the fine folks at Visible Decisions Inc. Further enhancements were made by Gordon Irlam while at Cygnus Solutions. -The Alpha port was written by Richard Henderson at Cygnus Solutions. +The Alpha port was written by Richard Henderson at Cygnus Solutions/Red Hat. Andreas Schwab ported libffi to m68k Linux and provided a number of bug fixes. diff --git a/libffi/alpha/ffi.c b/libffi/alpha/ffi.c index 94bd6bc1..30d30f0e 100644 --- a/libffi/alpha/ffi.c +++ b/libffi/alpha/ffi.c @@ -25,7 +25,6 @@ #include #include -#include #include diff --git a/libffi/arm/ffi.c b/libffi/arm/ffi.c index 0ede742e..c4e8fafe 100644 --- a/libffi/arm/ffi.c +++ b/libffi/arm/ffi.c @@ -24,7 +24,7 @@ ----------------------------------------------------------------------- */ #include -#include +#include #include diff --git a/libffi/debug.c b/libffi/debug.c index 17196ba0..42416594 100644 --- a/libffi/debug.c +++ b/libffi/debug.c @@ -22,7 +22,7 @@ ----------------------------------------------------------------------- */ #include -#include +#include #include #include diff --git a/libffi/ia64/ffi.c b/libffi/ia64/ffi.c index bb4fbb73..c84f86f7 100644 --- a/libffi/ia64/ffi.c +++ b/libffi/ia64/ffi.c @@ -25,7 +25,7 @@ ----------------------------------------------------------------------- */ #include -#include +#include #include diff --git a/libffi/include/Makefile.am b/libffi/include/Makefile.am index 43077275..525984f7 100644 --- a/libffi/include/Makefile.am +++ b/libffi/include/Makefile.am @@ -2,5 +2,5 @@ AUTOMAKE_OPTIONS = foreign -noinst_HEADERS=ffi_common.h ffi_private.h +noinst_HEADERS=ffi_private.h include_HEADERS=ffi.h diff --git a/libffi/include/Makefile.in b/libffi/include/Makefile.in index 4223d629..853774d1 100644 --- a/libffi/include/Makefile.in +++ b/libffi/include/Makefile.in @@ -81,7 +81,7 @@ libffi_basedir = @libffi_basedir@ AUTOMAKE_OPTIONS = foreign -noinst_HEADERS = ffi_common.h ffi_private.h +noinst_HEADERS = ffi_private.h include_HEADERS = ffi.h mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = ../fficonfig.h diff --git a/libffi/include/ffi_common.h b/libffi/include/ffi_common.h deleted file mode 100644 index 2120754e..00000000 --- a/libffi/include/ffi_common.h +++ /dev/null @@ -1,91 +0,0 @@ -/* ----------------------------------------------------------------------- - ffi_common.h - Copyright (c) 1996 Red Hat, Inc. - - $Id: ffi_common.h,v 1.3 2001/04/09 00:58:37 green Exp $ - - Common internal definitions and macros. Only necessary for building - libffi. - ----------------------------------------------------------------------- */ - -#ifndef FFI_COMMON_H -#define FFI_COMMON_H - -#ifdef __cplusplus -extern "C" { -#endif - -/* Do not move this. Some versions of AIX are very picky about where - this is positioned. */ -#ifdef __GNUC__ -# define alloca __builtin_alloca -#else -# if HAVE_ALLOCA_H -# include -# else -# ifdef _AIX - #pragma alloca -# else -# ifndef alloca /* predefined by HP cc +Olibcalls */ -char *alloca (); -# endif -# endif -# endif -#endif - -/* Check for the existence of memcpy. */ -#if STDC_HEADERS -# include -#else -# ifndef HAVE_MEMCPY -# define memcpy(d, s, n) bcopy ((s), (d), (n)) -# endif -#endif - -#ifndef FALSE -#define FALSE 0 -#endif - -#ifndef TRUE -#define TRUE (!FALSE) -#endif - -#ifndef __cplusplus -/* bool is a keyword in C++ */ -/*@-cppnames@*/ -typedef int bool; -/*@=cppnames@*/ -#endif - -#ifdef FFI_DEBUG - -/* Debugging functions */ -/*@exits@*/ int ffi_assert(/*@temp@*/ char *file, int line); -void ffi_stop_here(void); -bool ffi_type_test(/*@temp@*/ /*@out@*/ ffi_type *a); - -#define FFI_ASSERT(x) ((x) ? 0 : ffi_assert(__FILE__,__LINE__)) - -#else - -#define FFI_ASSERT(x) - -#endif - -/* Perform machine dependent cif processing */ -ffi_status ffi_prep_cif_machdep(ffi_cif *cif); - -/* Extended cif, used in callback from assembly routine */ -typedef struct -{ - /*@dependent@*/ ffi_cif *cif; - /*@dependent@*/ void *rvalue; - /*@dependent@*/ void **avalue; -} extended_cif; - -#ifdef __cplusplus -} -#endif - -#endif - - diff --git a/libffi/include/ffi_private.h b/libffi/include/ffi_private.h index 59644b9e..d3af43ba 100644 --- a/libffi/include/ffi_private.h +++ b/libffi/include/ffi_private.h @@ -119,3 +119,50 @@ #define SIZEOF_ARG SIZEOF_VOID_P #endif +#ifndef __ASSEMBLER__ +/* This part of the private header file is only for C code. */ + +/* Check for the existence of memcpy. */ +#if STDC_HEADERS +# include +#else +# ifndef HAVE_MEMCPY +# define memcpy(d, s, n) bcopy ((s), (d), (n)) +# endif +#endif + +#ifndef FALSE +#define FALSE 0 +#endif + +#ifndef TRUE +#define TRUE (!FALSE) +#endif + +#ifndef __cplusplus +/* bool is a keyword in C++ */ +typedef int bool; +#endif + +#ifdef FFI_DEBUG +/* Debugging functions */ +void ffi_stop_here(void); +bool ffi_type_test(ffi_type *a); +#define FFI_ASSERT(x) ((x) ? 0 : ffi_assert(__FILE__,__LINE__)) +#else +#define FFI_ASSERT(x) +#endif + +/* Perform machine dependent cif processing */ +ffi_status ffi_prep_cif_machdep(ffi_cif *cif); + +/* Extended cif, used in callback from assembly routine */ +typedef struct +{ + ffi_cif *cif; + void *rvalue; + void **avalue; +} extended_cif; + +#endif /* __ASSEMBLER__ */ + diff --git a/libffi/java_raw_api.c b/libffi/java_raw_api.c index 9d82e4b9..1b00cd35 100644 --- a/libffi/java_raw_api.c +++ b/libffi/java_raw_api.c @@ -34,7 +34,6 @@ #include #include -#include #if !defined(NO_JAVA_RAW_API) && !defined(FFI_NO_RAW_API) diff --git a/libffi/m68k/ffi.c b/libffi/m68k/ffi.c index c5d95078..e9686f4e 100644 --- a/libffi/m68k/ffi.c +++ b/libffi/m68k/ffi.c @@ -5,7 +5,7 @@ ----------------------------------------------------------------------- */ #include -#include +#include #include diff --git a/libffi/mips/ffi.c b/libffi/mips/ffi.c index fb733b2b..9709819e 100644 --- a/libffi/mips/ffi.c +++ b/libffi/mips/ffi.c @@ -24,7 +24,7 @@ ----------------------------------------------------------------------- */ #include -#include +#include #include #include @@ -35,7 +35,6 @@ FFI_ASSERT(argp <= &stack[bytes]); \ if (argp == &stack[bytes]) \ { \ argp = stack; \ - ffi_stop_here(); \ } #else #define FIX_ARGP @@ -194,7 +193,7 @@ static void ffi_prep_args(char *stack, passed in an integer register". This code traverses structure definitions and generates the appropriate flags. */ -unsigned calc_n32_struct_flags(ffi_type *arg, unsigned *shift) +static unsigned calc_n32_struct_flags(ffi_type *arg, unsigned *shift) { unsigned flags = 0; unsigned index = 0; diff --git a/libffi/mips/n32.S b/libffi/mips/n32.S index ee137b73..4eeef07a 100644 --- a/libffi/mips/n32.S +++ b/libffi/mips/n32.S @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------- - n32.S - Copyright (c) 1996, 1998 Cygnus Solutions + n32.S - Copyright (c) 1996, 1998, 2001 Red Hat, Inc. MIPS Foreign Function Interface @@ -25,6 +25,7 @@ #define LIBFFI_ASM #include +#include #include /* Only build this code if we are compiling for n32 */ diff --git a/libffi/mips/o32.S b/libffi/mips/o32.S index 9c8bbb28..6efc8f7b 100644 --- a/libffi/mips/o32.S +++ b/libffi/mips/o32.S @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------- - o32.S - Copyright (c) 1996, 1998 Cygnus Solutions + o32.S - Copyright (c) 1996, 1998, 2001 Red Hat, Inc. MIPS Foreign Function Interface @@ -25,6 +25,7 @@ #define LIBFFI_ASM #include +#include #include /* Only build this code if we are compiling for o32 */ diff --git a/libffi/powerpc/ffi.c b/libffi/powerpc/ffi.c index 309848e3..20429621 100644 --- a/libffi/powerpc/ffi.c +++ b/libffi/powerpc/ffi.c @@ -3,7 +3,7 @@ PowerPC Foreign Function Interface - $Id: ffi.c,v 1.1 2001/04/22 18:28:36 green Exp $ + $Id: ffi.c,v 1.2 2001/04/23 00:32:03 green Exp $ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the @@ -26,7 +26,7 @@ ----------------------------------------------------------------------- */ #include -#include +#include #include #include diff --git a/libffi/prep_cif.c b/libffi/prep_cif.c index 5e97a184..10733033 100644 --- a/libffi/prep_cif.c +++ b/libffi/prep_cif.c @@ -23,7 +23,6 @@ #include #include -#include #include diff --git a/libffi/raw_api.c b/libffi/raw_api.c index 4830709e..c41cf2ee 100644 --- a/libffi/raw_api.c +++ b/libffi/raw_api.c @@ -27,7 +27,6 @@ #include #include -#include #if !FFI_NO_RAW_API diff --git a/libffi/s390/ffi.c b/libffi/s390/ffi.c index 54988839..f6051528 100644 --- a/libffi/s390/ffi.c +++ b/libffi/s390/ffi.c @@ -28,7 +28,7 @@ /*====================================================================*/ #include -#include +#include #include #include diff --git a/libffi/sparc/ffi.c b/libffi/sparc/ffi.c index 65e295ba..f7d909b6 100644 --- a/libffi/sparc/ffi.c +++ b/libffi/sparc/ffi.c @@ -25,7 +25,6 @@ #include #include -#include #include diff --git a/libffi/testsuite/lib/libffi.exp b/libffi/testsuite/lib/libffi.exp index 58c5408a..00c28d3c 100644 --- a/libffi/testsuite/lib/libffi.exp +++ b/libffi/testsuite/lib/libffi.exp @@ -34,9 +34,9 @@ proc test_libffi {src} { $status "$testcase" - if { $status == "pass" } { - remote_file build delete $executable; - } +# if { $status == "pass" } { +# remote_file build delete $executable; +# } } # Local Variables: diff --git a/libffi/testsuite/libffi.call/many.c b/libffi/testsuite/libffi.call/many.c index 01a21381..1b3d72c0 100644 --- a/libffi/testsuite/libffi.call/many.c +++ b/libffi/testsuite/libffi.call/many.c @@ -16,7 +16,7 @@ static float many(float f1, float f12, float f13) { -#if 0 +#if 1 printf("%f %f %f %f %f %f %f %f %f %f %f %f %f\n", (double) f1, (double) f2, (double) f3, (double) f4, (double) f5, (double) f6, (double) f7, (double) f8, (double) f9, (double) f10, @@ -60,4 +60,4 @@ main () exit(0); else abort(); - } +} diff --git a/libffi/types.c b/libffi/types.c index d1eb0896..9ab573d9 100644 --- a/libffi/types.c +++ b/libffi/types.c @@ -25,7 +25,6 @@ #include #include -#include /* Type definitions */