This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
RE: [perl #26136] localtime(3) calls tzset(3), but localtime_r(3) may not.
[metaconfig.git] / U / modified / d_htonl.U
1 ?RCS: $Id: d_htonl.U,v 3.0.1.2 1994/08/29 16:09:25 ram Exp $
2 ?RCS:
3 ?RCS: Copyright (c) 1991-1993, Raphael Manfredi
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:
11 ?RCS: $Log: d_htonl.U,v $
12 ?RCS: Revision 3.0.1.2  1994/08/29  16:09:25  ram
13 ?RCS: patch32: now properly handles htonl() and friends when macros (ADO)
14 ?RCS:
15 ?RCS: Revision 3.0.1.1  1994/05/06  14:45:00  ram
16 ?RCS: patch23: now also check for htonl() macro (ADO)
17 ?RCS:
18 ?RCS: Revision 3.0  1993/08/18  12:06:22  ram
19 ?RCS: Baseline for dist 3.0 netwide release.
20 ?RCS:
21 ?MAKE:d_htonl: Inlibc Setvar i_niin i_sysin i_arpainet cat rm contains \
22         cppstdin cppflags cppminus
23 ?MAKE:  -pick add $@ %<
24 ?S:d_htonl:
25 ?S:     This variable conditionally defines HAS_HTONL if htonl() and its
26 ?S:     friends are available to do network order byte swapping.
27 ?S:.
28 ?C:HAS_HTONL (HTONL):
29 ?C:     This symbol, if defined, indicates that the htonl() routine (and
30 ?C:     friends htons() ntohl() ntohs()) are available to do network
31 ?C:     order byte swapping.
32 ?C:.
33 ?C:HAS_HTONS (HTONS):
34 ?C:     This symbol, if defined, indicates that the htons() routine (and
35 ?C:     friends htonl() ntohl() ntohs()) are available to do network
36 ?C:     order byte swapping.
37 ?C:.
38 ?C:HAS_NTOHL (NTOHL):
39 ?C:     This symbol, if defined, indicates that the ntohl() routine (and
40 ?C:     friends htonl() htons() ntohs()) are available to do network
41 ?C:     order byte swapping.
42 ?C:.
43 ?C:HAS_NTOHS (NTOHS):
44 ?C:     This symbol, if defined, indicates that the ntohs() routine (and
45 ?C:     friends htonl() htons() ntohl()) are available to do network
46 ?C:     order byte swapping.
47 ?C:.
48 ?H:#$d_htonl HAS_HTONL          /**/
49 ?H:#$d_htonl HAS_HTONS          /**/
50 ?H:#$d_htonl HAS_NTOHL          /**/
51 ?H:#$d_htonl HAS_NTOHS          /**/
52 ?H:.
53 ?LINT:set d_htonl
54 : see if htonl --and friends-- exists
55 val=''
56 set htonl val
57 eval $inlibc
58
59 : Maybe they are macros.
60 case "$val" in
61 $undef)
62         $cat >htonl.c <<EOM
63 #include <stdio.h>
64 #include <sys/types.h>
65 #$i_niin I_NETINET_IN
66 #$i_sysin I_SYS_IN
67 #$i_arpainet I_ARPA_INET
68 #ifdef I_NETINET_IN
69 #include <netinet/in.h>
70 #endif
71 #ifdef I_SYS_IN
72 #include <sys/in.h>
73 #endif
74 #ifdef I_ARPA_INET
75 #include <arpa/inet.h>
76 #endif
77 #ifdef htonl
78 printf("Defined as a macro.");
79 #endif
80 EOM
81         $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
82         if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
83                 val="$define"
84                 echo "But it seems to be defined as a macro." >&4
85         fi
86         $rm -f htonl.?
87         ;;
88 esac
89 set d_htonl
90 eval $setvar
91