mirror of
https://github.com/SFML/SFML.git
synced 2024-11-25 04:41:05 +08:00
Use sf::err() for error logging
This commit is contained in:
parent
06946793b4
commit
658176879a
@ -26,6 +26,7 @@
|
|||||||
// Headers
|
// Headers
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
#include <SFML/System/Unix/ThreadImpl.hpp>
|
#include <SFML/System/Unix/ThreadImpl.hpp>
|
||||||
|
#include <SFML/System/Err.hpp>
|
||||||
#include <SFML/System/Thread.hpp>
|
#include <SFML/System/Thread.hpp>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
@ -42,7 +43,7 @@ m_isActive(true)
|
|||||||
m_isActive = pthread_create(&m_thread, NULL, &ThreadImpl::entryPoint, owner) == 0;
|
m_isActive = pthread_create(&m_thread, NULL, &ThreadImpl::entryPoint, owner) == 0;
|
||||||
|
|
||||||
if (!m_isActive)
|
if (!m_isActive)
|
||||||
std::cerr << "Failed to create thread" << std::endl;
|
err() << "Failed to create thread" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
// Headers
|
// Headers
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
#include <SFML/Window/Win32/ClipboardImpl.hpp>
|
#include <SFML/Window/Win32/ClipboardImpl.hpp>
|
||||||
|
#include <SFML/System/Err.hpp>
|
||||||
#include <SFML/System/String.hpp>
|
#include <SFML/System/String.hpp>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
@ -42,13 +43,13 @@ String ClipboardImpl::getString()
|
|||||||
|
|
||||||
if (!IsClipboardFormatAvailable(CF_UNICODETEXT))
|
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;
|
return text;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!OpenClipboard(NULL))
|
if (!OpenClipboard(NULL))
|
||||||
{
|
{
|
||||||
std::cerr << "Failed to open the Win32 clipboard." << std::endl;
|
err() << "Failed to open the Win32 clipboard." << std::endl;
|
||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -56,7 +57,7 @@ String ClipboardImpl::getString()
|
|||||||
|
|
||||||
if (!clipboard_handle)
|
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();
|
CloseClipboard();
|
||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
@ -74,13 +75,13 @@ void ClipboardImpl::setString(const String& text)
|
|||||||
{
|
{
|
||||||
if (!OpenClipboard(NULL))
|
if (!OpenClipboard(NULL))
|
||||||
{
|
{
|
||||||
std::cerr << "Failed to open the Win32 clipboard." << std::endl;
|
err() << "Failed to open the Win32 clipboard." << std::endl;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!EmptyClipboard())
|
if (!EmptyClipboard())
|
||||||
{
|
{
|
||||||
std::cerr << "Failed to empty the Win32 clipboard." << std::endl;
|
err() << "Failed to empty the Win32 clipboard." << std::endl;
|
||||||
CloseClipboard();
|
CloseClipboard();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user