1 ?RCS: $Id: ssizetype.U,v 3.0.1.3 1997/02/28 16:24:21 ram Exp $
3 ?RCS: Copyright (c) 1991-1993, Raphael Manfredi
5 ?RCS: You may redistribute only under the terms of the Artistic Licence,
6 ?RCS: as specified in the README file that comes with the distribution.
7 ?RCS: You may reuse parts of this distribution only within the terms of
8 ?RCS: that same Artistic Licence; a copy of which may be found at the root
9 ?RCS: of the source tree for dist 3.0.
11 ?RCS: Original Author: Andy Dougherty <doughera@lafcol.lafayette.edu>
13 ?RCS: $Log: ssizetype.U,v $
14 ?RCS: Revision 3.0.1.3 1997/02/28 16:24:21 ram
15 ?RCS: patch61: integrated perl5 concerns for mis-configured sfio
17 ?RCS: Revision 3.0.1.2 1994/10/29 16:30:28 ram
18 ?RCS: patch36: added ?F: line for metalint file checking
19 ?RCS: patch36: added 'ldflags' to the test compile line (ADO)
21 ?RCS: Revision 3.0.1.1 1994/08/29 16:33:06 ram
22 ?RCS: patch32: created by ADO
24 ?MAKE:ssizetype: Myread Typedef sizetype cat rm Compile
25 ?MAKE: -pick add $@ %<
27 ?S: This variable defines ssizetype to be something like ssize_t,
28 ?S: long or int. It is used by functions that return a count
29 ?S: of bytes or an error condition. It must be a signed type.
30 ?S: We will pick a type such that sizeof(SSize_t) == sizeof(Size_t).
33 ?C: This symbol holds the type used by functions that return
34 ?C: a count of bytes or an error condition. It must be a signed type.
35 ?C: It is usually ssize_t, but may be long or int, etc.
36 ?C: It may be necessary to include <sys/types.h> or <unistd.h>
37 ?C: to get any typedef'ed information.
38 ?C: We will pick a type such that sizeof(SSize_t) == sizeof(Size_t).
40 ?H:#define SSize_t $ssizetype /* signed count of bytes */
43 : see what type is used for signed size_t
44 set ssize_t ssizetype int stdio.h sys/types.h
47 ?X: Now check out whether sizeof(SSize_t) == sizeof(Size_t)
50 #include <sys/types.h>
51 #define Size_t $sizetype
55 if (sizeof(Size_t) == sizeof(SSize_t))
57 else if (sizeof(Size_t) == sizeof(int))
66 if eval $compile_ok && ./ssize > /dev/null; then
68 echo "I'll be using $ssizetype for functions returning a byte count." >&4
71 Help! I can't compile and run the ssize_t test program: please enlighten me!
72 (This is probably a misconfiguration in your system or libraries, and
73 you really ought to fix it. Still, I'll try anyway.)
75 I need a type that is the same size as $sizetype, but is guaranteed to
76 be signed. Common values are ssize_t, int and long.
79 rp="What signed type is the same size as $sizetype?"