Merge pull request #195 from Huulivoide/master

Minor fixes needed to build on Linux/64bit.
This commit is contained in:
Simon Robertshaw 2012-10-09 08:43:13 -07:00
commit 249e3dcad3
4 changed files with 19 additions and 12 deletions

View File

@ -122,7 +122,7 @@ else:
env.Append(LIBS=['z', 'bz2', 'fftw3f']) env.Append(LIBS=['z', 'bz2', 'fftw3f'])
env.Append(CPPPATH=['src/', 'data/', 'generated/']) env.Append(CPPPATH=['src/', 'data/', 'generated/'])
env.Append(CCFLAGS=['-w', '-std=c99', '-fkeep-inline-functions']) env.Append(CCFLAGS=['-w', '-std=c++98', '-fkeep-inline-functions'])
env.Append(LIBS=['pthread', 'm']) env.Append(LIBS=['pthread', 'm'])
env.Append(CPPDEFINES=["USE_SDL", "LUACONSOLE", "GRAVFFT", "_GNU_SOURCE", "USE_STDINT", "_POSIX_C_SOURCE=200112L"]) env.Append(CPPDEFINES=["USE_SDL", "LUACONSOLE", "GRAVFFT", "_GNU_SOURCE", "USE_STDINT", "_POSIX_C_SOURCE=200112L"])
@ -237,8 +237,6 @@ if(GetOption('win')):
sources+=Glob("src/*/*.cpp") sources+=Glob("src/*/*.cpp")
sources+=Glob("src/simulation/elements/*.cpp") sources+=Glob("src/simulation/elements/*.cpp")
sources+=Glob("src/simulation/tools/*.cpp") sources+=Glob("src/simulation/tools/*.cpp")
sources+=Glob("generated/ToolClasses.cpp")
sources+=Glob("generated/ElementClasses.cpp")
if(GetOption('win')): if(GetOption('win')):
sources = filter(lambda source: str(source) != 'src/simulation/Gravity.cpp', sources) sources = filter(lambda source: str(source) != 'src/simulation/Gravity.cpp', sources)
@ -273,8 +271,12 @@ if(GetOption('win')):
envCopy.Append(CCFLAGS=['-mincoming-stack-boundary=2']) envCopy.Append(CCFLAGS=['-mincoming-stack-boundary=2'])
sources+=envCopy.Object('src/simulation/Gravity.cpp') sources+=envCopy.Object('src/simulation/Gravity.cpp')
env.Command(['generated/ElementClasses.cpp', 'generated/ElementClasses.h'], Glob('src/simulation/elements/*.cpp'), "python generator.py elements $TARGETS $SOURCES") env.Command(['generated/ElementClasses.cpp', 'generated/ElementClasses.h'], Glob('src/simulation/elements/*.cpp'), "python2 generator.py elements $TARGETS $SOURCES")
env.Command(['generated/ToolClasses.cpp', 'generated/ToolClasses.h'], Glob('src/simulation/tools/*.cpp'), "python generator.py tools $TARGETS $SOURCES") sources+=Glob("generated/ElementClasses.cpp")
env.Command(['generated/ToolClasses.cpp', 'generated/ToolClasses.h'], Glob('src/simulation/tools/*.cpp'), "python2 generator.py tools $TARGETS $SOURCES")
sources+=Glob("generated/ToolClasses.cpp")
env.Decider('MD5') env.Decider('MD5')
t=env.Program(target=programName, source=sources) t=env.Program(target=programName, source=sources)
Default(t) Default(t)

View File

@ -39,6 +39,10 @@
#include "LuaSlider.h" #include "LuaSlider.h"
#include "LuaProgressBar.h" #include "LuaProgressBar.h"
#ifdef __unix__
#include <unistd.h>
#endif
extern "C" extern "C"
{ {
#ifdef WIN #ifdef WIN
@ -1702,4 +1706,4 @@ std::string LuaScriptInterface::FormatCommand(std::string command)
LuaScriptInterface::~LuaScriptInterface() { LuaScriptInterface::~LuaScriptInterface() {
delete legacy; delete legacy;
} }

View File

@ -424,20 +424,20 @@ namespace pim
//Load value at base stack + offset into eax //Load value at base stack + offset into eax
emit("8B 85"); //mov eax [ebp+ram+offset] emit("8B 85"); //mov eax [ebp+ram+offset]
emit((int) (ram - argument.Integer)); emit((intptr_t) (ram - argument.Integer));
//Store value in eax onto top of program stack //Store value in eax onto top of program stack
emit("89 07"); //mov [edi], eax emit("89 07"); //mov [edi], eax
emit((int) (ram)); emit((intptr_t) (ram));
break; break;
case Opcode::Store: case Opcode::Store:
//Load value on top of the program stack into eax //Load value on top of the program stack into eax
emit("8B 07"); //mov eax [edi] emit("8B 07"); //mov eax [edi]
emit((int) (ram)); emit((intptr_t) (ram));
//Load value in eax onto top of program stack //Load value in eax onto top of program stack
emit("89 85"); //mov [ebp+ram+offset], eax emit("89 85"); //mov [ebp+ram+offset], eax
emit((int) (ram - argument.Integer)); emit((intptr_t) (ram - argument.Integer));
emit("83 C7 04"); //add edi 4 emit("83 C7 04"); //add edi 4
break; break;
@ -634,4 +634,4 @@ namespace pim
programCounter = entryPoint; programCounter = entryPoint;
Run(); Run();
} }
} }

View File

@ -10,6 +10,7 @@
#define The_Powder_Toy_StructProperty_h #define The_Powder_Toy_StructProperty_h
#include <string> #include <string>
#include <stdint.h>
struct StructProperty struct StructProperty
{ {