aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2003-03-07 20:41:49 +0000
committerCorinna Vinschen <corinna@vinschen.de>2003-03-07 20:41:49 +0000
commit5582abd2c78a738bc9559c8807acbe62d4e07f48 (patch)
treec2394d35badffe5f76f20044c0afa9e03bd0bf7a
parent6f8102cb71a334f84127e14929855cebf9680c02 (diff)
downloadnewlib-5582abd2c78a738bc9559c8807acbe62d4e07f48.zip
newlib-5582abd2c78a738bc9559c8807acbe62d4e07f48.tar.gz
newlib-5582abd2c78a738bc9559c8807acbe62d4e07f48.tar.bz2
* configure.host: Define stdio64_dir for Cygwin.
* libc/include/stdio.h: Change definition of fpos_t to fulfill Cygwin 64bit file access requirements. Drop definition of f*64() functions when compiled for Cygwin. * libc/include/sys/config.h: Define __LARGE64_FILES for Cygwin. * libc/reent/lseek64r.c: Use _off64_t instead of off64_t. * libc/stdio64/local64.h: Use _fpos64_t instead of fpos64_t.
-rw-r--r--newlib/ChangeLog10
-rw-r--r--newlib/configure.host1
-rw-r--r--newlib/libc/include/stdio.h12
-rw-r--r--newlib/libc/include/sys/config.h1
-rw-r--r--newlib/libc/reent/lseek64r.c8
-rw-r--r--newlib/libc/stdio64/local64.h4
6 files changed, 29 insertions, 7 deletions
diff --git a/newlib/ChangeLog b/newlib/ChangeLog
index 350c895..ba0adba 100644
--- a/newlib/ChangeLog
+++ b/newlib/ChangeLog
@@ -1,3 +1,13 @@
+2003-03-07 Corinna Vinschen <corinna@vinschen.de>
+
+ * configure.host: Define stdio64_dir for Cygwin.
+ * libc/include/stdio.h: Change definition of fpos_t to fulfill
+ Cygwin 64bit file access requirements.
+ Drop definition of f*64() functions when compiled for Cygwin.
+ * libc/include/sys/config.h: Define __LARGE64_FILES for Cygwin.
+ * libc/reent/lseek64r.c: Use _off64_t instead of off64_t.
+ * libc/stdio64/local64.h: Use _fpos64_t instead of fpos64_t.
+
2003-03-07 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/sys/reent.h: Remove extraneous _sig_func
diff --git a/newlib/configure.host b/newlib/configure.host
index 49d23b8..07ef607 100644
--- a/newlib/configure.host
+++ b/newlib/configure.host
@@ -288,6 +288,7 @@ case "${host}" in
*-*-cygwin*)
sys_dir=cygwin
posix_dir=posix
+ stdio64_dir=stdio64
;;
*-*-netware*)
signal_dir=
diff --git a/newlib/libc/include/stdio.h b/newlib/libc/include/stdio.h
index 033e479..3e1162c 100644
--- a/newlib/libc/include/stdio.h
+++ b/newlib/libc/include/stdio.h
@@ -47,12 +47,20 @@
_BEGIN_STD_C
-typedef _fpos_t fpos_t;
typedef __FILE FILE;
+#ifdef __CYGWIN__
+#ifdef __CYGWIN_USE_BIG_TYPES__
+typedef _fpos64_t fpos_t;
+#else
+typedef _fpos_t fpos_t;
+#endif
+#else
+typedef _fpos_t fpos_t;
#ifdef __LARGE64_FILES
typedef _fpos64_t fpos64_t;
#endif
+#endif /* !__CYGWIN__ */
#include <sys/stdio.h>
@@ -287,6 +295,7 @@ ssize_t _EXFUN(__getdelim, (char **, size_t *, int, FILE *));
ssize_t _EXFUN(__getline, (char **, size_t *, FILE *));
#ifdef __LARGE64_FILES
+#ifndef __CYGWIN__
FILE * _EXFUN(fopen64, (const char *, const char *));
_off64_t _EXFUN(ftello64, (FILE *));
_off64_t _EXFUN(fseeko64, (FILE *, _off64_t, int));
@@ -300,6 +309,7 @@ _off64_t _EXFUN(_fseeko64_r, (struct _reent *, FILE *, _off64_t, int));
int _EXFUN(_fgetpos64_r, (struct _reent *, FILE *, _fpos64_t *));
int _EXFUN(_fsetpos64_r, (struct _reent *, FILE *, const _fpos64_t *));
FILE * _EXFUN(_tmpfile64_r, (struct _reent *));
+#endif /* !__CYGWIN__ */
#endif /* __LARGE64_FILES */
/*
diff --git a/newlib/libc/include/sys/config.h b/newlib/libc/include/sys/config.h
index ad0270c..9e14ebe 100644
--- a/newlib/libc/include/sys/config.h
+++ b/newlib/libc/include/sys/config.h
@@ -151,6 +151,7 @@
#if defined(__CYGWIN32__) || defined(__CYGWIN__)
#define __FILENAME_MAX__ (260 - 1 /* NUL */)
#define _READ_WRITE_RETURN_TYPE _ssize_t
+#define __LARGE64_FILES 1
#if defined(__INSIDE_CYGWIN__) || defined(_COMPILING_NEWLIB)
#define __IMPORT
#else
diff --git a/newlib/libc/reent/lseek64r.c b/newlib/libc/reent/lseek64r.c
index 886734b..342cae2 100644
--- a/newlib/libc/reent/lseek64r.c
+++ b/newlib/libc/reent/lseek64r.c
@@ -48,17 +48,17 @@ DESCRIPTION
with large file support.
*/
-off64_t
+_off64_t
_lseek64_r (ptr, fd, pos, whence)
struct _reent *ptr;
int fd;
- off64_t pos;
+ _off64_t pos;
int whence;
{
- off64_t ret;
+ _off64_t ret;
errno = 0;
- if ((ret = _lseek64 (fd, pos, whence)) == (off64_t) -1 && errno != 0)
+ if ((ret = _lseek64 (fd, pos, whence)) == (_off64_t) -1 && errno != 0)
ptr->_errno = errno;
return ret;
}
diff --git a/newlib/libc/stdio64/local64.h b/newlib/libc/stdio64/local64.h
index b1ed1dc..98bea6b 100644
--- a/newlib/libc/stdio64/local64.h
+++ b/newlib/libc/stdio64/local64.h
@@ -6,8 +6,8 @@
#include "local.h"
#ifdef __LARGE64_FILES
-extern fpos64_t _EXFUN(__sseek64,(void *, fpos64_t, int));
-extern fpos64_t _EXFUN(__sseek64_error,(void *, fpos64_t, int));
+extern _fpos64_t _EXFUN(__sseek64,(void *, _fpos64_t, int));
+extern _fpos64_t _EXFUN(__sseek64_error,(void *, _fpos64_t, int));
extern _READ_WRITE_RETURN_TYPE _EXFUN(__swrite64,(void *, char const *, int));
#endif