Skip to content

Commit

Permalink
Update plugify and update vector staff
Browse files Browse the repository at this point in the history
  • Loading branch information
qubka committed Nov 10, 2024
1 parent ba2df78 commit e0d5279
Show file tree
Hide file tree
Showing 4 changed files with 1,297 additions and 1,548 deletions.
9 changes: 9 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<$<CONFIG:Debug,RelWithDebInfo>:EditAndContinue>")

if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Debug)
Expand Down Expand Up @@ -41,6 +42,14 @@ target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries(${PROJECT_NAME} PRIVATE PolyHook_2)
target_include_directories(${PROJECT_NAME} PRIVATE ${PolyHook_2_SOURCE_DIR})

if(MSVC)
target_compile_options(asmjit PUBLIC /wd5054)
elseif(MINGW)
target_compile_options(asmjit PUBLIC -Wno-deprecated-enum-enum-conversion)
else()
target_compile_options(asmjit PUBLIC -Wno-deprecated-anon-enum-enum-conversion -Wno-deprecated-enum-enum-conversion)
endif()

if(MSVC)
#target_compile_options(${PROJECT_NAME} PRIVATE /W4 /WX)
else()
Expand Down
12 changes: 6 additions & 6 deletions plugify/cpp_plugin.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,19 +175,19 @@ namespace plg {
};
}

bool operator==(const vec2& lhs, const vec2& rhs) {
[[nodiscard]] constexpr bool operator==(const vec2& lhs, const vec2& rhs) {
return lhs.x == rhs.x && lhs.y == rhs.y;
}

bool operator==(const vec3& lhs, const vec3& rhs) {
[[nodiscard]] constexpr bool operator==(const vec3& lhs, const vec3& rhs) {
return lhs.x == rhs.x && lhs.y == rhs.y && lhs.z == rhs.z;
}

bool operator==(const vec4& lhs, const vec4& rhs) {
[[nodiscard]] constexpr bool operator==(const vec4& lhs, const vec4& rhs) {
return lhs.x == rhs.x && lhs.y == rhs.y && lhs.z == rhs.z && lhs.w == rhs.w;
}

bool operator==(const mat4x4& lhs, const mat4x4& rhs) {
[[nodiscard]] constexpr bool operator==(const mat4x4& lhs, const mat4x4& rhs) {
for (int i = 0; i < 4; ++i) {
for (int j = 0; j < 4; ++j) {
if (lhs.m[i][j] != rhs.m[i][j])
Expand All @@ -197,14 +197,14 @@ namespace plg {
return true;
}

plg::str ReturnStr(plg::string str) {
[[nodiscard]] inline plg::str ReturnStr(plg::string str) {
plg::str ret{};
std::construct_at(reinterpret_cast<plg::string*>(&ret), std::move(str));
return ret;
}

template<typename T>
plg::vec ReturnVec(plg::vector<T> vec) {
[[nodiscard]] inline plg::vec ReturnVec(plg::vector<T> vec) {
plg::vec ret{};
std::construct_at(reinterpret_cast<plg::vector<T>*>(&ret), std::move(vec));
return ret;
Expand Down
Loading

0 comments on commit e0d5279

Please sign in to comment.