solaris fixes

This commit is contained in:
Kelvin Sherlock 2016-08-02 20:12:17 -04:00
parent dce8bc8b02
commit 5daebb35b6
6 changed files with 12 additions and 16 deletions

View File

@ -3,15 +3,21 @@ project(mpw)
set (PROJECT_TYPE "CXX")
set (PROJECT_NAME "mpw")
# these are only effective as of CMake 3.1, apparently.
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
set(CMAKE_CXX_EXTENSIONS FALSE)
set(CMAKE_C_STANDARD 99)
set(CMAKE_C_STANDARD_REQUIRED TRUE)
set(CMAKE_C_EXTENSIONS FALSE)
if (APPLE)
set(CMAKE_C_COMPILER "clang")
set(CMAKE_CXX_COMPILER "clang++")
set(CMAKE_CXX_FLAGS "-stdlib=libc++ -Wall -g")
set(CMAKE_C_FLAGS " -Wall -g")
set(CMAKE_C_FLAGS "-Wall -g")
elseif("${CMAKE_SYSTEM_NAME}" MATCHES "SunOS")
set(CMAKE_C_COMPILER "gcc")
set(CMAKE_CXX_COMPILER "g++")
@ -27,11 +33,6 @@ elseif("${CMAKE_SYSTEM_NAME}" MATCHES "Windows")
endif()
#set_property (TARGET mpw PROPERTY CXX_STANDARD 14)
#set_property (TARGET mpw PROPERTY CXX_STANDARD_REQUIRED TRUE)
#set_property (TARGET mpw PROPERTY CXX_EXTENSIONS FALSE)
add_subdirectory(bin)
add_subdirectory(cpu)
add_subdirectory(toolbox)

View File

@ -1,7 +1,5 @@
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_CXX_FLAGS "-std=c++11 -stdlib=libc++ -Wall -g")
add_definitions(-I ${CMAKE_SOURCE_DIR}/)
set(MPW_SRC mpw.cpp mpw_io.cpp mpw_close.cpp mpw_access.cpp mpw_ioctl.cpp mpw_errno.cpp

View File

@ -5,7 +5,7 @@
static_assert(sizeof(float) == 4, "Unexpected float size");
static_assert(sizeof(double) == 8, "Unexpected double size");
static_assert(sizeof(long double) == 8 || sizeof(long double) == 16, "Unexpected long double size");
static_assert(sizeof(long double) == 8 || sizeof(long double) == 12 || sizeof(long double) == 16, "Unexpected long double size");
void fpinfo::init(float *f)
{

View File

@ -15,7 +15,7 @@ struct fpinfo {
fpinfo(float f) { init(&f); }
fpinfo(double d) { init(&d); }
fpinfo(long double ld) {
if (sizeof(long double) == 16) init(&ld);
if (sizeof(long double) == 16 || sizeof(long double) == 12) init(&ld);
if (sizeof(long double) == 8) init((double *)&ld);
}

View File

@ -1320,7 +1320,6 @@ namespace Native {
uint32_t sp;
uint32_t theType;
uint16_t count;
sp = StackFrame<4>(theType);
@ -1354,8 +1353,6 @@ namespace Native {
{
// FUNCTION Count1Types: Integer;
uint16_t count;
Log("%04x Count1Types\n", trap);
fprintf(stderr, "%s not yet implemented\n", __func__);

View File

@ -169,8 +169,7 @@ using its_complicated::signbit;
{
char buffer[16];
static_assert(sizeof(long double) == 16, "unexpected long double size");
static_assert(sizeof(long double) == 16 || sizeof(long double) == 12, "unexpected long double size");
// read and swap 10 bytes
// this is very much little endian.
@ -185,6 +184,7 @@ using its_complicated::signbit;
// now cast...
return *((long double *)buffer);
}
@ -235,7 +235,7 @@ using its_complicated::signbit;
template<>
void writenum<long double>(long double value, uint32_t address)
{
static_assert(sizeof(value) == 16, "unexpected long double size");
static_assert(sizeof(value) == 16 || sizeof(value) == 12, "unexpected long double size");
char buffer[16];