chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] long pointer equivalent


From: felix
Subject: Re: [Chicken-users] long pointer equivalent
Date: Tue, 27 Aug 2002 09:07:30 +0200

> Aside from the floating point issue which Perry brought up, I'm still
> leery of defining things like this because the point of the off_t(and
> other posix *_t) types is so that these function calls are portable
> across unicies.
>
> How I'd do it:
>
> ;; should be supplied by chicken and it is determined during build time of
> ;; chicken itself
> (define-foreign-type off_t unsigned-long)
>
> ;; this is closer to how I think it should be done.
> (define lseek
> (foreign-lambda off_t "lseek" int off_t int) )
>
> See, the trouble is with a specific 64 bit type is how do you deal with
> machines that happen to define that library call where an off_t is a
> 32-bit type? long on an ia64 is 8 bytes, but on an ia386 is 4 bytes,
> therefore you may not use an unsigned-int64 as the interface call to
> lseek because it isn't right all of the time.

Right. This should be handled transparently. So should be supply
an `off_t' type (perhaps better named)? Is there a generic term for
these platform-specific, large integer types?


cheers,
felix






reply via email to

[Prev in Thread] Current Thread [Next in Thread]