This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Backport of bd2aeadfa5cb8ea8dbfc9c3060728594d8452bc6
[metaconfig.git] / U / perl / d_socklen_t.U
CommitLineData
9544e06a
JH
1?RCS: $Id$
2?RCS:
3?RCS: Copyright (c) 2000, Jarkko Hietaniemi
4?RCS:
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.
10?RCS:
2cb64bf6 11?MAKE:d_socklen_t: Inhdr cat rm_try Setvar Compile d_socket sizetype
9544e06a
JH
12?MAKE: -pick add $@ %<
13?S:d_socklen_t:
14?S: This symbol will be defined if the C compiler supports socklen_t.
15?S:.
16?C:HAS_SOCKLEN_T:
17?C: This symbol will defined if the C compiler supports socklen_t.
18?C: Usually the <sys/socket.h> needs to be included.
19?C:.
20?H:#$d_socklen_t HAS_SOCKLEN_T /**/
21?H:.
22?LINT:set d_socklen_t
23: check for socklen_t
24echo " "
840deeaa 25echo "Checking to see if you have socklen_t..." >&4
9544e06a
JH
26$cat >try.c <<EOCP
27#include <sys/types.h>
28#$d_socket HAS_SOCKET
29#ifdef HAS_SOCKET
30#include <sys/socket.h>
31#endif
32int main() { socklen_t x = 16; }
33EOCP
34set try
35if eval $compile; then
36 val="$define"
1da6d93e 37 echo "You have socklen_t."
9544e06a
JH
38else
39 val="$undef"
1da6d93e 40 echo "You do not have socklen_t."
840deeaa 41 case "$sizetype" in
5351ca5b 42 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
840deeaa 43 esac
9544e06a 44fi
2cb64bf6 45$rm_try
9544e06a
JH
46set d_socklen_t
47eval $setvar
48