michael@0: /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: /* michael@0: * File: prinet.h michael@0: * Description: michael@0: * Header file used to find the system header files for socket support[1]. michael@0: * This file serves the following purposes: michael@0: * - A cross-platform, "get-everything" socket header file. On michael@0: * Unix, socket support is scattered in several header files, michael@0: * while Windows has a "get-everything" socket header file[2]. michael@0: * - NSPR needs the following macro definitions and function michael@0: * prototype declarations from these header files: michael@0: * AF_INET michael@0: * INADDR_ANY, INADDR_LOOPBACK, INADDR_BROADCAST michael@0: * ntohl(), ntohs(), htonl(), ntons(). michael@0: * NSPR does not define its own versions of these macros and michael@0: * functions. It simply uses the native versions, which have michael@0: * the same names on all supported platforms. michael@0: * This file is intended to be included by NSPR public header michael@0: * files, such as prio.h. One should not include this file directly. michael@0: * michael@0: * Notes: michael@0: * 1. This file should have been an internal header. Please do not michael@0: * depend on it to pull in the system header files you need. michael@0: * 2. WARNING: This file is no longer cross-platform as it is a no-op michael@0: * for WIN32! See the comment in the WIN32 section for details. michael@0: */ michael@0: michael@0: #ifndef prinet_h__ michael@0: #define prinet_h__ michael@0: michael@0: #if defined(XP_UNIX) || defined(XP_OS2) || defined(XP_BEOS) michael@0: #include michael@0: #include /* AF_INET */ michael@0: #include /* INADDR_ANY, ..., ntohl(), ... */ michael@0: #ifdef XP_OS2 michael@0: #include michael@0: #endif michael@0: #ifdef XP_UNIX michael@0: #ifdef AIX michael@0: /* michael@0: * On AIX 4.3, the header refers to struct michael@0: * ether_addr and struct sockaddr_dl that are not declared. michael@0: * The following struct declarations eliminate the compiler michael@0: * warnings. michael@0: */ michael@0: struct ether_addr; michael@0: struct sockaddr_dl; michael@0: #endif /* AIX */ michael@0: #include michael@0: #endif /* XP_UNIX */ michael@0: #include michael@0: michael@0: #if defined(FREEBSD) || defined(BSDI) || defined(QNX) michael@0: #include /* the only place that defines INADDR_LOOPBACK */ michael@0: #endif michael@0: michael@0: /* michael@0: * OS/2 hack. For some reason INADDR_LOOPBACK is not defined in the michael@0: * socket headers. michael@0: */ michael@0: #if defined(OS2) && !defined(INADDR_LOOPBACK) michael@0: #define INADDR_LOOPBACK 0x7f000001 michael@0: #endif michael@0: michael@0: /* michael@0: * Prototypes of ntohl() etc. are declared in michael@0: * on these platforms. michael@0: */ michael@0: #if defined(BSDI) || defined(OSF1) michael@0: #include michael@0: #endif michael@0: michael@0: /* On Android, ntohl() etc. are declared in . */ michael@0: #ifdef __ANDROID__ michael@0: #include michael@0: #endif michael@0: michael@0: #elif defined(WIN32) michael@0: michael@0: /* michael@0: * Do not include any system header files. michael@0: * michael@0: * Originally we were including . It slowed down the michael@0: * compilation of files that included NSPR headers, so we removed michael@0: * the inclusion at customer's request, which created michael@0: * an unfortunate inconsistency with other platforms. michael@0: */ michael@0: michael@0: #else michael@0: michael@0: #error Unknown platform michael@0: michael@0: #endif michael@0: michael@0: #endif /* prinet_h__ */