From 4b267817ff0af3f2d5ec219e57a5db5ddb345543 Mon Sep 17 00:00:00 2001 From: Francois-Xavier Coudert Date: Wed, 14 May 2008 21:51:27 +0000 Subject: libgfortran.h (gfc_char4_t): New type. 2008-05-14 Francois-Xavier Coudert * libgfortran.h (gfc_char4_t): New type. (GFC_SIZE_OF_CHAR_KIND): New macro. (compare_string): Adjust prototype. (compare_string_char4): New prototype. * gfortran.map (GFORTRAN_1.1): Add _gfortran_adjustl_char4, _gfortran_adjustr_char4, _gfortran_compare_string_char4, _gfortran_concat_string_char4, _gfortran_string_index_char4, _gfortran_string_len_trim_char4, _gfortran_string_minmax_char4, _gfortran_string_scan_char4, _gfortran_string_trim_char4 and _gfortran_string_verify_char4. * intrinsics/string_intrinsics_inc.c: New file from content of string_intrinsics.c with types replaced by macros. * intrinsics/string_intrinsics.c: Move content to string_intrinsics_inc.c. From-SVN: r135313 --- libgfortran/libgfortran.h | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'libgfortran/libgfortran.h') diff --git a/libgfortran/libgfortran.h b/libgfortran/libgfortran.h index c3c67a1..6ff9f4f 100644 --- a/libgfortran/libgfortran.h +++ b/libgfortran/libgfortran.h @@ -259,9 +259,20 @@ typedef GFC_INTEGER_4 GFC_IO_INT; by the compiler. */ /* The type used of array indices, amongst other things. */ typedef ssize_t index_type; + /* The type used for the lengths of character variables. */ typedef GFC_INTEGER_4 gfc_charlen_type; +/* Definitions of CHARACTER data types: + - CHARACTER(KIND=1) corresponds to the C char type, + - CHARACTER(KIND=4) corresponds to an unsigned 32-bit integer. */ +typedef GFC_UINTEGER_4 gfc_char4_t; + +/* Byte size of character kinds. For the kinds currently supported, it's + simply equal to the kind parameter itself. */ +#define GFC_SIZE_OF_CHAR_KIND(kind) (kind) + + /* This will be 0 on little-endian machines and one on big-endian machines. */ extern int l8_to_l4_offset; internal_proto(l8_to_l4_offset); @@ -1172,10 +1183,14 @@ internal_proto(spread_scalar_c16); /* string_intrinsics.c */ -extern int compare_string (GFC_INTEGER_4, const char *, - GFC_INTEGER_4, const char *); +extern int compare_string (gfc_charlen_type, const char *, + gfc_charlen_type, const char *); iexport_proto(compare_string); +extern int compare_string_char4 (gfc_charlen_type, const gfc_char4_t *, + gfc_charlen_type, const gfc_char4_t *); +iexport_proto(compare_string_char4); + /* random.c */ extern void random_seed_i4 (GFC_INTEGER_4 * size, gfc_array_i4 * put, -- cgit v1.1