This is the mail archive of the
libstdc++@sourceware.cygnus.com
mailing list for the libstdc++ project.
Patches to libio
- To: libstdc++@sourceware.cygnus.com
- Subject: Patches to libio
- From: "Martin v. Loewis" <martin@mira.isdn.cs.tu-berlin.de>
- Date: Thu, 15 Apr 1999 09:26:20 +0200
I just tried to compile libstdc++ v3 from CVS on i586-pc-linux-gnu.
Compilation of libio failed, because the following patches are
missing.
There is one error in this patch: file_fopen takes another integer
argument, and I didn't figure out what it is good for.
Please let me know if you need further information.
Martin
1999-04-15 Martin von Löwis <loewis@informatik.hu-berlin.de>
* fileops.c (_IO_file_fopen): Support 0x20001 signatures.
(_IO_file_seekoff, _IO_file_seek): Likewise.
* genops.c (_IO_default_seekpos, _IO_default_seekoff,
_IO_default_seek): Likewise.
* ioseekoff.c (_IO_seekoff): Likewise.
* ioseekpos.c (_IO_seekpos): Likewise.
* strops.c (_IO_str_seekoff): Likewise.
Index: fileops.c
===================================================================
RCS file: /cvs/libstdc++/libstdc++/libio/fileops.c,v
retrieving revision 1.1
diff -u -r1.1 fileops.c
--- fileops.c 1999/01/22 17:14:14 1.1
+++ fileops.c 1999/04/15 07:16:04
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1995, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1995, 1997, 1999 Free Software Foundation, Inc.
This file is part of the GNU IO Library.
Written by Per Bothner <bothner@cygnus.com>.
@@ -158,11 +158,20 @@
_IO_default_finish (fp, 0);
}
+#if _G_IO_IO_FILE_VERSION == 0x20001
_IO_FILE *
+_IO_file_fopen (fp, filename, mode, unknown)
+ _IO_FILE *fp;
+ const char *filename;
+ const char *mode;
+ int unknown;
+#else
+_IO_FILE *
_IO_file_fopen (fp, filename, mode)
_IO_FILE *fp;
const char *filename;
const char *mode;
+#endif
{
int oflags = 0, omode;
int read_write, fdesc;
@@ -422,12 +431,21 @@
return retval;
}
+#if defined(_G_IO_IO_FILE_VERSION) && _G_IO_IO_FILE_VERSION == 0x20001
+_IO_fpos64_t
+_IO_file_seekoff (fp, offset, dir, mode)
+ _IO_FILE *fp;
+ _IO_off64_t offset;
+ int dir;
+ int mode;
+#else
_IO_pos_t
_IO_file_seekoff (fp, offset, dir, mode)
_IO_FILE *fp;
_IO_off_t offset;
int dir;
int mode;
+#endif
{
_IO_pos_t result;
_IO_off_t delta, new_offset;
@@ -590,11 +608,19 @@
return read (fp->_fileno, buf, size);
}
+#if defined(_G_IO_IO_FILE_VERSION) && _G_IO_IO_FILE_VERSION == 0x20001
+_IO_fpos64_t
+_IO_file_seek (fp, offset, dir)
+ _IO_FILE *fp;
+ _IO_off64_t offset;
+ int dir;
+#else
_IO_pos_t
_IO_file_seek (fp, offset, dir)
_IO_FILE *fp;
_IO_off_t offset;
int dir;
+#endif
{
return lseek (fp->_fileno, offset, dir);
}
Index: genops.c
===================================================================
RCS file: /cvs/libstdc++/libstdc++/libio/genops.c,v
retrieving revision 1.1
diff -u -r1.1 genops.c
--- genops.c 1999/01/22 17:14:15 1.1
+++ genops.c 1999/04/15 07:16:05
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1995, 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1995, 1997, 1998, 1999 Free Software Foundation, Inc.
This file is part of the GNU IO Library.
This library is free software; you can redistribute it and/or
@@ -467,11 +467,19 @@
return fp;
}
+#if defined(_G_IO_IO_FILE_VERSION) && _G_IO_IO_FILE_VERSION == 0x20001
+_IO_fpos64_t
+_IO_default_seekpos (fp, pos, mode)
+ _IO_FILE *fp;
+ _IO_fpos64_t pos;
+ int mode;
+#else
_IO_pos_t
_IO_default_seekpos (fp, pos, mode)
_IO_FILE *fp;
- _IO_pos_t pos;
+ _IOfpos_t pos;
int mode;
+#endif
{
return _IO_SEEKOFF (fp, _IO_pos_as_off (pos), 0, mode);
}
@@ -551,12 +559,21 @@
_IO_un_link (fp);
}
+#if defined(_G_IO_IO_FILE_VERSION) && _G_IO_IO_FILE_VERSION == 0x20001
+_IO_fpos64_t
+_IO_default_seekoff (fp, offset, dir, mode)
+ _IO_FILE *fp;
+ _IO_off64_t offset;
+ int dir;
+ int mode;
+#else
_IO_pos_t
_IO_default_seekoff (fp, offset, dir, mode)
_IO_FILE *fp;
_IO_off_t offset;
int dir;
int mode;
+#endif
{
return _IO_pos_BAD;
}
@@ -882,11 +899,19 @@
return (unsigned char) *fp->_IO_read_ptr;
}
+#if defined(_G_IO_IO_FILE_VERSION) && _G_IO_IO_FILE_VERSION == 0x20001
+_IO_fpos64_t
+_IO_default_seek (fp, offset, dir)
+ _IO_FILE *fp;
+ _IO_off64_t offset;
+ int dir;
+#else
_IO_pos_t
_IO_default_seek (fp, offset, dir)
_IO_FILE *fp;
_IO_off_t offset;
int dir;
+#endif
{
return _IO_pos_BAD;
}
Index: ioseekoff.c
===================================================================
RCS file: /cvs/libstdc++/libstdc++/libio/ioseekoff.c,v
retrieving revision 1.1
diff -u -r1.1 ioseekoff.c
--- ioseekoff.c 1999/01/22 17:14:15 1.1
+++ ioseekoff.c 1999/04/15 07:16:05
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1997, 1999 Free Software Foundation, Inc.
This file is part of the GNU IO Library.
This library is free software; you can redistribute it and/or
@@ -25,12 +25,21 @@
#include <libioP.h>
+#if defined(_G_IO_IO_FILE_VERSION) && _G_IO_IO_FILE_VERSION == 0x20001
+_IO_fpos64_t
+_IO_seekoff (fp, offset, dir, mode)
+ _IO_FILE *fp;
+ _IO_off64_t offset;
+ int dir;
+ int mode;
+#else
_IO_pos_t
_IO_seekoff (fp, offset, dir, mode)
_IO_FILE *fp;
_IO_off_t offset;
int dir;
int mode;
+#endif
{
_IO_pos_t retval;
Index: ioseekpos.c
===================================================================
RCS file: /cvs/libstdc++/libstdc++/libio/ioseekpos.c,v
retrieving revision 1.1
diff -u -r1.1 ioseekpos.c
--- ioseekpos.c 1999/01/22 17:14:16 1.1
+++ ioseekpos.c 1999/04/15 07:16:05
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1997, 1999 Free Software Foundation, Inc.
This file is part of the GNU IO Library.
This library is free software; you can redistribute it and/or
@@ -25,11 +25,19 @@
#include <libioP.h>
+#if defined(_G_IO_IO_FILE_VERSION) && _G_IO_IO_FILE_VERSION == 0x20001
+_IO_fpos64_t
+_IO_seekpos (fp, pos, mode)
+ _IO_FILE *fp;
+ _IO_fpos64_t pos;
+ int mode;
+#else
_IO_pos_t
_IO_seekpos (fp, pos, mode)
_IO_FILE *fp;
_IO_pos_t pos;
int mode;
+#endif
{
_IO_pos_t retval;
Index: strops.c
===================================================================
RCS file: /cvs/libstdc++/libstdc++/libio/strops.c,v
retrieving revision 1.1
diff -u -r1.1 strops.c
--- strops.c 1999/01/22 17:14:17 1.1
+++ strops.c 1999/04/15 07:16:05
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1997, 1998, 1999 Free Software Foundation, Inc.
This file is part of the GNU IO Library.
This library is free software; you can redistribute it and/or
@@ -205,12 +205,21 @@
- fp->_IO_read_base);
}
+#if defined(_G_IO_IO_FILE_VERSION) && _G_IO_IO_FILE_VERSION == 0x20001
+_IO_fpos64_t
+_IO_str_seekoff (fp, offset, dir, mode)
+ _IO_FILE *fp;
+ _IO_off64_t offset;
+ int dir;
+ int mode;
+#else
_IO_pos_t
_IO_str_seekoff (fp, offset, dir, mode)
_IO_FILE *fp;
_IO_off_t offset;
int dir;
int mode;
+#endif
{
_IO_ssize_t cur_size = _IO_str_count (fp);
_IO_pos_t new_pos = EOF;