Changeset 4041 for zzuf/trunk/src
- Timestamp:
- Nov 26, 2009, 2:13:58 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
zzuf/trunk/src/lib-stream.c
r4032 r4041 29 29 #elif defined HAVE___FILBUF || defined HAVE___SRGET || defined HAVE___UFLOW 30 30 # define HAVE_BSD_STDIO 31 #endif 32 33 /* Define the best ftell() clone */ 34 #if defined HAVE_FTELLO64 35 # define MYFTELL ftello64 36 #elif defined HAVE___FTELLO64 37 # define MYFTELL __ftello64 38 #elif defined HAVE_FTELLO 39 # define MYFTELL ftello 40 #else 41 # define MYFTELL ftell 31 42 #endif 32 43 … … 296 307 297 308 #if defined HAVE_DARWIN_STDIO /* Don't fuzz or seek if we have __srefill() */ 298 # define FSEEK_FUZZ( myftell)299 #else 300 # define FSEEK_FUZZ( myftell) \309 # define FSEEK_FUZZ() 310 #else 311 # define FSEEK_FUZZ() \ 301 312 if(ret == 0) \ 302 313 { \ … … 305 316 { \ 306 317 case SEEK_END: \ 307 offset = myftell(stream); \318 offset = MYFTELL(stream); \ 308 319 /* fall through */ \ 309 320 case SEEK_SET: \ … … 317 328 #endif 318 329 319 #define FSEEK(myfseek , myftell) \330 #define FSEEK(myfseek) \ 320 331 do \ 321 332 { \ … … 331 342 debug("%s([%i], %lli, %i) = %i", __func__, \ 332 343 fd, (long long int)offset, whence, ret); \ 333 FSEEK_FUZZ( myftell) \344 FSEEK_FUZZ() \ 334 345 DEBUG_STREAM("new", stream); \ 335 346 } while(0) … … 337 348 int NEW(fseek)(FILE *stream, long offset, int whence) 338 349 { 339 int ret; FSEEK(fseek , ftell); return ret;350 int ret; FSEEK(fseek); return ret; 340 351 } 341 352 … … 343 354 int NEW(fseeko)(FILE *stream, off_t offset, int whence) 344 355 { 345 int ret; FSEEK(fseeko , ftello); return ret;356 int ret; FSEEK(fseeko); return ret; 346 357 } 347 358 #endif … … 350 361 int NEW(fseeko64)(FILE *stream, off64_t offset, int whence) 351 362 { 352 int ret; FSEEK(fseeko64 , ftello64); return ret;363 int ret; FSEEK(fseeko64); return ret; 353 364 } 354 365 #endif … … 357 368 int NEW(__fseeko64)(FILE *stream, off64_t offset, int whence) 358 369 { 359 int ret; FSEEK(__fseeko64 , ftello); return ret;370 int ret; FSEEK(__fseeko64); return ret; 360 371 } 361 372 #endif … … 462 473 do \ 463 474 { \ 464 int64_t newpos = ftell(stream); \475 int64_t newpos = MYFTELL(stream); \ 465 476 /* XXX: the number of bytes read is not ret * size, because \ 466 477 * a partial read may have advanced the stream pointer. However, \ … … 515 526 return ORIG(myfread)(ptr, size, nmemb, stream); \ 516 527 DEBUG_STREAM("old", stream); \ 517 oldpos = ftell(stream); \528 oldpos = MYFTELL(stream); \ 518 529 _zz_lock(fd); \ 519 530 ret = ORIG(myfread)(ptr, size, nmemb, stream); \
Note: See TracChangeset
for help on using the changeset viewer.