From: Bruno Haible Date: Thu, 20 Dec 2001 21:02:19 +0000 (+0000) Subject: Portability to AIX 3. X-Git-Tag: v0.11~152 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bfaa02a64df4eb48fcd2718e537d304f82808884;p=thirdparty%2Fgettext.git Portability to AIX 3. --- diff --git a/src/ChangeLog b/src/ChangeLog index bd570fe27..b6e6a2fe5 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,6 +1,15 @@ 2001-12-20 Bruno Haible * format-java.c: Include system.h. + * format-lisp.c (parse_upto): Fix prototype. char promotes to int. + * po-lex.c (mb_iseq, mb_setascii): Likewise. + * po-hash-gen.y: alloca fix for AIX 3. + * write-mo.c: Likewise. + * x-lisp.c (syntax_code_of, read_char_syntax, attribute_of): Move + prototypes, to avoid compilation errors on AIX 3. + * x-java.l (TOKEN_TYPE): Remove trailing comma in enum. + (PARSER_STATE): Likewise. + * msgfilter.c: Include on AIX. 2001-12-12 Bruno Haible diff --git a/src/format-lisp.c b/src/format-lisp.c index 35e751033..e83829bd6 100644 --- a/src/format-lisp.c +++ b/src/format-lisp.c @@ -224,7 +224,8 @@ static bool parse_upto PARAMS ((const char **formatp, int *positionp, struct format_arg_list **listp, struct format_arg_list **escapep, int *separatorp, struct spec *spec, - char terminator, bool separator)); + /*promote: char*/ int terminator, + bool separator)); static void *format_parse PARAMS ((const char *format)); static void format_free PARAMS ((void *descr)); static int format_get_number_of_directives PARAMS ((void *descr)); diff --git a/src/msgfilter.c b/src/msgfilter.c index ea178e7df..58a4077c6 100644 --- a/src/msgfilter.c +++ b/src/msgfilter.c @@ -36,6 +36,11 @@ # include #endif +/* Get fd_set. */ +#ifdef _AIX +# include +#endif + #include "dir-list.h" #include "error.h" #include "progname.h" diff --git a/src/po-hash-gen.y b/src/po-hash-gen.y index 22947e1a8..7afac284d 100644 --- a/src/po-hash-gen.y +++ b/src/po-hash-gen.y @@ -19,6 +19,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ %{ +/* The bison generated parser uses alloca. AIX 3 forces us to put this + declaration at the beginning of the file. The declaration in bison's + skeleton file comes too late. This must come before + because may include arbitrary system headers. */ +#if defined _AIX && !defined __GNUC__ + #pragma alloca +#endif + #ifdef HAVE_CONFIG_H # include "config.h" #endif diff --git a/src/po-lex.c b/src/po-lex.c index eee7d4d7c..c90e21a96 100644 --- a/src/po-lex.c +++ b/src/po-lex.c @@ -216,14 +216,16 @@ static inline void memcpy_small PARAMS ((void *dst, const void *src, size_t n)); static inline bool mb_iseof PARAMS ((const mbchar_t mbc)); static inline const char *mb_ptr PARAMS ((const mbchar_t mbc)); static inline size_t mb_len PARAMS ((const mbchar_t mbc)); -static inline bool mb_iseq PARAMS ((const mbchar_t mbc, char sc)); +static inline bool mb_iseq PARAMS ((const mbchar_t mbc, + /*promote: char*/ int sc)); static inline bool mb_isnul PARAMS ((const mbchar_t mbc)); static inline int mb_cmp PARAMS ((const mbchar_t mbc1, const mbchar_t mbc2)); static inline bool mb_equal PARAMS ((const mbchar_t mbc1, const mbchar_t mbc2)); static inline bool mb_isascii PARAMS ((const mbchar_t mbc)); static int mb_width PARAMS ((const mbchar_t mbc)); static inline void mb_putc PARAMS ((const mbchar_t mbc, FILE *stream)); -static inline void mb_setascii PARAMS ((mbchar_t mbc, char sc)); +static inline void mb_setascii PARAMS ((mbchar_t mbc, + /*promote: char*/ int sc)); static inline void mb_copy PARAMS ((mbchar_t new, const mbchar_t old)); /* A version of memcpy optimized for the case n <= 1. */ diff --git a/src/write-mo.c b/src/write-mo.c index c234e24dc..2cdcd9f3f 100644 --- a/src/write-mo.c +++ b/src/write-mo.c @@ -16,6 +16,11 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* AIX 3 forces us to put this declaration at the beginning of the file. */ +#if defined _AIX && !defined __GNUC__ + #pragma alloca +#endif + #ifdef HAVE_CONFIG_H # include #endif diff --git a/src/x-java.l b/src/x-java.l index a9ead9244..93be315f7 100644 --- a/src/x-java.l +++ b/src/x-java.l @@ -38,7 +38,7 @@ typedef enum JAVA_STRING, JAVA_OPERATOR, JAVA_FLOW, - JAVA_COMMENT, + JAVA_COMMENT } TOKEN_TYPE; typedef struct @@ -62,7 +62,7 @@ typedef enum STATE_WORD, STATE_APPEND, STATE_INVOCATION, - STATE_KEYWORD, + STATE_KEYWORD } PARSER_STATE; typedef struct diff --git a/src/x-lisp.c b/src/x-lisp.c index a8671dc3b..314578639 100644 --- a/src/x-lisp.c +++ b/src/x-lisp.c @@ -82,9 +82,6 @@ struct object; static void init_keywords PARAMS ((void)); static int do_getc PARAMS ((void)); static void do_ungetc PARAMS ((int c)); -static enum syntax_code syntax_code_of PARAMS ((unsigned char c)); -static void read_char_syntax PARAMS ((struct char_syntax *p)); -static enum attribute attribute_of PARAMS ((unsigned char c)); static inline void init_token PARAMS ((struct token *tp)); static inline void free_token PARAMS ((struct token *tp)); static inline void grow_token PARAMS ((struct token *tp)); @@ -273,6 +270,11 @@ enum syntax_code syntax_nt_macro /* '#' (non-terminating macro) */ }; +/* Prototypes for local functions. Needed to ensure compiler checking of + function argument counts despite of K&R C function definition syntax. */ +static enum syntax_code syntax_code_of PARAMS ((unsigned char c)); +static void read_char_syntax PARAMS ((struct char_syntax *p)); + /* Returns the syntax code of a character. */ static enum syntax_code syntax_code_of (c) @@ -340,6 +342,10 @@ enum attribute #define is_letter_attribute(a) ((a) >= a_letter) #define is_number_attribute(a) ((a) >= a_ratio) +/* Prototypes for local functions. Needed to ensure compiler checking of + function argument counts despite of K&R C function definition syntax. */ +static enum attribute attribute_of PARAMS ((unsigned char c)); + /* Returns the attribute of a character, assuming base 10. */ static enum attribute attribute_of (c)