summaryrefslogtreecommitdiff
path: root/lib/stdio-impl.h
diff options
context:
space:
mode:
authorJinWang An <jinwang.an@samsung.com>2021-12-28 12:58:57 +0900
committerJinWang An <jinwang.an@samsung.com>2021-12-28 12:58:57 +0900
commit253a2fc5d9cd390d78a209f08af8ae31b13c44d8 (patch)
tree5ec9aa82542909ecfc0859277d941528857a59b7 /lib/stdio-impl.h
parent931b01b091932a1f796c23379ea32abb68bd5895 (diff)
downloadm4-253a2fc5d9cd390d78a209f08af8ae31b13c44d8.tar.gz
m4-253a2fc5d9cd390d78a209f08af8ae31b13c44d8.tar.bz2
m4-253a2fc5d9cd390d78a209f08af8ae31b13c44d8.zip
Imported Upstream version 1.4.18upstream/1.4.18
Diffstat (limited to 'lib/stdio-impl.h')
-rw-r--r--lib/stdio-impl.h34
1 files changed, 31 insertions, 3 deletions
diff --git a/lib/stdio-impl.h b/lib/stdio-impl.h
index 45291cf..766d693 100644
--- a/lib/stdio-impl.h
+++ b/lib/stdio-impl.h
@@ -1,5 +1,5 @@
/* Implementation details of FILE streams.
- Copyright (C) 2007-2008, 2010-2013 Free Software Foundation, Inc.
+ Copyright (C) 2007-2008, 2010-2016 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
@@ -28,7 +28,8 @@
#include <errno.h> /* For detecting Plan9. */
-#if defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin */
+#if defined __sferror || defined __DragonFly__ || defined __ANDROID__
+ /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */
# if defined __DragonFly__ /* DragonFly */
/* See <http://www.dragonflybsd.org/cvsweb/src/lib/libc/stdio/priv_stdio.h?rev=HEAD&content-type=text/x-cvsweb-markup>. */
@@ -66,7 +67,7 @@
/* More fields, not relevant here. */
};
# define fp_ub ((struct __sfileext *) fp->_ext._base)->_ub
-# else /* FreeBSD, NetBSD <= 1.5Z, DragonFly, Mac OS X, Cygwin */
+# else /* FreeBSD, NetBSD <= 1.5Z, DragonFly, Mac OS X, Cygwin, Android */
# define fp_ub fp_->_ub
# endif
@@ -109,4 +110,31 @@
# define _flag __flag
# endif
+#elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ /* newer Windows with MSVC */
+
+/* <stdio.h> does not define the innards of FILE any more. */
+# define WINDOWS_OPAQUE_FILE
+
+struct _gl_real_FILE
+{
+ /* Note: Compared to older Windows and to mingw, it has the fields
+ _base and _cnt swapped. */
+ unsigned char *_ptr;
+ unsigned char *_base;
+ int _cnt;
+ int _flag;
+ int _file;
+ int _charbuf;
+ int _bufsiz;
+};
+# define fp_ ((struct _gl_real_FILE *) fp)
+
+/* These values were determined by a program similar to the one at
+ <http://lists.gnu.org/archive/html/bug-gnulib/2010-12/msg00165.html>. */
+# define _IOREAD 0x1
+# define _IOWRT 0x2
+# define _IORW 0x4
+# define _IOEOF 0x8
+# define _IOERR 0x10
+
#endif