]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Support for platforms with O_TEXT != O_BINARY.
authorBruno Haible <bruno@clisp.org>
Thu, 25 Jan 2001 14:24:46 +0000 (14:24 +0000)
committerBruno Haible <bruno@clisp.org>
Thu, 25 Jan 2001 14:24:46 +0000 (14:24 +0000)
Admin/plans
intl/ChangeLog
intl/loadmsgcat.c

index 9626acda193b528e76095dce04e866f47459069e..55c43962d582adf4dd61539a3f82799072cf06b3 100644 (file)
@@ -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.
+
index 76fcde25d24aaf5e17cef9474a8004b2d8f37ecd..cfebb3510f7680da9116279b0fed87fa8d95fb4c 100644 (file)
@@ -1,3 +1,8 @@
+2001-01-20  Bruno Haible  <haible@clisp.cons.org>
+
+       * 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  <haible@clisp.cons.org>
 
        * gettextP.h (SWAP): Remove declaration, to work around a compilation
index d8c397235dd9793e6741478cb35e1ab858a60250..b175bc16c2c664a8b7f445f0fa84806c58be56aa 100644 (file)
@@ -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 <fcntl.h>. */
+#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;