mirror of
https://github.com/ETLCPP/etl.git
synced 2026-04-30 19:09:10 +08:00
Added compiler #if to exclude Windows header for Linux platforms.
This commit is contained in:
parent
2926a72ea2
commit
5208751a8c
@ -27,7 +27,9 @@ SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#include <UnitTest++/UnitTest++.h>
|
||||
#if defined(PLATFORM_WINDOWS)
|
||||
#include <Windows.h>
|
||||
#endif
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
|
||||
@ -59,6 +61,7 @@ void receive_error(const etl::exception& e)
|
||||
std::ostringstream oss;
|
||||
oss << "Error '" << e.what() << "' in " << e.file_name() << " at line " << e.line_number() << "\n";
|
||||
|
||||
#if defined(PLATFORM_WINDOWS)
|
||||
std::string stext = oss.str();
|
||||
|
||||
WCHAR text[200];
|
||||
@ -66,6 +69,7 @@ void receive_error(const etl::exception& e)
|
||||
LPCWSTR ltext = text;
|
||||
|
||||
OutputDebugString(ltext);
|
||||
#endif
|
||||
}
|
||||
|
||||
//*****************************************************************************
|
||||
@ -82,6 +86,7 @@ public:
|
||||
std::ostringstream oss;
|
||||
oss << "Error '" << e.what() << "' in " << e.file_name() << " at line " << e.line_number() << "\n";
|
||||
|
||||
#if defined(PLATFORM_WINDOWS)
|
||||
std::string stext = oss.str();
|
||||
|
||||
WCHAR text[200];
|
||||
@ -89,11 +94,12 @@ public:
|
||||
LPCWSTR ltext = text;
|
||||
|
||||
OutputDebugString(ltext);
|
||||
#endif
|
||||
}
|
||||
};
|
||||
|
||||
namespace
|
||||
{
|
||||
{
|
||||
SUITE(test_error_handler)
|
||||
{
|
||||
//*************************************************************************
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user