[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: Fwd: Re: 64 bit file support
From:       Alex Zepeda <jazepeda () pacbell ! net>
Date:       2001-08-12 5:08:56
[Download RAW message or body]

On Fri, Aug 10, 2001 at 04:26:29PM -0700, Waldo Bastian wrote:

> The problem is that we can't include config.h in our API header files.
> Maybe we can work around that by installing a different header file depending 
> on some configure test and map KIO::filesize_t to a 64 bit integer if we can 
> find one (either long or long long) and to a 32 bit integer (long) if we 
> can't.

So within kdelibs/configure we:

* check for off64_t, if present write out kio/types.h to contain:

#include <sys/types.h> (or whatever)

namespace KIO
{
	typedef off64_t off_t;
};

* check for loff_t (Linux?) and do something similar

<insert checks for any other non off_t ways of specifying 64 bit offsets>

<insert check for Linux if sizeof(off_t) != 16 && LF support is present>

Default to off_t (which is 64bits over here).

With such an autogenerated header no dependencies on config.h or a mess of
preprocessor directives is created.

Basically AC_SUBST(KIO_LARGE_FILE_TYPEDEF, '
namespace KIO
{
        typedef off64_t off_t;
};
') (or whatever, my m4 is rusty).

And kio/types.h.in would be:

#ifndef KIO_TYPES_H
#define KIO_TYPES_H

@KIO_LARGE_FILE_TYPEDEF@

#endif

- alex

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic