summaryrefslogtreecommitdiffstats
path: root/Objects/fileobject.c
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2003-11-19 22:52:23 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>2003-11-19 22:52:23 (GMT)
commit4bae2d5e46b5135dba523616fd0960fc915eb120 (patch)
tree730899029b05968513eadb26fe1e3c4ac22653d1 /Objects/fileobject.c
parentbc2fbc74edf3f6c451b823329a66413d9fcf1c55 (diff)
downloadcpython-4bae2d5e46b5135dba523616fd0960fc915eb120.zip
cpython-4bae2d5e46b5135dba523616fd0960fc915eb120.tar.gz
cpython-4bae2d5e46b5135dba523616fd0960fc915eb120.tar.bz2
Getting rid of code dependent on GUSI or the MetroWerks compiler.
Diffstat (limited to 'Objects/fileobject.c')
-rw-r--r--Objects/fileobject.c28
1 files changed, 0 insertions, 28 deletions
diff --git a/Objects/fileobject.c b/Objects/fileobject.c
index ff66117..66e5f28 100644
--- a/Objects/fileobject.c
+++ b/Objects/fileobject.c
@@ -21,17 +21,6 @@
#include <windows.h>
#endif /* _MSC_VER */
-#ifdef macintosh
-#ifdef USE_GUSI
-#define HAVE_FTRUNCATE
-#endif
-#endif
-
-#ifdef __MWERKS__
-/* Mwerks fopen() doesn't always set errno */
-#define NO_FOPEN_ERRNO
-#endif
-
#if defined(PYOS_OS2) && defined(PYCC_GCC)
#include <io.h>
#endif
@@ -209,18 +198,6 @@ open_the_file(PyFileObject *f, char *name, char *mode)
}
}
if (f->f_fp == NULL) {
-#ifdef NO_FOPEN_ERRNO
- /* Metroworks only, wich does not always sets errno */
- if (errno == 0) {
- PyObject *v;
- v = Py_BuildValue("(is)", 0, "Cannot open file");
- if (v != NULL) {
- PyErr_SetObject(PyExc_IOError, v);
- Py_DECREF(v);
- }
- return NULL;
- }
-#endif
#ifdef _MSC_VER
/* MSVC 6 (Microsoft) leaves errno at 0 for bad mode strings,
* across all Windows flavors. When it sets EINVAL varies
@@ -739,12 +716,7 @@ new_buffersize(PyFileObject *f, size_t currentsize)
works. We can't use the lseek() value either, because we
need to take the amount of buffered data into account.
(Yet another reason why stdio stinks. :-) */
-#ifdef USE_GUSI2
- pos = lseek(fileno(f->f_fp), 1L, SEEK_CUR);
- pos = lseek(fileno(f->f_fp), -1L, SEEK_CUR);
-#else
pos = lseek(fileno(f->f_fp), 0L, SEEK_CUR);
-#endif
if (pos >= 0) {
pos = ftell(f->f_fp);
}