solaris updates.

This commit is contained in:
Kelvin Sherlock 2016-08-02 20:33:41 -04:00
parent 5daebb35b6
commit 95c018da0c
4 changed files with 39 additions and 5 deletions

View File

@ -21,12 +21,12 @@ if (APPLE)
elseif("${CMAKE_SYSTEM_NAME}" MATCHES "SunOS")
set(CMAKE_C_COMPILER "gcc")
set(CMAKE_CXX_COMPILER "g++")
set(CMAKE_CXX_FLAGS "-std=c++14 -Wall -g")
set(CMAKE_CXX_FLAGS "-std=c++14 -Wall -g -Wno-unknown-pragmas")
set(CMAKE_C_FLAGS "-std=c99 -Wall -g")
elseif("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
set(CMAKE_C_COMPILER "gcc")
set(CMAKE_CXX_COMPILER "g++")
set(CMAKE_CXX_FLAGS "-std=c++14 -Wall -g")
set(CMAKE_CXX_FLAGS "-std=c++14 -Wall -g -Wno-unknown-pragmas")
set(CMAKE_C_FLAGS "-std=c99 -Wall -g")
elseif("${CMAKE_SYSTEM_NAME}" MATCHES "Windows")

28
config.h Normal file
View File

@ -0,0 +1,28 @@
#ifndef __mpw_config_h__
#define __mpw_config_h__
#ifdef __APPLE__
#include <machine/endian.h>
#define HAVE_STAT_ST_BIRTHTIME
#define HAVE_DIRENT_D_NAMLEN
#endif
#ifdef __sun__
#include <endian.h>
#endif
#ifdef __linux__
#include <endian.h>
#endif
#ifdef _WIN32
#endif
#endif

View File

@ -54,6 +54,8 @@
#include <macos/errors.h>
#include <macos/traps.h>
#include <config.h>
// yuck. TST.W d0
extern "C" void cpuSetFlagsNZ00NewW(UWO res);
@ -102,7 +104,7 @@ namespace {
#if BYTE_ORDER == LITTLE_ENDIAN
inline constexpr uint16_t host_to_big_endian_16(uint16_t x)
{
return __builtin_bswap16(x);
return (x << 8) | (x >> 8); // __builtin_bswap16(x);
}
#endif

View File

@ -55,6 +55,8 @@
#include "stackframe.h"
#include "fs_spec.h"
#include <config.h>
#include <native/native.h>
using ToolBox::Log;
@ -381,6 +383,8 @@ namespace OS {
}
#ifdef HAVE_DIRENT_D_NAMLEN
if (dir->d_namlen > 255) continue; // too long!
#else
if (strlen(dir->d_name) > 255) continue;
#endif
if (--ioFDirIndex == 0) break;
}