From 658176879a5bb54a406e8fc08ebfefc3559ee10c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20D=C3=BCrrenberger?= Date: Sat, 25 May 2024 00:34:44 +0200 Subject: [PATCH] Use sf::err() for error logging --- src/SFML/System/Unix/ThreadImpl.cpp | 3 ++- src/SFML/Window/Win32/ClipboardImpl.cpp | 11 ++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/SFML/System/Unix/ThreadImpl.cpp b/src/SFML/System/Unix/ThreadImpl.cpp index e3daf7fbb..a9beca7f0 100644 --- a/src/SFML/System/Unix/ThreadImpl.cpp +++ b/src/SFML/System/Unix/ThreadImpl.cpp @@ -26,6 +26,7 @@ // Headers //////////////////////////////////////////////////////////// #include +#include #include #include #include @@ -42,7 +43,7 @@ m_isActive(true) m_isActive = pthread_create(&m_thread, NULL, &ThreadImpl::entryPoint, owner) == 0; if (!m_isActive) - std::cerr << "Failed to create thread" << std::endl; + err() << "Failed to create thread" << std::endl; } diff --git a/src/SFML/Window/Win32/ClipboardImpl.cpp b/src/SFML/Window/Win32/ClipboardImpl.cpp index 1ad613abc..342bb2d38 100644 --- a/src/SFML/Window/Win32/ClipboardImpl.cpp +++ b/src/SFML/Window/Win32/ClipboardImpl.cpp @@ -26,6 +26,7 @@ // Headers //////////////////////////////////////////////////////////// #include +#include #include #include #include @@ -42,13 +43,13 @@ String ClipboardImpl::getString() if (!IsClipboardFormatAvailable(CF_UNICODETEXT)) { - std::cerr << "Failed to get the clipboard data in Unicode format." << std::endl; + err() << "Failed to get the clipboard data in Unicode format." << std::endl; return text; } if (!OpenClipboard(NULL)) { - std::cerr << "Failed to open the Win32 clipboard." << std::endl; + err() << "Failed to open the Win32 clipboard." << std::endl; return text; } @@ -56,7 +57,7 @@ String ClipboardImpl::getString() if (!clipboard_handle) { - std::cerr << "Failed to get Win32 handle for clipboard content." << std::endl; + err() << "Failed to get Win32 handle for clipboard content." << std::endl; CloseClipboard(); return text; } @@ -74,13 +75,13 @@ void ClipboardImpl::setString(const String& text) { if (!OpenClipboard(NULL)) { - std::cerr << "Failed to open the Win32 clipboard." << std::endl; + err() << "Failed to open the Win32 clipboard." << std::endl; return; } if (!EmptyClipboard()) { - std::cerr << "Failed to empty the Win32 clipboard." << std::endl; + err() << "Failed to empty the Win32 clipboard." << std::endl; CloseClipboard(); return; }