diff options
| author | green <green@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-03-04 21:11:09 +0000 |
|---|---|---|
| committer | green <green@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-03-04 21:11:09 +0000 |
| commit | f51aab02abe223469d9f39e4e46250b65fd18a8b (patch) | |
| tree | 3289bacfc83a97eaf50f42a61d0b9a06f4c76e9c /libffi/src/cris | |
| parent | de3e3c185df5165793e9c0459732eb5c2bede7c5 (diff) | |
| download | ppe42-gcc-f51aab02abe223469d9f39e4e46250b65fd18a8b.tar.gz ppe42-gcc-f51aab02abe223469d9f39e4e46250b65fd18a8b.zip | |
Merge upstream libffi
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@184897 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libffi/src/cris')
| -rw-r--r-- | libffi/src/cris/ffi.c | 15 | ||||
| -rw-r--r-- | libffi/src/cris/ffitarget.h | 11 |
2 files changed, 17 insertions, 9 deletions
diff --git a/libffi/src/cris/ffi.c b/libffi/src/cris/ffi.c index e9c39530c22..aaca5b1cbaa 100644 --- a/libffi/src/cris/ffi.c +++ b/libffi/src/cris/ffi.c @@ -153,21 +153,24 @@ ffi_prep_args (char *stack, extended_cif * ecif) return (struct_count); } -ffi_status -ffi_prep_cif (ffi_cif * cif, - ffi_abi abi, unsigned int nargs, - ffi_type * rtype, ffi_type ** atypes) +ffi_status FFI_HIDDEN +ffi_prep_cif_core (ffi_cif * cif, + ffi_abi abi, unsigned int isvariadic, + unsigned int nfixedargs, unsigned int ntotalargs, + ffi_type * rtype, ffi_type ** atypes) { unsigned bytes = 0; unsigned int i; ffi_type **ptr; FFI_ASSERT (cif != NULL); - FFI_ASSERT ((abi > FFI_FIRST_ABI) && (abi <= FFI_DEFAULT_ABI)); + FFI_ASSERT((!isvariadic) || (nfixedargs >= 1)); + FFI_ASSERT(nfixedargs <= ntotalargs); + FFI_ASSERT (abi > FFI_FIRST_ABI && abi < FFI_LAST_ABI); cif->abi = abi; cif->arg_types = atypes; - cif->nargs = nargs; + cif->nargs = ntotalargs; cif->rtype = rtype; cif->flags = 0; diff --git a/libffi/src/cris/ffitarget.h b/libffi/src/cris/ffitarget.h index 4257f10a73c..b837e976e4e 100644 --- a/libffi/src/cris/ffitarget.h +++ b/libffi/src/cris/ffitarget.h @@ -1,5 +1,6 @@ /* -----------------------------------------------------------------*-C-*- - ffitarget.h - Copyright (c) 1996-2003 Red Hat, Inc. + ffitarget.h - Copyright (c) 2012 Anthony Green + Copyright (c) 1996-2003 Red Hat, Inc. Target configuration macros for CRIS. Permission is hereby granted, free of charge, to any person obtaining @@ -27,6 +28,10 @@ #ifndef LIBFFI_TARGET_H #define LIBFFI_TARGET_H +#ifndef LIBFFI_H +#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead." +#endif + #ifndef LIBFFI_ASM typedef unsigned long ffi_arg; typedef signed long ffi_sarg; @@ -34,8 +39,8 @@ typedef signed long ffi_sarg; typedef enum ffi_abi { FFI_FIRST_ABI = 0, FFI_SYSV, - FFI_DEFAULT_ABI = FFI_SYSV, - FFI_LAST_ABI = FFI_DEFAULT_ABI + 1 + FFI_LAST_ABI, + FFI_DEFAULT_ABI = FFI_SYSV } ffi_abi; #endif |

