Build fixes for Sortix, mostly relating to missing headers

This commit is contained in:
Brian Cox 2016-04-02 23:11:37 -07:00
parent a8d0a2ff79
commit ca2242079d
8 changed files with 40 additions and 9 deletions

View File

@ -66,8 +66,10 @@
//=========================================================================
#if IS_UNIX
#if HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
#endif
//=========================================================================
// DEFINES AND MACROS

View File

@ -77,8 +77,13 @@
* in "../../include/byteorder.h" to get this information.
*/
#include "stdcore.h"
#include "config.h"
#include <stdio.h>
#ifdef HAVE_MEMORY_H
#include <memory.h>
#else
#include <string.h>
#endif
#include "haval.h"
#include "debug.h"

View File

@ -71,9 +71,12 @@
/*
* set, reset environment to be passed to mpopem
*/
#include "config.h"
#include <stdio.h>
#include <sys/types.h>
#ifndef _SORTIX_SOURCE
# include <sys/file.h>
#endif
#include <sys/stat.h>
#include <sys/wait.h>
#include <time.h>
@ -87,7 +90,9 @@
# include <unistd.h>
# include <stdlib.h>
#endif
#ifdef HAVE_SYS_PARAM_H
# include <sys/param.h>
#endif
#include <assert.h>
#include "msystem.h"

View File

@ -54,7 +54,9 @@
#include <dirent.h>
#include <sys/stat.h>
#include <sys/time.h>
#ifdef HAVE_SYS_PARAM_H
# include <sys/param.h>
#endif
#ifdef HAVE_SYS_MOUNT_H
# include <sys/mount.h>
#endif
@ -390,7 +392,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
@ -445,6 +447,7 @@ bool cUnixFSServices::GetIPAddress( uint32& uiIPAddress )
bool fGotAddress = false;
cDebug d( _T("cUnixFSServices::GetIPAddress") );
#ifndef _SORTIX_SOURCE
struct utsname utsnameBuf;
if( EFAULT != uname( &utsnameBuf) )
{
@ -476,6 +479,7 @@ bool cUnixFSServices::GetIPAddress( uint32& uiIPAddress )
}
else
d.TraceError( _T("uname failed") );
#endif
return( fGotAddress );
}

View File

@ -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 <stdexcept> // for stl::out_of_range
#ifdef HAVE_MEMORY_H
# include <memory.h>
#endif
int wchar16len(const WCHAR16* s)
{

View File

@ -3,7 +3,11 @@
#include "config.h"
#include <assert.h>
#ifdef HAVE_MEMORY_H
#include <memory.h>
#else
#include <string.h>
#endif
#include <algorithm>
inline unsigned int bitsToBytes(unsigned int bitCount)

View File

@ -54,6 +54,10 @@
#include <arpa/inet.h>
#include <sys/utsname.h>
#ifdef _SORTIX_SOURCE
# include <sys/select.h>
#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.
@ -187,12 +191,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
}
}

View File

@ -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;