diff --git a/src/core/fsservices.h b/src/core/fsservices.h index d14f4bb..be457b6 100644 --- a/src/core/fsservices.h +++ b/src/core/fsservices.h @@ -66,7 +66,9 @@ //========================================================================= #if IS_UNIX -#include + #if HAVE_SYS_PARAM_H + #include + #endif #endif //========================================================================= diff --git a/src/core/haval.cpp b/src/core/haval.cpp index 3a10bbb..77c84b7 100644 --- a/src/core/haval.cpp +++ b/src/core/haval.cpp @@ -77,8 +77,13 @@ * in "../../include/byteorder.h" to get this information. */ #include "stdcore.h" +#include "config.h" #include -#include +#ifdef HAVE_MEMORY_H + #include +#else + #include +#endif #include "haval.h" #include "debug.h" diff --git a/src/core/msystem.cpp b/src/core/msystem.cpp index 39e3e21..60feef1 100644 --- a/src/core/msystem.cpp +++ b/src/core/msystem.cpp @@ -71,9 +71,12 @@ /* * set, reset environment to be passed to mpopem */ +#include "config.h" #include #include -#include +#ifndef _SORTIX_SOURCE +# include +#endif #include #include #include @@ -87,7 +90,9 @@ # include # include #endif -#include +#ifdef HAVE_SYS_PARAM_H +# include +#endif #include #include "msystem.h" diff --git a/src/core/unixfsservices.cpp b/src/core/unixfsservices.cpp index fb1771d..1222117 100644 --- a/src/core/unixfsservices.cpp +++ b/src/core/unixfsservices.cpp @@ -55,7 +55,9 @@ #include #include #include -#include +#ifdef HAVE_SYS_PARAM_H +# include +#endif #ifdef HAVE_SYS_MOUNT_H # include #endif @@ -403,7 +405,7 @@ void cUnixFSServices::GetMachineNameFullyQualified( TSTRING& strName ) const char buf[256]; if (gethostname(buf, 256) != 0) { -#ifdef SOLARIS_NO_GETHOSTBYNAME +#if defined(SOLARIS_NO_GETHOSTBYNAME) || defined(_SORTIX_SOURCE) strName = buf; return; #else @@ -458,6 +460,7 @@ bool cUnixFSServices::GetIPAddress( uint32& uiIPAddress ) bool fGotAddress = false; cDebug d( _T("cUnixFSServices::GetIPAddress") ); +#ifndef _SORTIX_SOURCE struct utsname utsnameBuf; if( EFAULT != uname( &utsnameBuf) ) { @@ -489,6 +492,7 @@ bool cUnixFSServices::GetIPAddress( uint32& uiIPAddress ) } else d.TraceError( _T("uname failed") ); +#endif return( fGotAddress ); } diff --git a/src/core/wchar16.cpp b/src/core/wchar16.cpp index a8b9ccc..6e7d7dd 100644 --- a/src/core/wchar16.cpp +++ b/src/core/wchar16.cpp @@ -35,10 +35,13 @@ // Function and classes dealing with the WCHAR16 type // #include "stdcore.h" +#include "config.h" #include "wchar16.h" #include "debug.h" #include // for stl::out_of_range -#include +#ifdef HAVE_MEMORY_H +# include +#endif int wchar16len(const WCHAR16* s) { diff --git a/src/cryptlib/misc.h b/src/cryptlib/misc.h index 6d4c949..091c9ef 100644 --- a/src/cryptlib/misc.h +++ b/src/cryptlib/misc.h @@ -3,7 +3,11 @@ #include "config.h" #include -#include +#ifdef HAVE_MEMORY_H + #include +#else + #include +#endif #include inline unsigned int bitsToBytes(unsigned int bitCount) diff --git a/src/tripwire/smtpmailmessage.cpp b/src/tripwire/smtpmailmessage.cpp index 86adc1a..c838c53 100644 --- a/src/tripwire/smtpmailmessage.cpp +++ b/src/tripwire/smtpmailmessage.cpp @@ -54,6 +54,10 @@ #include #include +#ifdef _SORTIX_SOURCE +# include +#endif + /* Some systems like Solaris and AIX don't define * INADDR_NONE, but it's pretty standard. If not, * then the OS _should_ define it for us. @@ -192,12 +196,16 @@ long cSMTPMailMessage::GetServerAddress() } else { +#ifdef _SORTIX_SOURCE + return INADDR_NONE; +#else // do a DNS lookup of the hostname and get the long hostent *ent = mPfnGethostbyname(sNarrowString.c_str()); if (!ent) return INADDR_NONE; else return *(long *)ent->h_addr_list[0]; +#endif } } diff --git a/src/twadmin/twadmincl.cpp b/src/twadmin/twadmincl.cpp index 4e55b36..ce11e15 100644 --- a/src/twadmin/twadmincl.cpp +++ b/src/twadmin/twadmincl.cpp @@ -63,7 +63,7 @@ #include "core/displayencoder.h" //Provide a swab() impl. from glibc, for platforms that don't have one -#if defined(__SYLLABLE__) || defined(__ANDROID_API__) +#if defined(__SYLLABLE__) || defined(__ANDROID_API__) || defined(_SORTIX_SOURCE) void swab (const void *bfrom, void *bto, ssize_t n) { const char *from = (const char *) bfrom;