Opened 16 years ago

Last modified 15 years ago

#824 closed Bugs (fixed)

BOOST_IOSTREAMS_HAS_LSEEK64 on Mac OS X — at Initial Version

Reported by: gmsb Owned by: beman_dawes
Milestone: Component: iostreams
Version: None Severity: Showstopper
Keywords: Cc:

Description

Mac OS X has 64-bit file offsets but uses the standard lseek call rather than lseek64.

The following is one fix for file_descriptor::seek() but there's no doubt a better way...

Change lines 203 and 218 from:

  203 #ifndef BOOST_IOSTREAMS_HAS_LSEEK64
  204     if ( off > integer_traits<long>::const_max ||
  205          off < integer_traits<long>::const_min )
  206     {
  207         throw BOOST_IOSTREAMS_FAILURE("bad offset");
  208     }
  209 #endif
  210 
  211     stream_offset result =
  212         #ifdef BOOST_IOSTREAMS_HAS_LSEEK64
  213             lseek64
  214         #else
  215             lseek
  216         #endif
  217             ( pimpl_->fd_,
  218               #ifdef BOOST_IOSTREAMS_HAS_LSEEK64
  219                   off,
  220               #else
  221                   static_cast<long>(off),
  222               #endif
  223               way == BOOST_IOS::beg ?
  224                   SEEK_SET :
  225                       way == BOOST_IOS::cur ?
  226                           SEEK_CUR :
  227                           SEEK_END );

To:

  203 #if !defined(BOOST_IOSTREAMS_HAS_LSEEK64) && !defined(__MACH__)
  ...
  218               #if defined(BOOST_IOSTREAMS_HAS_LSEEK64) || defined(__MACH__)
  ...


Change History (0)

Note: See TracTickets for help on using tickets.