Code cleanup: removing config.h and cleaning up platform.h

This commit is contained in:
Ben Vanik
2015-05-02 01:41:39 -07:00
parent 30f7effa73
commit 4d15b2296e
21 changed files with 41 additions and 163 deletions

View File

@@ -426,12 +426,12 @@ uint64_t ResolveFunctionSymbol(void* raw_context, uint64_t symbol_info_ptr) {
// Overwrite the call site.
// The return address points to ReloadRCX work after the call.
#if XE_LIKE_WIN32
#if XE_PLATFORM_WIN32
uint64_t return_address = reinterpret_cast<uint64_t>(_ReturnAddress());
#else
uint64_t return_address =
reinterpret_cast<uint64_t>(__builtin_return_address(0));
#endif // XE_LIKE_WIN32
#endif // XE_PLATFORM_WIN32
#pragma pack(push, 1)
struct Asm {
uint16_t mov_rax;
@@ -507,12 +507,12 @@ uint64_t ResolveFunctionAddress(void* raw_context, uint32_t target_address) {
uint64_t addr = reinterpret_cast<uint64_t>(x64_fn->machine_code());
// Add an IC slot, if there is room.
#if XE_LIKE_WIN32
#if XE_PLATFORM_WIN32
uint64_t return_address = reinterpret_cast<uint64_t>(_ReturnAddress());
#else
uint64_t return_address =
reinterpret_cast<uint64_t>(__builtin_return_address(0));
#endif // XE_LIKE_WIN32
#endif // XE_PLATFORM_WIN32
#pragma pack(push, 1)
struct Asm {
uint16_t cmp_rdx;

View File

@@ -15,7 +15,7 @@
#include "poly/main.h"
#include "poly/poly.h"
#if !XE_LIKE_WIN32
#if !XE_PLATFORM_WIN32
#include <dirent.h>
#endif // !WIN32
#include <gflags/gflags.h>
@@ -319,7 +319,7 @@ class TestRunner {
bool DiscoverTests(std::wstring& test_path,
std::vector<std::wstring>& test_files) {
// TODO(benvanik): use PAL instead of this.
#if XE_LIKE_WIN32
#if XE_PLATFORM_WIN32
std::wstring search_path = test_path;
search_path.append(L"\\*.s");
WIN32_FIND_DATA ffd;

View File

@@ -29,12 +29,12 @@ int main(std::vector<std::wstring>& args) {
}
int ret = Catch::Session().run(int(args.size()), narrow_argv);
if (ret) {
#if XE_LIKE_WIN32
#if XE_PLATFORM_WIN32
// Visual Studio kills the console on shutdown, so prevent that.
if (poly::debugging::IsDebuggerAttached()) {
poly::debugging::Break();
}
#endif // XE_LIKE_WIN32
#endif // XE_PLATFORM_WIN32
}
return ret;
}