diff --git a/makefile b/makefile index 77b3fcaf96..e9e2076440 100755 --- a/makefile +++ b/makefile @@ -1134,8 +1134,7 @@ vm-depends := $(generated-code) \ vm-sources = \ $(src)/system/$(system).cpp \ - $(src)/system/$(system)/signal.cpp \ - $(src)/system/$(system)/memory.cpp \ + $(wildcard $(src)/system/$(system)/*.cpp) \ $(src)/finder.cpp \ $(src)/machine.cpp \ $(src)/util.cpp \ @@ -1270,8 +1269,7 @@ generator-depends := $(wildcard $(src)/*.h) generator-sources = \ $(src)/tools/type-generator/main.cpp \ $(src)/system/$(build-system).cpp \ - $(src)/system/$(build-system)/signal.cpp \ - $(src)/system/$(build-system)/memory.cpp \ + $(wildcard $(src)/system/$(build-system)/*.cpp) \ $(src)/finder.cpp \ $(src)/util/arg-parser.cpp diff --git a/src/system/posix/crash.cpp b/src/system/posix/crash.cpp new file mode 100644 index 0000000000..e92a7c726e --- /dev/null +++ b/src/system/posix/crash.cpp @@ -0,0 +1,22 @@ +/* Copyright (c) 2008-2014, Avian Contributors + + Permission to use, copy, modify, and/or distribute this software + for any purpose with or without fee is hereby granted, provided + that the above copyright notice and this permission notice appear + in all copies. + + There is NO WARRANTY for this software. See license.txt for + details. */ + +#include + +namespace avian { +namespace system { + +NO_RETURN void crash() +{ + abort(); +} + +} // namespace system +} // namespace avian diff --git a/src/system/posix/signal.cpp b/src/system/posix/signal.cpp index 257808ff87..9b2f015790 100644 --- a/src/system/posix/signal.cpp +++ b/src/system/posix/signal.cpp @@ -149,11 +149,6 @@ void handleSignal(int signal, siginfo_t*, void* context) } // namespace posix -NO_RETURN void crash() -{ - abort(); -} - SignalRegistrar::SignalRegistrar() { data = new (malloc(sizeof(Data))) Data(); diff --git a/src/system/windows/crash.cpp b/src/system/windows/crash.cpp new file mode 100644 index 0000000000..032e2d30c2 --- /dev/null +++ b/src/system/windows/crash.cpp @@ -0,0 +1,28 @@ +/* Copyright (c) 2008-2014, Avian Contributors + + Permission to use, copy, modify, and/or distribute this software + for any purpose with or without fee is hereby granted, provided + that the above copyright notice and this permission notice appear + in all copies. + + There is NO WARRANTY for this software. See license.txt for + details. */ + +#include + +namespace avian { +namespace system { + +NO_RETURN void crash() +{ + // trigger an EXCEPTION_ACCESS_VIOLATION, which we will catch and + // generate a debug dump for + *static_cast(0) = 0; + + // Some (all?) compilers don't realize that we can't possibly continue past + // the above statement. + abort(); +} + +} // namespace system +} // namespace avian diff --git a/src/system/windows/signal.cpp b/src/system/windows/signal.cpp index 34cd5e27a8..d630150a8a 100644 --- a/src/system/windows/signal.cpp +++ b/src/system/windows/signal.cpp @@ -324,17 +324,6 @@ bool SignalRegistrar::Data::registerHandler(Handler* handler, int index) } } -NO_RETURN void crash() -{ - // trigger an EXCEPTION_ACCESS_VIOLATION, which we will catch and - // generate a debug dump for - *static_cast(0) = 0; - - // Some (all?) compilers don't realize that we can't possibly continue past - // the above statement. - abort(); -} - bool SignalRegistrar::registerHandler(Signal signal, Handler* handler) { return data->registerHandler(handler, signal);