summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKiritoDv <kiritodev01@gmail.com>2024-01-31 14:50:31 -0600
committerKiritoDv <kiritodev01@gmail.com>2024-01-31 14:50:31 -0600
commitdadf7414ee87ff64d9da433b67a3a7c555f9c76c (patch)
tree27283165f0d568ca4e3273a07c5c8f06e6fdd6aa
parent39fcdc86d69e2f5410b7e975ec36f56a7b7c692d (diff)
Fixed windows issues
-rw-r--r--CMakeLists.txt13
-rw-r--r--src/factories/sm64/GeoLayoutFactory.cpp2
-rw-r--r--src/factories/sm64/geo/GeoCommand.h2
-rw-r--r--src/utils/TorchUtils.h1
4 files changed, 10 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 87a960c..a3fc356 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -3,6 +3,7 @@ project(torch)
include(FetchContent)
set(CMAKE_CXX_STANDARD 20)
+set(CMAKE_C_STANDARD 11)
# Link libgfxd
# Because libgfxd is not a CMake project, we have to manually fetch it and add it to the build
@@ -55,13 +56,13 @@ else()
$<$<CONFIG:Debug>:
/w;
/Od;
- /MTd
+ /MDd
>
$<$<CONFIG:Release>:
/Oi;
/Gy;
/W3;
- /MT
+ /MD
>
/permissive-;
/MP;
@@ -72,13 +73,13 @@ else()
elseif("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "Win32")
target_compile_options(${PROJECT_NAME} PRIVATE
$<$<CONFIG:Debug>:
- /MTd
+ /MDd
>
$<$<CONFIG:Release>:
/O2;
/Oi;
/Gy;
- /MT
+ /MD
>
/permissive-;
/MP;
@@ -100,7 +101,7 @@ else()
>
/MANIFEST:NO;
/DEBUG;
- /SUBSYSTEM:WINDOWS
+ /SUBSYSTEM:CONSOLE
)
elseif("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "Win32")
target_link_options(${PROJECT_NAME} PRIVATE
@@ -115,7 +116,7 @@ else()
>
/MANIFEST:NO;
/DEBUG;
- /SUBSYSTEM:WINDOWS
+ /SUBSYSTEM:CONSOLE
)
endif()
endif()
diff --git a/src/factories/sm64/GeoLayoutFactory.cpp b/src/factories/sm64/GeoLayoutFactory.cpp
index 520b973..844b8fb 100644
--- a/src/factories/sm64/GeoLayoutFactory.cpp
+++ b/src/factories/sm64/GeoLayoutFactory.cpp
@@ -555,7 +555,7 @@ std::optional<std::shared_ptr<IParsedData>> SM64::GeoLayoutFactory::parse(std::v
}
}
- commands.push_back({opcode, arguments});
+ commands.push_back({ opcode, arguments });
}
return std::make_shared<GeoLayout>(commands);
diff --git a/src/factories/sm64/geo/GeoCommand.h b/src/factories/sm64/geo/GeoCommand.h
index 66526dc..2bad32d 100644
--- a/src/factories/sm64/geo/GeoCommand.h
+++ b/src/factories/sm64/geo/GeoCommand.h
@@ -199,7 +199,7 @@ inline std::ostream& operator<<(std::ostream& out, const GeoOpcode& opcode) {
BSWAP32((*(s32 *) &cmd[CMD_PROCESS_OFFSET(offset)]))
#define cur_geo_cmd_u32(offset) \
- BSWAP32((*(uint32_t *) &cmd[CMD_PROCESS_OFFSET(offset)]))
+ (uint32_t) BSWAP32((*(uint32_t *) &cmd[CMD_PROCESS_OFFSET(offset)]))
class GeoLayoutCommand {
public:
diff --git a/src/utils/TorchUtils.h b/src/utils/TorchUtils.h
index e3d89e6..6c8b6c4 100644
--- a/src/utils/TorchUtils.h
+++ b/src/utils/TorchUtils.h
@@ -4,6 +4,7 @@
#include <fstream>
#include <sstream>
#include <iomanip>
+#include <algorithm>
namespace Torch {
template< typename T >