[Python-checkins] python/dist/src/Objects fileobject.c,2.185,2.186

jackjansen at users.sourceforge.net jackjansen at users.sourceforge.net
Wed Nov 19 17:52:25 EST 2003


Update of /cvsroot/python/python/dist/src/Objects
In directory sc8-pr-cvs1:/tmp/cvs-serv4143/Objects

Modified Files:
	fileobject.c 
Log Message:
Getting rid of code dependent on GUSI or the MetroWerks compiler.


Index: fileobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/fileobject.c,v
retrieving revision 2.185
retrieving revision 2.186
diff -C2 -d -r2.185 -r2.186
*** fileobject.c	18 Oct 2003 09:38:01 -0000	2.185
--- fileobject.c	19 Nov 2003 22:52:23 -0000	2.186
***************
*** 22,36 ****
  #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>
--- 22,25 ----
***************
*** 210,225 ****
  	}
  	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,
--- 199,202 ----
***************
*** 740,749 ****
  		   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);
--- 717,721 ----





More information about the Python-checkins mailing list