OLD | NEW |
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | 1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
2 /* ***** BEGIN LICENSE BLOCK ***** | 2 /* ***** BEGIN LICENSE BLOCK ***** |
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 | 3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
4 * | 4 * |
5 * The contents of this file are subject to the Mozilla Public License Version | 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 | 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 | 7 * the License. You may obtain a copy of the License at |
8 * http://www.mozilla.org/MPL/ | 8 * http://www.mozilla.org/MPL/ |
9 * | 9 * |
10 * Software distributed under the License is distributed on an "AS IS" basis, | 10 * Software distributed under the License is distributed on an "AS IS" basis, |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 */ | 88 */ |
89 #if defined(XP_BEOS) && defined(BONE_VERSION) | 89 #if defined(XP_BEOS) && defined(BONE_VERSION) |
90 #include <arpa/inet.h> /* pick up define for inet_addr */ | 90 #include <arpa/inet.h> /* pick up define for inet_addr */ |
91 #include <sys/socket.h> | 91 #include <sys/socket.h> |
92 #define _PR_HAVE_GETPROTO_R | 92 #define _PR_HAVE_GETPROTO_R |
93 #define _PR_HAVE_GETPROTO_R_POINTER | 93 #define _PR_HAVE_GETPROTO_R_POINTER |
94 #endif | 94 #endif |
95 | 95 |
96 #if defined(SOLARIS) || (defined(BSDI) && defined(_REENTRANT)) \ | 96 #if defined(SOLARIS) || (defined(BSDI) && defined(_REENTRANT)) \ |
97 || (defined(LINUX) && defined(_REENTRANT) \ | 97 || (defined(LINUX) && defined(_REENTRANT) \ |
98 && !(defined(__GLIBC__) && __GLIBC__ >= 2)) | 98 && !(defined(__GLIBC__) && __GLIBC__ >= 2)) \ |
| 99 && !defined(ANDROID) |
99 #define _PR_HAVE_GETPROTO_R | 100 #define _PR_HAVE_GETPROTO_R |
100 #define _PR_HAVE_GETPROTO_R_POINTER | 101 #define _PR_HAVE_GETPROTO_R_POINTER |
101 #endif | 102 #endif |
102 | 103 |
103 #if defined(OSF1) \ | 104 #if defined(OSF1) \ |
104 || defined(AIX4_3_PLUS) || (defined(AIX) && defined(_THREAD_SAFE)) \ | 105 || defined(AIX4_3_PLUS) || (defined(AIX) && defined(_THREAD_SAFE)) \ |
105 || (defined(HPUX10_10) && defined(_REENTRANT)) \ | 106 || (defined(HPUX10_10) && defined(_REENTRANT)) \ |
106 || (defined(HPUX10_20) && defined(_REENTRANT)) \ | 107 || (defined(HPUX10_20) && defined(_REENTRANT)) \ |
107 || defined(OPENBSD) | 108 || defined(OPENBSD) |
108 #define _PR_HAVE_GETPROTO_R | 109 #define _PR_HAVE_GETPROTO_R |
(...skipping 1069 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1178 /******************************************************************************/ | 1179 /******************************************************************************/ |
1179 | 1180 |
1180 #if !defined(_PR_HAVE_GETPROTO_R) | 1181 #if !defined(_PR_HAVE_GETPROTO_R) |
1181 /* | 1182 /* |
1182 * This may seem like a silly thing to do, but the compiler SHOULD | 1183 * This may seem like a silly thing to do, but the compiler SHOULD |
1183 * complain if getprotobyname_r() is implemented on some system and | 1184 * complain if getprotobyname_r() is implemented on some system and |
1184 * we're not using it. For sure these signatures are different than | 1185 * we're not using it. For sure these signatures are different than |
1185 * any usable implementation. | 1186 * any usable implementation. |
1186 */ | 1187 */ |
1187 | 1188 |
| 1189 #if defined(ANDROID) |
| 1190 /* Android's Bionic libc system includes prototypes for these in netdb.h, |
| 1191 * but doesn't actually include implementations. It uses the 5-arg form, |
| 1192 * so these functions end up not matching the prototype. So just rename |
| 1193 * them if not found. |
| 1194 */ |
| 1195 #define getprotobyname_r _pr_getprotobyname_r |
| 1196 #define getprotobynumber_r _pr_getprotobynumber_r |
| 1197 #endif |
| 1198 |
1188 static struct protoent *getprotobyname_r(const char* name) | 1199 static struct protoent *getprotobyname_r(const char* name) |
1189 { | 1200 { |
1190 return getprotobyname(name); | 1201 return getprotobyname(name); |
1191 } /* getprotobyname_r */ | 1202 } /* getprotobyname_r */ |
1192 | 1203 |
1193 static struct protoent *getprotobynumber_r(PRInt32 number) | 1204 static struct protoent *getprotobynumber_r(PRInt32 number) |
1194 { | 1205 { |
1195 return getprotobynumber(number); | 1206 return getprotobynumber(number); |
1196 } /* getprotobynumber_r */ | 1207 } /* getprotobynumber_r */ |
1197 | 1208 |
(...skipping 1125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2323 #if !defined(_PR_HAVE_GETADDRINFO) | 2334 #if !defined(_PR_HAVE_GETADDRINFO) |
2324 return pr_NetAddrToStringFB(addr, string, size); | 2335 return pr_NetAddrToStringFB(addr, string, size); |
2325 #else | 2336 #else |
2326 #if defined(_PR_INET6_PROBE) | 2337 #if defined(_PR_INET6_PROBE) |
2327 if (!_pr_ipv6_is_present()) | 2338 if (!_pr_ipv6_is_present()) |
2328 return pr_NetAddrToStringFB(addr, string, size); | 2339 return pr_NetAddrToStringFB(addr, string, size); |
2329 #endif | 2340 #endif |
2330 return pr_NetAddrToStringGNI(addr, string, size); | 2341 return pr_NetAddrToStringGNI(addr, string, size); |
2331 #endif | 2342 #endif |
2332 } /* PR_NetAddrToString */ | 2343 } /* PR_NetAddrToString */ |
OLD | NEW |