Re: [Exim] Using int vs. size_t in Exim

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Exim Users Mailing List
Date:  
À: Exim Users Mailing List
Sujet: Re: [Exim] Using int vs. size_t in Exim
[ On Wednesday, April 9, 2003 at 17:48:19 (+0200), Oliver Eikemeier wrote: ]
> Subject: Re: [Exim] Using int vs. size_t in Exim
>
> ssize_t (#include <sys/types.h> on FreeBSD) should be fairly portable by
> now. Try 'man 5 types' on your favourite machine ('man 2 read' or 'mac 2
> recv' if that fails).


That would be very nice but, no, it's not really true yet -- it's only a
couple of years since "ssize_t" was was included in any widely accepted
standard (POSIX 1003.1-2001 was first, IIRC) and there are still lots
and lots of production systems out there without it in their header files.

Unfortunately since it's often just a typedef without any companion
#define so it's impossible to reliably detect when it's available and
when it isn't (i.e. with just pre-processor #if expressions, though of
course it can be done by using active checks such as in GNU Autoconf
that then create private #defines). This means that if you don't use
active checks to configure the compilation environment then you're stuck
with learning about this on a one-off basis and inventing a hopefully
unique identifier for each platform variant.

--
                                Greg A. Woods


+1 416 218-0098;            <g.a.woods@???>;           <woods@???>
Planix, Inc. <woods@???>; VE3TCP; Secrets of the Weird <woods@???>