On Thu, 19 Jan 2006, R. Bernstein wrote:

> I'd like to solicit comments on how to make sure off_t is defined in 
> cdio/read.h.
> 
> First, note that off_t comes from <sys/types> (not <unistd.h> per se).

        Hmmm, it seems that unistd.h also includes <sys/types.h>  .  If that

        But lseek() is in <unistd.h> so it's probably a good idea to include
        both <sys/types.h> and <unistd.h>.

> Approach 1 (Compression library): 
>   zlib.h uses z_offset_t and has which is defined in zconf.h as:
> 
> #  include <sys/types.h> /* for off_t */
> #  include <unistd.h>    /* for SEEK_* and off_t */

        Includes both of them - might be redundant but it's safe to do.

> Approach 2 (Samba client):
>   libsmbclient.h just has: 
>   #include <sys/types.h>

        That might be because modules in Samba that do seeking include
        unistd.h as required.

> Comments on which to use and/or why one or the other might be
> preferred? Or any other better approaches? 

        I think approach 1 might be better.  Modules which use off_t are
        likely to be calling lseek() and thus will need <unistd.h> for
        the lseek() prototype.

        Cheers,
        Steven Schultz



_______________________________________________
Libcdio-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/libcdio-devel

Reply via email to