From: Bruno Haible Date: Thu, 25 Jan 2001 14:24:46 +0000 (+0000) Subject: Support for platforms with O_TEXT != O_BINARY. X-Git-Tag: v0.10.36~169 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=753c4e669660f8b144528ac97accfd707556ea51;p=thirdparty%2Fgettext.git Support for platforms with O_TEXT != O_BINARY. --- diff --git a/Admin/plans b/Admin/plans index 9626acda1..55c43962d 100644 --- a/Admin/plans +++ b/Admin/plans @@ -47,11 +47,12 @@ Things we plan to do. Comments welcome. - KDE wants a kind of gettext2("role","msg") function whose key is the concatenation of "role" and "msg" but whose default value is only "msg". -- For cygwin: Call open() with O_BINARY. - - Ask EMX, cygwin, mingw32, pw people for testing. - Add msvc Makefile. - Look at Ben Bullock's manual: http://www.hayamasa.demon.co.uk/doc/gettext.texi +- Provide a way to merge two .po files, coming from different translators of + the same pot file. + diff --git a/intl/ChangeLog b/intl/ChangeLog index 76fcde25d..cfebb3510 100644 --- a/intl/ChangeLog +++ b/intl/ChangeLog @@ -1,3 +1,8 @@ +2001-01-20 Bruno Haible + + * loadmsgcat.c (O_BINARY): Define on platforms that don't have it. + (_nl_load_domain): Open the catalog file in binary mode. + 2001-01-24 Bruno Haible * gettextP.h (SWAP): Remove declaration, to work around a compilation diff --git a/intl/loadmsgcat.c b/intl/loadmsgcat.c index d8c397235..b175bc16c 100644 --- a/intl/loadmsgcat.c +++ b/intl/loadmsgcat.c @@ -108,6 +108,23 @@ char *alloca (); # define freea(p) free (p) #endif +/* For systems that distinguish between text and binary I/O. + O_BINARY is usually declared in . */ +#if !defined O_BINARY && defined _O_BINARY + /* For MSC-compatible compilers. */ +# define O_BINARY _O_BINARY +# define O_TEXT _O_TEXT +#endif +#ifdef __BEOS__ + /* BeOS 5 has O_BINARY and O_TEXT, but they have no effect. */ +# undef O_BINARY +# undef O_TEXT +#endif +/* On reasonable systems, binary I/O is the default. */ +#ifndef O_BINARY +# define O_BINARY 0 +#endif + /* We need a sign, whether a new catalog was loaded, which can be associated with all translations. This is important if the translations are cached by one of GCC's features. */ @@ -206,7 +223,7 @@ _nl_load_domain (domain_file) return; /* Try to open the addressed file. */ - fd = open (domain_file->filename, O_RDONLY); + fd = open (domain_file->filename, O_RDONLY | O_BINARY); if (fd == -1) return;