1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
9 * Header file used to find the system header files for socket support[1].
10 * This file serves the following purposes:
11 * - A cross-platform, "get-everything" socket header file. On
12 * Unix, socket support is scattered in several header files,
13 * while Windows has a "get-everything" socket header file[2].
14 * - NSPR needs the following macro definitions and function
15 * prototype declarations from these header files:
17 * INADDR_ANY, INADDR_LOOPBACK, INADDR_BROADCAST
18 * ntohl(), ntohs(), htonl(), ntons().
19 * NSPR does not define its own versions of these macros and
20 * functions. It simply uses the native versions, which have
21 * the same names on all supported platforms.
22 * This file is intended to be included by NSPR public header
23 * files, such as prio.h. One should not include this file directly.
26 * 1. This file should have been an internal header. Please do not
27 * depend on it to pull in the system header files you need.
28 * 2. WARNING: This file is no longer cross-platform as it is a no-op
29 * for WIN32! See the comment in the WIN32 section for details.
36 #include <sys/types.h>
37 #include <sys/socket.h> /* AF_INET */
38 #include <netinet/in.h> /* INADDR_ANY, ..., ntohl(), ... */
42 * On AIX 4.3, the header <arpa/inet.h> refers to struct
43 * ether_addr and struct sockaddr_dl that are not declared.
44 * The following struct declarations eliminate the compiler
50 #include <arpa/inet.h>
55 #include <rpc/types.h> /* the only place that defines INADDR_LOOPBACK */
59 * OS/2 hack. For some reason INADDR_LOOPBACK is not defined in the
62 #if !defined(INADDR_LOOPBACK)
63 #define INADDR_LOOPBACK 0x7f000001
66 /* On Android, ntohl() etc. are declared in <sys/endian.h>. */
68 #include <sys/endian.h>
74 * Do not include any system header files.
76 * Originally we were including <windows.h>. It slowed down the
77 * compilation of files that included NSPR headers, so we removed
78 * the <windows.h> inclusion at customer's request, which created
79 * an unfortunate inconsistency with other platforms.
84 #error Unknown platform
88 #endif /* prinet_h__ */