< prev index next >

modules/javafx.media/src/main/native/gstreamer/3rd_party/libffi/src/types.c

Print this page

 21    HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 22    WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 23    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 24    DEALINGS IN THE SOFTWARE.
 25    ----------------------------------------------------------------------- */
 26 
 27 /* Hide the basic type definitions from the header file, so that we
 28    can redefine them here as "const".  */
 29 #define LIBFFI_HIDE_BASIC_TYPES
 30 
 31 #include <ffi.h>
 32 #include <ffi_common.h>
 33 
 34 /* Type definitions */
 35 
 36 #define FFI_TYPEDEF(name, type, id, maybe_const)\
 37 struct struct_align_##name {            \
 38   char c;                   \
 39   type x;                   \
 40 };                      \

 41 maybe_const ffi_type ffi_type_##name = {    \
 42   sizeof(type),                 \
 43   offsetof(struct struct_align_##name, x),  \
 44   id, NULL                  \
 45 }
 46 
 47 #define FFI_COMPLEX_TYPEDEF(name, type, maybe_const)    \
 48 static ffi_type *ffi_elements_complex_##name [2] = {    \
 49     (ffi_type *)(&ffi_type_##name), NULL        \
 50 };                          \
 51 struct struct_align_complex_##name {            \
 52   char c;                       \
 53   _Complex type x;                  \
 54 };                          \

 55 maybe_const ffi_type ffi_type_complex_##name = {    \
 56   sizeof(_Complex type),                \
 57   offsetof(struct struct_align_complex_##name, x),  \
 58   FFI_TYPE_COMPLEX,                 \
 59   (ffi_type **)ffi_elements_complex_##name      \
 60 }
 61 
 62 /* Size and alignment are fake here. They must not be 0. */
 63 const ffi_type ffi_type_void = {
 64   1, 1, FFI_TYPE_VOID, NULL
 65 };
 66 
 67 FFI_TYPEDEF(uint8, UINT8, FFI_TYPE_UINT8, const);
 68 FFI_TYPEDEF(sint8, SINT8, FFI_TYPE_SINT8, const);
 69 FFI_TYPEDEF(uint16, UINT16, FFI_TYPE_UINT16, const);
 70 FFI_TYPEDEF(sint16, SINT16, FFI_TYPE_SINT16, const);
 71 FFI_TYPEDEF(uint32, UINT32, FFI_TYPE_UINT32, const);
 72 FFI_TYPEDEF(sint32, SINT32, FFI_TYPE_SINT32, const);
 73 FFI_TYPEDEF(uint64, UINT64, FFI_TYPE_UINT64, const);
 74 FFI_TYPEDEF(sint64, SINT64, FFI_TYPE_SINT64, const);
 75 
 76 FFI_TYPEDEF(pointer, void*, FFI_TYPE_POINTER, const);
 77 
 78 FFI_TYPEDEF(float, float, FFI_TYPE_FLOAT, const);
 79 FFI_TYPEDEF(double, double, FFI_TYPE_DOUBLE, const);
 80 
 81 #if !defined HAVE_LONG_DOUBLE_VARIANT || defined __alpha__
 82 #define FFI_LDBL_CONST const
 83 #else

 21    HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 22    WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 23    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 24    DEALINGS IN THE SOFTWARE.
 25    ----------------------------------------------------------------------- */
 26 
 27 /* Hide the basic type definitions from the header file, so that we
 28    can redefine them here as "const".  */
 29 #define LIBFFI_HIDE_BASIC_TYPES
 30 
 31 #include <ffi.h>
 32 #include <ffi_common.h>
 33 
 34 /* Type definitions */
 35 
 36 #define FFI_TYPEDEF(name, type, id, maybe_const)\
 37 struct struct_align_##name {            \
 38   char c;                   \
 39   type x;                   \
 40 };                      \
 41 FFI_EXTERN                  \
 42 maybe_const ffi_type ffi_type_##name = {    \
 43   sizeof(type),                 \
 44   offsetof(struct struct_align_##name, x),  \
 45   id, NULL                  \
 46 }
 47 
 48 #define FFI_COMPLEX_TYPEDEF(name, type, maybe_const)    \
 49 static ffi_type *ffi_elements_complex_##name [2] = {    \
 50     (ffi_type *)(&ffi_type_##name), NULL        \
 51 };                          \
 52 struct struct_align_complex_##name {            \
 53   char c;                       \
 54   _Complex type x;                  \
 55 };                          \
 56 FFI_EXTERN                      \
 57 maybe_const ffi_type ffi_type_complex_##name = {    \
 58   sizeof(_Complex type),                \
 59   offsetof(struct struct_align_complex_##name, x),  \
 60   FFI_TYPE_COMPLEX,                 \
 61   (ffi_type **)ffi_elements_complex_##name      \
 62 }
 63 
 64 /* Size and alignment are fake here. They must not be 0. */
 65 FFI_EXTERN const ffi_type ffi_type_void = {
 66   1, 1, FFI_TYPE_VOID, NULL
 67 };
 68 
 69 FFI_TYPEDEF(uint8, UINT8, FFI_TYPE_UINT8, const);
 70 FFI_TYPEDEF(sint8, SINT8, FFI_TYPE_SINT8, const);
 71 FFI_TYPEDEF(uint16, UINT16, FFI_TYPE_UINT16, const);
 72 FFI_TYPEDEF(sint16, SINT16, FFI_TYPE_SINT16, const);
 73 FFI_TYPEDEF(uint32, UINT32, FFI_TYPE_UINT32, const);
 74 FFI_TYPEDEF(sint32, SINT32, FFI_TYPE_SINT32, const);
 75 FFI_TYPEDEF(uint64, UINT64, FFI_TYPE_UINT64, const);
 76 FFI_TYPEDEF(sint64, SINT64, FFI_TYPE_SINT64, const);
 77 
 78 FFI_TYPEDEF(pointer, void*, FFI_TYPE_POINTER, const);
 79 
 80 FFI_TYPEDEF(float, float, FFI_TYPE_FLOAT, const);
 81 FFI_TYPEDEF(double, double, FFI_TYPE_DOUBLE, const);
 82 
 83 #if !defined HAVE_LONG_DOUBLE_VARIANT || defined __alpha__
 84 #define FFI_LDBL_CONST const
 85 #else
< prev index next >