[Compiler-sig] Compiler Error Under BSDI 4.1
PEG Manager
pegmgr@emily.peg.com
Mon, 30 Oct 2000 12:57:53 -0600
Does anyone have a quick and dirty fix to let me get 2.0 compiled.
My c skills are way too rusty to attack this in the limited time I
have available.
From Objects/fileobject.c
...
/* define the appropriate 64-bit capable tell() function */
#if defined(MS_WIN64)
#define TELL64 _telli64
#elif defined(__NetBSD__) || defined(__OpenBSD__)
/* NOTE: this is only used on older
NetBSD prior to f*o() funcions */
#define TELL64(fd) lseek((fd),0,SEEK_CUR)
#endif
...
/* a portable fseek() function
return 0 on success, non-zero on failure (with errno set) */
int
#if defined(HAVE_LARGEFILE_SUPPORT) && SIZEOF_OFF_T < 8 && SIZEOF_FPOS_T >= 8
_portable_fseek(FILE *fp, fpos_t offset, int whence)
#else
_portable_fseek(FILE *fp, off_t offset, int whence)
#endif
{
#if defined(HAVE_FSEEKO)
return fseeko(fp, offset, whence);
#elif defined(HAVE_FSEEK64)
return fseek64(fp, offset, whence);
#elif defined(__BEOS__)
return _fseek(fp, offset, whence);
#elif defined(HAVE_LARGEFILE_SUPPORT) && SIZEOF_FPOS_T >= 8
/* lacking a 64-bit capable fseek() (as Win64 does) use a 64-bit capable
fsetpos() and tell() to implement fseek()*/
fpos_t pos;
switch (whence) {
case SEEK_CUR:
if (fgetpos(fp, &pos) != 0)
return -1;
offset += pos;
break;
case SEEK_END:
/* do a "no-op" seek first to sync the buffering so that
the low-level tell() can be used correctly */
if (fseek(fp, 0, SEEK_END) != 0)
return -1;
if ((pos = TELL64(fileno(fp))) == -1L)
return -1;
offset += pos;
break;
/* case SEEK_SET: break; */
}
return fsetpos(fp, &offset);
#else
return fseek(fp, offset, whence);
#endif
}
....
During the make:
ranlib libpython2.0.a
true
cd Modules; make OPT="-g -O2 -Wall -Wstrict-prototypes" VERSION="2.0" prefix="
/usr/local" exec_prefix="/usr/local" LIBRARY=../libpython2.0.a link
gcc -D_HAVE_BSDI -Xlinker -export-dynamic python.o ../libpython2.0.a -ldl -
lutil -lm -o python
../libpython2.0.a(fileobject.o): In function `_portable_fseek':
/home/pegmgr/software/Python-2.0/Objects/fileobject.c:274: undefined reference t
o `TELL64'
*** Error code 1
Stop.
*** Error code 1
Stop.
--
PEG Manager
pegmgr@peg.com