From 31323de3cf80511fa077dac38337de83e9ec5537 Mon Sep 17 00:00:00 2001 From: Anthony Rabine Date: Wed, 9 Aug 2023 14:34:38 +0200 Subject: [PATCH] several vc++ compiler fixes --- story-editor/src/story_graph_model.h | 4 ++++ story-editor/src/story_project.cpp | 8 ++++---- story-editor/src/story_project.h | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/story-editor/src/story_graph_model.h b/story-editor/src/story_graph_model.h index 27ae391..70a3cd1 100644 --- a/story-editor/src/story_graph_model.h +++ b/story-editor/src/story_graph_model.h @@ -74,6 +74,10 @@ struct AudioCommand { std::string filename; }; +#if !defined(__PRETTY_FUNCTION__) && !defined(__GNUC__) +#define __PRETTY_FUNCTION__ __FUNCSIG__ +#endif + /** * The class implements a bare minimum required to demonstrate a model-based diff --git a/story-editor/src/story_project.cpp b/story-editor/src/story_project.cpp index 2f7e0fb..edc6984 100644 --- a/story-editor/src/story_project.cpp +++ b/story-editor/src/story_project.cpp @@ -61,12 +61,12 @@ private: void StoryProject::SaveStory(const std::vector &m_program) { - std::ofstream o(m_working_dir + std::filesystem::path::preferred_separator + "story.c32", std::ios::out | std::ios::binary); + std::ofstream o(m_working_dir / "story.c32", std::ios::out | std::ios::binary); o.write(reinterpret_cast(m_program.data()), m_program.size()); o.close(); - - Tlv tlv(m_working_dir + std::filesystem::path::preferred_separator + "index.ost"); + auto p = m_working_dir / "index.ost"; + Tlv tlv(p.string()); tlv.add_array(1); @@ -401,6 +401,6 @@ std::string StoryProject::GetProjectFilePath() const std::string StoryProject::GetWorkingDir() const { - return m_working_dir; + return m_working_dir.string(); } diff --git a/story-editor/src/story_project.h b/story-editor/src/story_project.h index 9e938e9..65b9095 100644 --- a/story-editor/src/story_project.h +++ b/story-editor/src/story_project.h @@ -127,7 +127,7 @@ private: std::string m_titleSound; std::vector m_resources; - std::string m_working_dir; /// Temporary folder based on the uuid, where the archive is unzipped + std::filesystem::path m_working_dir; /// Temporary folder based on the uuid, where the archive is unzipped std::string m_project_file_path; /// JSON project file int m_display_w{320};