fixed build with clang

This commit is contained in:
athre0z 2015-05-20 00:44:28 +02:00
parent e339291104
commit 7bb3e582b1
5 changed files with 6 additions and 4 deletions

View File

@ -14,7 +14,7 @@ if (NOT CONFIGURED_ONCE)
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR
"${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set(compiler_specific "-Werror")
set(compiler_specific_cxx "-std=c++0x")
set(compiler_specific_cxx "-std=c++14")
elseif (MSVC)
set(compiler_specific "/WX /W4 /D_CRT_SECURE_NO_WARNINGS")
endif ()

View File

@ -126,7 +126,7 @@ public:
static FullClassT* fromInstance(ZydisClassT* instance)
{
return reinterpret_cast<FullClassT*>(
reinterpret_cast<uintptr_t>(instance) - offsetof(FullClassT, instance));
reinterpret_cast<uintptr_t>(instance) - sizeof(std::declval<FullClassT>().type));
}
};
#pragma pack(pop)

View File

@ -33,8 +33,9 @@
#define Zydis_EXPORTS
#include <cstdbool>
#include <stdbool.h>
#include <stdint.h>
#include <stddef.h>
#include "ZydisExportConfig.h"
#ifdef __cplusplus

View File

@ -31,6 +31,7 @@
#ifndef _ZYDIS_SYMBOLRESOLVER_HPP_
#define _ZYDIS_SYMBOLRESOLVER_HPP_
#include <string>
#include <unordered_map>
#include "ZydisTypes.hpp"