From 74f2f47cb63b02638270beecd20acea1a0f5665e Mon Sep 17 00:00:00 2001 From: Tim Foley Date: Wed, 27 Sep 2017 11:17:39 -0700 Subject: First attempt at a Linux build (#193) * First attempt at a Linux build - Fix up places where C++ idioms were written assuming lenient behavior of Microsoft's compiler - Add a few more alternatives for platform-specific behavior where Windows was the only platform accounted for. - Add a basic Makefile that can at least invoke our build, even if it isn't going good dependency tracking, etc. - Build `libslang.so` and `slangc` that depends on it, using a relative `RPATH` to make the binary portable (I hope) - Add an initial `.travis.yml` to see if we can trigger their build process. * Fixup: const bug in `List::Sort` I'm not clear why this gets picked up by the gcc *and* clang that Travis uses, but not the (newer) gcc I'm using on Ubuntu here, but I'm hoping it is just some missing `const` qualifiers. * Fixup: reorder specialization of "class info" Clang complains about things being specialized after being instantiated (implicilty), and I hope it is just the fact that I generate the class info for the roots of the hierarchy after the other cases. We'll see. * Fixup: add `platform.cpp` to unified/lumped build * Fixup: Windows uses `FreeLibrary` and not `UnloadLibrary` * Fixup: fix Windows project file to include new source file This obviously points to the fact that we are going to need to be generating these files sooner or later. --- source/core/common.h | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'source/core/common.h') diff --git a/source/core/common.h b/source/core/common.h index f0f6902d1..dbb837821 100644 --- a/source/core/common.h +++ b/source/core/common.h @@ -13,13 +13,15 @@ namespace Slang { + typedef int32_t Int32; + typedef uint32_t UInt32; + typedef int64_t Int64; - typedef unsigned short Word; -#ifdef _M_X64 - typedef int64_t PtrInt; -#else - typedef int PtrInt; -#endif + typedef uint64_t UInt64; + +// typedef unsigned short Word; + + typedef intptr_t PtrInt; template inline T&& _Move(T & obj) @@ -38,7 +40,7 @@ namespace Slang #ifdef _MSC_VER #define SLANG_RETURN_NEVER __declspec(noreturn) #else -#efine SLANG_RETURN_NEVER /* empty */ +#define SLANG_RETURN_NEVER /* empty */ #endif SLANG_RETURN_NEVER void signalUnexpectedError(char const* message); -- cgit v1.2.3