Browse Source

fixed compile errors

vlod 1 year ago
parent
commit
fe8000e649

+ 2 - 0
Pika/CMakeLists.txt

@@ -7,6 +7,8 @@ cmake_minimum_required(VERSION 3.16)
 set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreadedDebug$<$<CONFIG:Debug>:Debug>")
 set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Release>:Release>")
 
+set(CMAKE_CXX_STANDARD 17)
+
 set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE) #link time optimization
 
 

+ 2 - 2
Pika/core/pikaRuntime/pikaMain.cpp

@@ -53,8 +53,8 @@ BOOL WINAPI customConsoleHandlerRoutine(
 #pragma region gpu
 extern "C"
 {
-	__declspec(dllexport) unsigned long NvOptimusEnablement = 0;
-	__declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 0;
+	__declspec(dllexport) unsigned long NvOptimusEnablement = 1;
+	__declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1;
 }
 #pragma endregion
 

+ 9 - 7
Pika/core/sharedRuntime/baseContainer.h

@@ -12,7 +12,8 @@
 #include <staticString.h>
 #include <vector>
 #include <stringManipulation/stringManipulation.h>
-
+#include <fstream>
+#include <string_view>
 
 #define READENTIREFILE(x) bool x(const char* name, void* buffer, size_t size)
 typedef READENTIREFILE(readEntireFile_t);
@@ -166,9 +167,10 @@ struct RequestedContainerInfo
 		return 1;
 	}
 
+	//todo change to string
 	bool appendFileBinary(std::string_view name, void *data, size_t s)
 	{
-		std::ofstream f(name, std::ios::binary | std::ios::out | std::ios::app);
+		std::ofstream f(std::string(name), std::ios::binary | std::ios::out | std::ios::app);
 
 		if (!f.is_open()) { return 0; }
 
@@ -213,7 +215,7 @@ struct RequestedContainerInfo
 
 		pika::memory::pushCustomAllocatorsToStandard();
 		{
-			std::ifstream f(name, std::ios::binary);
+			std::ifstream f(std::string(name), std::ios::binary);
 			if (!f.is_open())
 			{
 				succeed = false;
@@ -237,7 +239,7 @@ struct RequestedContainerInfo
 
 		pika::memory::pushCustomAllocatorsToStandard();
 		{
-			std::ifstream f(name, std::ios::binary);
+			std::ifstream f(std::string(name), std::ios::binary);
 
 			if (!f.is_open())
 			{
@@ -262,7 +264,7 @@ struct RequestedContainerInfo
 
 		pika::memory::pushCustomAllocatorsToStandard();
 		{
-			std::ifstream f(name);
+			std::ifstream f{ std::string(name) };
 
 			if (!f.is_open())
 			{
@@ -288,7 +290,7 @@ struct RequestedContainerInfo
 
 		pika::memory::pushCustomAllocatorsToStandard();
 		{
-			std::ifstream f(name, std::ifstream::ate | std::ifstream::binary);
+			std::ifstream f(std::string(name), std::ifstream::ate | std::ifstream::binary);
 			if (!f.is_open())
 			{
 				success = false;
@@ -310,7 +312,7 @@ struct RequestedContainerInfo
 		size = 0;
 		pika::memory::pushCustomAllocatorsToStandard();
 		{
-			std::ifstream f(name, std::ifstream::ate);
+			std::ifstream f(std::string(name), std::ifstream::ate);
 			if (!f.is_open())
 			{
 				success = false;

+ 1 - 0
Pika/core/sharedRuntime/shortcutApi/shortcutApi.h

@@ -1,6 +1,7 @@
 #pragma once
 #include <windowSystemm/input.h>
 #include <unordered_map>
+#include <string>
 
 namespace pika
 {

+ 2 - 2
Pika/resources/logs.txt

@@ -1,2 +1,2 @@
-#2024-01-10 18:35:02: Created container: PikaTextEditor
-#2024-01-10 18:35:04: Destroyed continer: PikaTextEditor #1
+#2024-01-12 14:13:14: Created container: ThreeDGameExample
+#2024-01-12 14:13:32: Destroyed continer: ThreeDGameExample #1