#ifdef WIN32
#include <limits.h>
#else
#include <values.h>
#endif
#include <assert.h>
switch(whence) {
case SEEK_SET: lim = offset; break;
case SEEK_CUR: lim = tell() + offset; break;
case SEEK_END: lim = MAXLONG; break; // XXX: MAXINT may not be max(off_t)
case SEEK_END: lim = LONG_MAX; break; // XXX: MAXINT may not be max(off_t)
}
insure_backing(lim);
if (0 == fseek(back_, offset, whence))