summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/common')
-rw-r--r--src/common/CMakeLists.txt6
-rw-r--r--src/common/common_precompiled_headers.h14
-rw-r--r--src/common/precompiled_headers.h6
-rw-r--r--src/common/string_util.cpp4
4 files changed, 28 insertions, 2 deletions
diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt
index b7c15c191..a12edc584 100644
--- a/src/common/CMakeLists.txt
+++ b/src/common/CMakeLists.txt
@@ -37,6 +37,7 @@ add_library(common STATIC
37 cache_management.cpp 37 cache_management.cpp
38 cache_management.h 38 cache_management.h
39 common_funcs.h 39 common_funcs.h
40 common_precompiled_headers.h
40 common_types.h 41 common_types.h
41 concepts.h 42 concepts.h
42 div_ceil.h 43 div_ceil.h
@@ -95,6 +96,7 @@ add_library(common STATIC
95 param_package.h 96 param_package.h
96 parent_of_member.h 97 parent_of_member.h
97 point.h 98 point.h
99 precompiled_headers.h
98 quaternion.h 100 quaternion.h
99 reader_writer_queue.h 101 reader_writer_queue.h
100 ring_buffer.h 102 ring_buffer.h
@@ -183,3 +185,7 @@ else()
183 target_link_libraries(common PRIVATE 185 target_link_libraries(common PRIVATE
184 $<IF:$<TARGET_EXISTS:zstd::libzstd_shared>,zstd::libzstd_shared,zstd::libzstd_static>) 186 $<IF:$<TARGET_EXISTS:zstd::libzstd_shared>,zstd::libzstd_shared,zstd::libzstd_static>)
185endif() 187endif()
188
189if (YUZU_USE_PRECOMPILED_HEADERS)
190 target_precompile_headers(common PRIVATE precompiled_headers.h)
191endif()
diff --git a/src/common/common_precompiled_headers.h b/src/common/common_precompiled_headers.h
new file mode 100644
index 000000000..be7e5b5f9
--- /dev/null
+++ b/src/common/common_precompiled_headers.h
@@ -0,0 +1,14 @@
1// SPDX-FileCopyrightText: 2022 yuzu Emulator Project
2// SPDX-License-Identifier: GPL-2.0-or-later
3
4#pragma once
5
6#include <algorithm>
7#include <array>
8#include <chrono>
9#include <memory>
10
11#include <fmt/format.h>
12
13#include "common/assert.h"
14#include "common/common_types.h"
diff --git a/src/common/precompiled_headers.h b/src/common/precompiled_headers.h
new file mode 100644
index 000000000..aabae730b
--- /dev/null
+++ b/src/common/precompiled_headers.h
@@ -0,0 +1,6 @@
1// SPDX-FileCopyrightText: 2022 yuzu Emulator Project
2// SPDX-License-Identifier: GPL-2.0-or-later
3
4#pragma once
5
6#include "common/common_precompiled_headers.h"
diff --git a/src/common/string_util.cpp b/src/common/string_util.cpp
index 7a495bc79..b26db4796 100644
--- a/src/common/string_util.cpp
+++ b/src/common/string_util.cpp
@@ -141,7 +141,7 @@ static std::wstring CPToUTF16(u32 code_page, const std::string& input) {
141 MultiByteToWideChar(code_page, 0, input.data(), static_cast<int>(input.size()), nullptr, 0); 141 MultiByteToWideChar(code_page, 0, input.data(), static_cast<int>(input.size()), nullptr, 0);
142 142
143 if (size == 0) { 143 if (size == 0) {
144 return L""; 144 return {};
145 } 145 }
146 146
147 std::wstring output(size, L'\0'); 147 std::wstring output(size, L'\0');
@@ -158,7 +158,7 @@ std::string UTF16ToUTF8(const std::wstring& input) {
158 const auto size = WideCharToMultiByte(CP_UTF8, 0, input.data(), static_cast<int>(input.size()), 158 const auto size = WideCharToMultiByte(CP_UTF8, 0, input.data(), static_cast<int>(input.size()),
159 nullptr, 0, nullptr, nullptr); 159 nullptr, 0, nullptr, nullptr);
160 if (size == 0) { 160 if (size == 0) {
161 return ""; 161 return {};
162 } 162 }
163 163
164 std::string output(size, '\0'); 164 std::string output(size, '\0');