#124 Reliable streamoff definition on Unix

open-invalid
5
2010-04-29
2010-04-27
No

The definition of streamoff depends on whether _LARGEFILE_SOURCE or _LARGEFILE64_SOURCE is defined. I think it is simpler and safer if STLport uses off64_t by default and doesn't make its interface dependent on feature test macros. See also the comment in the patch.

I don't consider such a change appropriate for the STLport 5.2 branch, but I would like to see it in later STLport releases.

An alternative - or rather, an addition - to consider is to "guess" the type of off64_t (long or long long), define streamoff as that type and assert in a source file that streamoff and off64_t are identical. This could keep off64_t out of all header files, thus removing the need to define the right feature test macros when using STLport.

Discussion

  • Petr Ovtchenkov

    Petr Ovtchenkov - 2010-04-29

    System/program may support 'large files', but may not support.

     
  • Petr Ovtchenkov

    Petr Ovtchenkov - 2010-04-29
    • assigned_to: nobody --> complement
    • status: open --> open-invalid
     
  • Jan Echternach

    Jan Echternach - 2010-05-12

    The updated patch does exactly the same thing as the first patch I've attached here, and that one was already rejected, so this one should also be rejected for the same reason (and this artifact closed).

    Nevertheless I've uploaded it here because I had to update it anyway for my own purposes, and I can just as well share it in case someone else likes to use it.

     
  • Petr Ovtchenkov

    Petr Ovtchenkov - 2010-05-17

    > Nevertheless I've uploaded it here because I had to update it anyway for
    > my own purposes, and I can just as well share it in case someone else likes
    > to use it.

    Not a problem.

    BTW, you words "All I care is that the implementation of inline functions doesn't change when different feature test macros are set" make sense and for this issue too. I will consider changes in 'master' branch.

     

Log in to post a comment.