summaryrefslogtreecommitdiffstats
path: root/intl/loadmsgcat.c
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2001-01-25 14:24:46 +0000
committerBruno Haible <bruno@clisp.org>2001-01-25 14:24:46 +0000
commit753c4e669660f8b144528ac97accfd707556ea51 (patch)
tree3ef1202f51aeea2a16d7c851bf58655009c50308 /intl/loadmsgcat.c
parent5c525c62afe57d29bf40124af3cb881dee69cba2 (diff)
downloadexternal_gettext-753c4e669660f8b144528ac97accfd707556ea51.zip
external_gettext-753c4e669660f8b144528ac97accfd707556ea51.tar.gz
external_gettext-753c4e669660f8b144528ac97accfd707556ea51.tar.bz2
Support for platforms with O_TEXT != O_BINARY.
Diffstat (limited to 'intl/loadmsgcat.c')
-rw-r--r--intl/loadmsgcat.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/intl/loadmsgcat.c b/intl/loadmsgcat.c
index d8c3972..b175bc1 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 <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;