common: Move error handling to error.cpp/h

This allows us to avoid implicitly including <string> every time common_funcs.h is included.
This commit is contained in:
Morph 2021-09-08 14:36:20 -04:00
parent be4e192903
commit 290afc00d3
6 changed files with 34 additions and 18 deletions

21
src/common/error.h Normal file
View file

@ -0,0 +1,21 @@
// Copyright 2013 Dolphin Emulator Project / 2014 Citra Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#pragma once
#include <string>
namespace Common {
// Generic function to get last error message.
// Call directly after the command or use the error num.
// This function might change the error code.
// Defined in error.cpp.
[[nodiscard]] std::string GetLastErrorMsg();
// Like GetLastErrorMsg(), but passing an explicit error code.
// Defined in error.cpp.
[[nodiscard]] std::string NativeErrorToString(int e);
} // namespace Common