OLD | NEW |
(Empty) | |
| 1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
| 2 /* ***** BEGIN LICENSE BLOCK ***** |
| 3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
| 4 * |
| 5 * The contents of this file are subject to the Mozilla Public License Version |
| 6 * 1.1 (the "License"); you may not use this file except in compliance with |
| 7 * the License. You may obtain a copy of the License at |
| 8 * http://www.mozilla.org/MPL/ |
| 9 * |
| 10 * Software distributed under the License is distributed on an "AS IS" basis, |
| 11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License |
| 12 * for the specific language governing rights and limitations under the |
| 13 * License. |
| 14 * |
| 15 * The Original Code is the Netscape Portable Runtime (NSPR). |
| 16 * |
| 17 * The Initial Developer of the Original Code is |
| 18 * Netscape Communications Corporation. |
| 19 * Portions created by the Initial Developer are Copyright (C) 1998-2000 |
| 20 * the Initial Developer. All Rights Reserved. |
| 21 * |
| 22 * Contributor(s): |
| 23 * |
| 24 * Alternatively, the contents of this file may be used under the terms of |
| 25 * either the GNU General Public License Version 2 or later (the "GPL"), or |
| 26 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), |
| 27 * in which case the provisions of the GPL or the LGPL are applicable instead |
| 28 * of those above. If you wish to allow use of your version of this file only |
| 29 * under the terms of either the GPL or the LGPL, and not to allow others to |
| 30 * use your version of this file under the terms of the MPL, indicate your |
| 31 * decision by deleting the provisions above and replace them with the notice |
| 32 * and other provisions required by the GPL or the LGPL. If you do not delete |
| 33 * the provisions above, a recipient may use your version of this file under |
| 34 * the terms of any one of the MPL, the GPL or the LGPL. |
| 35 * |
| 36 * ***** END LICENSE BLOCK ***** */ |
| 37 |
| 38 /* |
| 39 * File: prinet.h |
| 40 * Description: |
| 41 * Header file used to find the system header files for socket support. |
| 42 * This file serves the following purposes: |
| 43 * - A cross-platform, "get-everything" socket header file. On |
| 44 * Unix, socket support is scattered in several header files, |
| 45 * while Windows and Mac have a "get-everything" socket header |
| 46 * file. |
| 47 * - NSPR needs the following macro definitions and function |
| 48 * prototype declarations from these header files: |
| 49 * AF_INET |
| 50 * INADDR_ANY, INADDR_LOOPBACK, INADDR_BROADCAST |
| 51 * ntohl(), ntohs(), htonl(), ntons(). |
| 52 * NSPR does not define its own versions of these macros and |
| 53 * functions. It simply uses the native versions, which have |
| 54 * the same names on all supported platforms. |
| 55 * This file is intended to be included by nspr20 public header |
| 56 * files, such as prio.h. One should not include this file directly. |
| 57 */ |
| 58 |
| 59 #ifndef prinet_h__ |
| 60 #define prinet_h__ |
| 61 |
| 62 #if defined(XP_UNIX) || defined(XP_OS2) || defined(XP_BEOS) |
| 63 #ifdef LINUX |
| 64 #undef __STRICT_ANSI__ |
| 65 #define __STRICT_ANSI__ |
| 66 #endif |
| 67 #include <sys/types.h> |
| 68 #include <sys/socket.h> /* AF_INET */ |
| 69 #include <netinet/in.h> /* INADDR_ANY, ..., ntohl(), ... */ |
| 70 #ifdef XP_OS2 |
| 71 #include <sys/ioctl.h> |
| 72 #endif |
| 73 #ifdef XP_UNIX |
| 74 #ifdef AIX |
| 75 /* |
| 76 * On AIX 4.3, the header <arpa/inet.h> refers to struct |
| 77 * ether_addr and struct sockaddr_dl that are not declared. |
| 78 * The following struct declarations eliminate the compiler |
| 79 * warnings. |
| 80 */ |
| 81 struct ether_addr; |
| 82 struct sockaddr_dl; |
| 83 #endif /* AIX */ |
| 84 #include <arpa/inet.h> |
| 85 #endif /* XP_UNIX */ |
| 86 #include <netdb.h> |
| 87 |
| 88 #if defined(FREEBSD) || defined(BSDI) || defined(QNX) |
| 89 #include <rpc/types.h> /* the only place that defines INADDR_LOOPBACK */ |
| 90 #endif |
| 91 |
| 92 /* |
| 93 * OS/2 hack. For some reason INADDR_LOOPBACK is not defined in the |
| 94 * socket headers. |
| 95 */ |
| 96 #if defined(OS2) && !defined(INADDR_LOOPBACK) |
| 97 #define INADDR_LOOPBACK 0x7f000001 |
| 98 #endif |
| 99 |
| 100 /* |
| 101 * Prototypes of ntohl() etc. are declared in <machine/endian.h> |
| 102 * on these platforms. |
| 103 */ |
| 104 #if defined(BSDI) || defined(OSF1) |
| 105 #include <machine/endian.h> |
| 106 #endif |
| 107 |
| 108 #elif defined(WIN32) |
| 109 |
| 110 /* Do not include any system header files. */ |
| 111 |
| 112 #elif defined(WIN16) |
| 113 |
| 114 #include <winsock.h> |
| 115 |
| 116 #elif defined(XP_MAC) |
| 117 |
| 118 #include "macsocket.h" |
| 119 |
| 120 #else |
| 121 |
| 122 #error Unknown platform |
| 123 |
| 124 #endif |
| 125 |
| 126 #endif /* prinet_h__ */ |
OLD | NEW |