From: Bruno Haible Date: Sun, 24 Aug 2003 17:53:56 +0000 (+0000) Subject: Support for building DLLs on Windows. X-Git-Tag: v0.13~311 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=56074a81392802dc3632c1edc76eabdb18d3f759;p=thirdparty%2Fgettext.git Support for building DLLs on Windows. --- diff --git a/gettext-tools/lib/argmatch.h b/gettext-tools/lib/argmatch.h index deb908fb9..85cbc8cbb 100644 --- a/gettext-tools/lib/argmatch.h +++ b/gettext-tools/lib/argmatch.h @@ -1,5 +1,5 @@ /* argmatch.h -- definitions and prototypes for argmatch.c - Copyright (C) 1990, 1998, 1999, 2001, 2002 Free Software Foundation, Inc. + Copyright (C) 1990, 1998, 1999, 2001-2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -57,7 +57,7 @@ int argmatch (char const *arg, char const *const *arglist, return. By default, this is a function that calls ARGMATCH_DIE which in turn defaults to `exit (EXIT_FAILURE)'. */ typedef void (*argmatch_exit_fn) (void); -extern argmatch_exit_fn argmatch_die; +extern DLL_VARIABLE argmatch_exit_fn argmatch_die; /* Report on stderr why argmatch failed. Report correct values. */ diff --git a/gettext-tools/lib/error-progname.h b/gettext-tools/lib/error-progname.h index f13d55de9..c70d1d54e 100644 --- a/gettext-tools/lib/error-progname.h +++ b/gettext-tools/lib/error-progname.h @@ -38,7 +38,7 @@ extern "C" { Default is true. A reason to omit the prefix is for better interoperability with Emacs' compile.el. */ -extern bool error_with_progname; +extern DLL_VARIABLE bool error_with_progname; /* Print program_name prefix on stderr if and only if error_with_progname is true. */ diff --git a/gettext-tools/lib/getopt.h b/gettext-tools/lib/getopt.h index 4283c35b1..3b0732fdb 100644 --- a/gettext-tools/lib/getopt.h +++ b/gettext-tools/lib/getopt.h @@ -1,5 +1,5 @@ /* Declarations for getopt. - Copyright (C) 1989-1994, 1996-1999, 2001 Free Software Foundation, Inc. + Copyright (C) 1989-1994, 1996-1999, 2001, 2003 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -44,7 +44,7 @@ extern "C" { Also, when `ordering' is RETURN_IN_ORDER, each non-option ARGV-element is returned here. */ -extern char *optarg; +extern DLL_VARIABLE char *optarg; /* Index in ARGV of the next element to be scanned. This is used for communication to and from the caller @@ -58,16 +58,16 @@ extern char *optarg; Otherwise, `optind' communicates from one call to the next how much of ARGV has been scanned so far. */ -extern int optind; +extern DLL_VARIABLE int optind; /* Callers store zero here to inhibit the error message `getopt' prints for unrecognized options. */ -extern int opterr; +extern DLL_VARIABLE int opterr; /* Set to an option character which was unrecognized. */ -extern int optopt; +extern DLL_VARIABLE int optopt; #ifndef __need_getopt /* Describe the long-named options requested by the application. diff --git a/gettext-tools/lib/obstack.h b/gettext-tools/lib/obstack.h index c949730e5..9c91977ff 100644 --- a/gettext-tools/lib/obstack.h +++ b/gettext-tools/lib/obstack.h @@ -1,5 +1,5 @@ /* obstack.h - object stack macros - Copyright (C) 1988,89,90,91,92,93,94,96,97,98,99 Free Software Foundation, Inc. + Copyright (C) 1988-1994, 1996-1999, 2003 Free Software Foundation, Inc. This file is part of the GNU C Library. Its master source is NOT part of the C library, however. The master source lives in /gd/gnu/lib. @@ -261,13 +261,13 @@ int obstack_memory_used (struct obstack *obstack); should either abort gracefully or use longjump - but shouldn't return. The default action is to print a message and abort. */ #if defined __STDC__ && __STDC__ -extern void (*obstack_alloc_failed_handler) (void); +extern DLL_VARIABLE void (*obstack_alloc_failed_handler) (void); #else -extern void (*obstack_alloc_failed_handler) (); +extern DLL_VARIABLE void (*obstack_alloc_failed_handler) (); #endif /* Exit value used when `print_and_abort' is used. */ -extern int obstack_exit_failure; +extern DLL_VARIABLE int obstack_exit_failure; /* Pointer to beginning of object being allocated or to be allocated next. Note that this might not be the final address of the object diff --git a/gettext-tools/lib/progname.h b/gettext-tools/lib/progname.h index 85169c356..171ece988 100644 --- a/gettext-tools/lib/progname.h +++ b/gettext-tools/lib/progname.h @@ -32,7 +32,7 @@ extern "C" { /* String containing name the program is called with. */ -extern const char *program_name; +extern DLL_VARIABLE const char *program_name; /* Set program_name, based on argv[0]. */ extern void set_program_name (const char *argv0); diff --git a/gettext-tools/src/Makefile.am b/gettext-tools/src/Makefile.am index 9c747090a..6bcadb0f2 100644 --- a/gettext-tools/src/Makefile.am +++ b/gettext-tools/src/Makefile.am @@ -221,7 +221,7 @@ BUILT_SOURCES = \ po-lex.o po-lex.lo: po-gram-gen2.h po-gram-gen2.h: po-gram-gen.h - $(SED) 's/yy/po_gram_/g' $(srcdir)/po-gram-gen.h > $@-tmp + $(SED) -e 's/yy/po_gram_/g' -e 's/extern /extern DLL_VARIABLE /' $(srcdir)/po-gram-gen.h > $@-tmp mv $@-tmp $@ # We must add the '#include ' here, not inside x-java.l, diff --git a/gettext-tools/src/format.h b/gettext-tools/src/format.h index ad01e5bfa..1d173800a 100644 --- a/gettext-tools/src/format.h +++ b/gettext-tools/src/format.h @@ -61,24 +61,24 @@ struct formatstring_parser }; /* Format string parsers, each defined in its own file. */ -extern struct formatstring_parser formatstring_c; -extern struct formatstring_parser formatstring_python; -extern struct formatstring_parser formatstring_lisp; -extern struct formatstring_parser formatstring_elisp; -extern struct formatstring_parser formatstring_librep; -extern struct formatstring_parser formatstring_smalltalk; -extern struct formatstring_parser formatstring_java; -extern struct formatstring_parser formatstring_awk; -extern struct formatstring_parser formatstring_pascal; -extern struct formatstring_parser formatstring_ycp; -extern struct formatstring_parser formatstring_tcl; -extern struct formatstring_parser formatstring_perl; -extern struct formatstring_parser formatstring_perl_brace; -extern struct formatstring_parser formatstring_php; -extern struct formatstring_parser formatstring_gcc_internal; +extern DLL_VARIABLE struct formatstring_parser formatstring_c; +extern DLL_VARIABLE struct formatstring_parser formatstring_python; +extern DLL_VARIABLE struct formatstring_parser formatstring_lisp; +extern DLL_VARIABLE struct formatstring_parser formatstring_elisp; +extern DLL_VARIABLE struct formatstring_parser formatstring_librep; +extern DLL_VARIABLE struct formatstring_parser formatstring_smalltalk; +extern DLL_VARIABLE struct formatstring_parser formatstring_java; +extern DLL_VARIABLE struct formatstring_parser formatstring_awk; +extern DLL_VARIABLE struct formatstring_parser formatstring_pascal; +extern DLL_VARIABLE struct formatstring_parser formatstring_ycp; +extern DLL_VARIABLE struct formatstring_parser formatstring_tcl; +extern DLL_VARIABLE struct formatstring_parser formatstring_perl; +extern DLL_VARIABLE struct formatstring_parser formatstring_perl_brace; +extern DLL_VARIABLE struct formatstring_parser formatstring_php; +extern DLL_VARIABLE struct formatstring_parser formatstring_gcc_internal; /* Table of all format string parsers. */ -extern struct formatstring_parser *formatstring_parsers[NFORMATS]; +extern DLL_VARIABLE struct formatstring_parser *formatstring_parsers[NFORMATS]; /* Returns an array of the ISO C 99 format directives contained in the argument string. *intervalsp is assigned to a freshly diff --git a/gettext-tools/src/message.h b/gettext-tools/src/message.h index 4968b5ec1..20aae574f 100644 --- a/gettext-tools/src/message.h +++ b/gettext-tools/src/message.h @@ -57,8 +57,8 @@ enum format_type format_gcc_internal }; #define NFORMATS 15 /* Number of format_type enum values. */ -extern const char *const format_language[NFORMATS]; -extern const char *const format_language_pretty[NFORMATS]; +extern DLL_VARIABLE const char *const format_language[NFORMATS]; +extern DLL_VARIABLE const char *const format_language_pretty[NFORMATS]; /* Is current msgid a format string? */ enum is_format diff --git a/gettext-tools/src/msgl-cat.h b/gettext-tools/src/msgl-cat.h index abdc56495..e4035a070 100644 --- a/gettext-tools/src/msgl-cat.h +++ b/gettext-tools/src/msgl-cat.h @@ -31,20 +31,20 @@ extern "C" { /* These variables control which messages are selected. */ -extern int more_than; -extern int less_than; +extern DLL_VARIABLE int more_than; +extern DLL_VARIABLE int less_than; /* If true, use the first available translation. If false, merge all available translations into one and fuzzy it. */ -extern bool use_first; +extern DLL_VARIABLE bool use_first; /* If true, merge like msgcomm. If false, merge like msgcat and msguniq. */ -extern bool msgcomm_mode; +extern DLL_VARIABLE bool msgcomm_mode; /* If true, omit the header entry. If false, keep the header entry present in the input. */ -extern bool omit_header; +extern DLL_VARIABLE bool omit_header; extern msgdomain_list_ty * catenate_msgdomain_list (string_list_ty *file_list, diff --git a/gettext-tools/src/plural-table.h b/gettext-tools/src/plural-table.h index ae7a7a850..c8dffdd96 100644 --- a/gettext-tools/src/plural-table.h +++ b/gettext-tools/src/plural-table.h @@ -1,5 +1,5 @@ /* Table of known plural form expressions. - Copyright (C) 2001-2002 Free Software Foundation, Inc. + Copyright (C) 2001-2003 Free Software Foundation, Inc. Written by Bruno Haible , 2002. This program is free software; you can redistribute it and/or modify @@ -28,7 +28,7 @@ struct plural_table_entry const char *value; }; -extern struct plural_table_entry plural_table[]; -extern const size_t plural_table_size; +extern DLL_VARIABLE struct plural_table_entry plural_table[]; +extern DLL_VARIABLE const size_t plural_table_size; #endif /* _PLURAL_TABLE_H */ diff --git a/gettext-tools/src/po-charset.h b/gettext-tools/src/po-charset.h index 887a5b4fe..951e94515 100644 --- a/gettext-tools/src/po-charset.h +++ b/gettext-tools/src/po-charset.h @@ -37,10 +37,10 @@ extern "C" { extern const char *po_charset_canonicalize (const char *charset); /* The canonicalized encoding name for ASCII. */ -extern const char *po_charset_ascii; +extern DLL_VARIABLE const char *po_charset_ascii; /* The canonicalized encoding name for UTF-8. */ -extern const char *po_charset_utf8; +extern DLL_VARIABLE const char *po_charset_utf8; /* Test for ASCII compatibility. */ extern bool po_charset_ascii_compatible (const char *canon_charset); @@ -57,15 +57,15 @@ extern bool po_is_charset_weird_cjk (const char *canon_charset); /* The PO file's encoding, as specified in the header entry. */ -extern const char *po_lex_charset; +extern DLL_VARIABLE const char *po_lex_charset; #if HAVE_ICONV /* Converter from the PO file's encoding to UTF-8. */ -extern iconv_t po_lex_iconv; +extern DLL_VARIABLE iconv_t po_lex_iconv; #endif /* If no converter is available, some information about the structure of the PO file's encoding. */ -extern bool po_lex_weird_cjk; +extern DLL_VARIABLE bool po_lex_weird_cjk; /* Initialize the PO file's encoding. */ extern void po_lex_charset_init (void); diff --git a/gettext-tools/src/po-lex.h b/gettext-tools/src/po-lex.h index c9e0aafc2..12ee22528 100644 --- a/gettext-tools/src/po-lex.h +++ b/gettext-tools/src/po-lex.h @@ -40,15 +40,15 @@ extern "C" { /* Global variables from po-lex.c. */ /* Current position within the PO file. */ -extern lex_pos_ty gram_pos; -extern int gram_pos_column; +extern DLL_VARIABLE lex_pos_ty gram_pos; +extern DLL_VARIABLE int gram_pos_column; /* Number of parse errors within a PO file that cause the program to terminate. Cf. error_message_count, declared in . */ -extern unsigned int gram_max_allowed_errors; +extern DLL_VARIABLE unsigned int gram_max_allowed_errors; /* True if obsolete entries shall be considered as valid. */ -extern bool pass_obsolete_entries; +extern DLL_VARIABLE bool pass_obsolete_entries; /* Prepare lexical analysis. */ diff --git a/gettext-tools/src/read-po.h b/gettext-tools/src/read-po.h index f40163e75..c3cb9bf6d 100644 --- a/gettext-tools/src/read-po.h +++ b/gettext-tools/src/read-po.h @@ -151,15 +151,15 @@ extern default_po_reader_ty * /* If nonzero, remember comments for file name and line number for each msgid, if present in the reference input. Defaults to true. */ -extern int line_comment; +extern DLL_VARIABLE int line_comment; /* If false, duplicate msgids in the same domain and file generate an error. If true, such msgids are allowed; the caller should treat them appropriately. Defaults to false. */ -extern bool allow_duplicates; +extern DLL_VARIABLE bool allow_duplicates; /* Expected syntax of the input files. */ -extern input_syntax_ty input_syntax; +extern DLL_VARIABLE input_syntax_ty input_syntax; /* Read the input file from a stream. Returns a list of messages. */ extern msgdomain_list_ty *read_po (FILE *fp, const char *real_filename, diff --git a/gettext-tools/src/write-mo.h b/gettext-tools/src/write-mo.h index b0b492300..ce40463a3 100644 --- a/gettext-tools/src/write-mo.h +++ b/gettext-tools/src/write-mo.h @@ -1,5 +1,5 @@ /* Writing binary .mo files. - Copyright (C) 1995-1998, 2000-2002 Free Software Foundation, Inc. + Copyright (C) 1995-1998, 2000-2003 Free Software Foundation, Inc. Written by Ulrich Drepper , April 1995. This program is free software; you can redistribute it and/or modify @@ -25,10 +25,10 @@ #include "message.h" /* Alignment of strings in resulting .mo file. */ -extern size_t alignment; +extern DLL_VARIABLE size_t alignment; /* True if no hash table in .mo is wanted. */ -extern bool no_hash_table; +extern DLL_VARIABLE bool no_hash_table; /* Write a GNU mo file. mlp is a list containing the messages to be output. domain_name is the domain name, file_name is the desired file name.