Added HaikuOS support
parent
bf2ef2ce38
commit
e706ca0bc7
|
@ -148,6 +148,10 @@ solaris_detected=false
|
|||
issolaris() {
|
||||
$solaris_detected
|
||||
}
|
||||
haiku_detected=false
|
||||
ishaiku() {
|
||||
$haiku_detected
|
||||
}
|
||||
|
||||
check_compile 'whether we have GNU-style getservbyname_r()' "-DHAVE_GNU_GETSERVBYNAME_R" \
|
||||
'#define _GNU_SOURCE\n#include <netdb.h>\nint main() {\nstruct servent *se = 0;struct servent se_buf;char buf[1024];\ngetservbyname_r("foo", (void*) 0, &se_buf, buf, sizeof(buf), &se);\nreturn 0;}'
|
||||
|
@ -168,6 +172,7 @@ check_compile_run 'whether OpenBSDs fclose() (illegally) calls close()' \
|
|||
OUR_CPPFLAGS="$OUR_CPPFLAGS -DBROKEN_FCLOSE"
|
||||
}
|
||||
check_define __sun && check_define __SVR4 && solaris_detected=true
|
||||
check_define __HAIKU__ && haiku_detected=true
|
||||
|
||||
echo "CC=$CC">>config.mak
|
||||
[ -z "$CPPFLAGS" ] || echo "CPPFLAGS=$CPPFLAGS">>config.mak
|
||||
|
@ -213,6 +218,9 @@ elif isbsd ; then
|
|||
elif issolaris; then
|
||||
echo "CFLAGS+=-DIS_SOLARIS -D__EXTENSIONS__" >> config.mak
|
||||
echo "SOCKET_LIBS=-lsocket -lnsl" >> config.mak
|
||||
elif ishaiku ; then
|
||||
echo LIBDL=>>config.mak
|
||||
echo "CFLAGS+=-DIS_HAIKU" >> config.mak
|
||||
fi
|
||||
|
||||
echo "Done, now run $make_cmd && $make_cmd install"
|
||||
|
|
|
@ -74,7 +74,11 @@ char *get_config_path(char* default_path, char* pbuf, size_t bufsize) {
|
|||
|
||||
// priority 3; $HOME/.proxychains/proxychains.conf
|
||||
path = getenv("HOME");
|
||||
#ifdef IS_HAIKU
|
||||
snprintf(pbuf, bufsize, "%s/config/settings/%s", path, PROXYCHAINS_CONF_FILE);
|
||||
#else
|
||||
snprintf(pbuf, bufsize, "%s/.proxychains/%s", path, PROXYCHAINS_CONF_FILE);
|
||||
#endif
|
||||
path = pbuf;
|
||||
if(check_path(path))
|
||||
goto have;
|
||||
|
|
|
@ -38,6 +38,10 @@
|
|||
#include "core.h"
|
||||
#include "common.h"
|
||||
|
||||
#ifdef IS_HAIKU
|
||||
#undef satosin // to prevent macro redefinition
|
||||
#endif
|
||||
|
||||
#define satosin(x) ((struct sockaddr_in *) &(x))
|
||||
#define SOCKADDR(x) (satosin(x)->sin_addr.s_addr)
|
||||
#define SOCKADDR_2(x) (satosin(x)->sin_addr)
|
||||
|
@ -682,7 +686,13 @@ int pc_getnameinfo(const struct sockaddr *sa, socklen_t salen,
|
|||
return 0;
|
||||
}
|
||||
|
||||
#ifdef IS_HAIKU
|
||||
struct hostent *gethostbyaddr(const char *address, socklen_t length, int type) {
|
||||
socklen_t len = length;
|
||||
const char* addr = address;
|
||||
#else
|
||||
struct hostent *gethostbyaddr(const void *addr, socklen_t len, int type) {
|
||||
#endif
|
||||
INIT();
|
||||
PDEBUG("TODO: proper gethostbyaddr hook\n");
|
||||
|
||||
|
|
Loading…
Reference in New Issue