mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-03-02 04:29:14 +01:00
[util] Use cdecl calling convention for __wine_dbg_output
This matches wine's definition, fixes crashes when wine is built with clang. Since __cdecl isn't defined for non-windows targets ifdef this needs all dbg callback uses to be ifdefed out.
This commit is contained in:
parent
daccde7643
commit
9077e5212d
@ -77,10 +77,14 @@ namespace dxvk {
|
|||||||
std::string adjusted = outstream.str();
|
std::string adjusted = outstream.str();
|
||||||
|
|
||||||
if (!adjusted.empty()) {
|
if (!adjusted.empty()) {
|
||||||
|
#ifdef _WIN32
|
||||||
if (m_wineLogOutput)
|
if (m_wineLogOutput)
|
||||||
m_wineLogOutput(adjusted.c_str());
|
m_wineLogOutput(adjusted.c_str());
|
||||||
else
|
else
|
||||||
std::cerr << adjusted;
|
std::cerr << adjusted;
|
||||||
|
#else
|
||||||
|
std::cerr << adjusted;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_fileStream)
|
if (m_fileStream)
|
||||||
@ -96,9 +100,11 @@ namespace dxvk {
|
|||||||
if (path == "none")
|
if (path == "none")
|
||||||
return std::string();
|
return std::string();
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
// Don't create a log file if we're writing to wine's console output
|
// Don't create a log file if we're writing to wine's console output
|
||||||
if (path.empty() && m_wineLogOutput)
|
if (path.empty() && m_wineLogOutput)
|
||||||
return std::string();
|
return std::string();
|
||||||
|
#endif
|
||||||
|
|
||||||
if (!path.empty() && *path.rbegin() != '/')
|
if (!path.empty() && *path.rbegin() != '/')
|
||||||
path += '/';
|
path += '/';
|
||||||
|
@ -18,7 +18,9 @@ namespace dxvk {
|
|||||||
None = 5,
|
None = 5,
|
||||||
};
|
};
|
||||||
|
|
||||||
using PFN_wineLogOutput = int (STDMETHODCALLTYPE *)(const char *);
|
#ifdef _WIN32
|
||||||
|
using PFN_wineLogOutput = int (__cdecl *)(const char *);
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Logger
|
* \brief Logger
|
||||||
@ -55,7 +57,9 @@ namespace dxvk {
|
|||||||
std::ofstream m_fileStream;
|
std::ofstream m_fileStream;
|
||||||
|
|
||||||
bool m_initialized = false;
|
bool m_initialized = false;
|
||||||
|
#ifdef _WIN32
|
||||||
PFN_wineLogOutput m_wineLogOutput = nullptr;
|
PFN_wineLogOutput m_wineLogOutput = nullptr;
|
||||||
|
#endif
|
||||||
|
|
||||||
void emitMsg(LogLevel level, const std::string& message);
|
void emitMsg(LogLevel level, const std::string& message);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user