diff --git a/headers/legacy/network/arpa/inet.h b/headers/legacy/network/arpa/inet.h index 346961780c..bb1827cfd8 100644 --- a/headers/legacy/network/arpa/inet.h +++ b/headers/legacy/network/arpa/inet.h @@ -88,6 +88,10 @@ #define inet_nsap_addr __inet_nsap_addr #define inet_nsap_ntoa __inet_nsap_ntoa +#ifdef __cplusplus +extern "C" { +#endif + __BEGIN_DECLS unsigned long inet_addr __P((const char *)); int inet_aton __P((const char *, struct in_addr *)); @@ -107,6 +111,10 @@ u_int inet_nsap_addr __P((const char *, u_char *, int)); char *inet_nsap_ntoa __P((int, const u_char *, char *)); __END_DECLS +#ifdef __cplusplus +} +#endif + #if defined(__hpux) && defined(_XOPEN_SOURCE_EXTENDED) /* * Macros for number representation conversion. diff --git a/headers/legacy/network/netdb.h b/headers/legacy/network/netdb.h index 4d0f717b1b..c5e50a6b2f 100644 --- a/headers/legacy/network/netdb.h +++ b/headers/legacy/network/netdb.h @@ -102,6 +102,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + #ifndef _PATH_HEQUIV #define _PATH_HEQUIV "/etc/hosts.equiv" #endif @@ -124,12 +128,7 @@ __BEGIN_DECLS extern int * __h_errno __P((void)); __END_DECLS -#if defined(_REENTRANT) || \ - (__GLIBC__ > 2 || __GLIBC__ == 2 && __GLIBC_MINOR__ >= 3) #define h_errno (*__h_errno()) -#else -extern int h_errno; -#endif /* * Structures returned by network data base library. All addresses are @@ -262,7 +261,6 @@ struct addrinfo { #define SCOPE_DELIMITER '%' -#ifdef _REENTRANT #if defined (__hpux) || defined(__osf__) || defined(_AIX) #define _MAXALIASES 35 #define _MAXLINELEN 1024 @@ -352,7 +350,7 @@ struct servent_data { #endif }; #endif -#endif + __BEGIN_DECLS void endhostent __P((void)); void endnetent __P((void)); @@ -399,7 +397,6 @@ int innetgr __P((const char *, const char *, const char *, const char *)); #endif -#ifdef _REENTRANT #if defined(__hpux) || defined(__osf__) || defined(_AIX) int gethostbyaddr_r __P((const char *, int, int, struct hostent *, struct hostent_data *)); @@ -532,6 +529,9 @@ int setnetgrent_r __P((char *, void **)); #endif #endif + +#ifdef __cplusplus +} #endif __END_DECLS diff --git a/headers/legacy/network/resolv.h b/headers/legacy/network/resolv.h index dfe5b6b983..a0115f9468 100644 --- a/headers/legacy/network/resolv.h +++ b/headers/legacy/network/resolv.h @@ -67,6 +67,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + /* * Revision information. This is the release date in YYYYMMDD format. * It can change every day so the right thing to do with it is use it @@ -285,16 +289,10 @@ union res_sockaddr_union { /* 0x00010000 */ /* Things involving an internal (static) resolver context. */ -#ifdef _REENTRANT __BEGIN_DECLS extern struct __res_state *__res_state(void); __END_DECLS #define _res (*__res_state()) -#else -#ifndef __BIND_NOSTATIC -extern struct __res_state _res; -#endif -#endif #ifndef __BIND_NOSTATIC #define fp_nquery __fp_nquery @@ -498,4 +496,8 @@ int res_getservers __P((res_state, union res_sockaddr_union *, int)); __END_DECLS +#ifdef __cplusplus +} +#endif + #endif /* !_RESOLV_H_ */ diff --git a/src/kits/network/compat/libbind/DEVNOTES b/src/kits/network/compat/libbind/DEVNOTES index 3ec0e330ea..f6d64470cf 100644 --- a/src/kits/network/compat/libbind/DEVNOTES +++ b/src/kits/network/compat/libbind/DEVNOTES @@ -4,9 +4,11 @@ ported to Haiku This file contains important information for developers who want to update this BIND port. I created config.h, port_before.h, and port_after.h with "configure --enable-threads --disable-ipv6" on a BONE-compatible system and fixed some mistakes that the script made. All changes to these three files are marked with a comment containing the keyword CHANGED. -Our private folder are: +Added folders and files: headers (some headers are not defined in Haiku) src (functions that are not part of Haiku, e.g.: strsep) + + All BIND headers were moved to legacy/network (public) and private/net (private) in the system-wide headers folder. Porting issues: BIND wants to include sys/un.h and utmp.h. We do not have these, so I put empty headers into the private headers folder. @@ -19,4 +21,6 @@ Added sources for compatibility: Changes made to the sources and headers: nameser_compat.h: added check for __HAIKU__ and __BEOS__ to not redefine endianness - irs/gai_strerror and irs/irs_data.c: Changed the initialization of the mutex lock and rewrote two functions to use BeOS-native TLS. + arpa/inet.h, netdb.h, resolv.h: added check for __cplusplus, removed check for _REENTRANT (we are always reentrant) + + irs/gai_strerror.c, irs/irs_data.c: Changed the initialization of the mutex lock and switched to BeOS-native TLS in gai_strerror() and net_data_init().