mirror of
https://github.com/id-Software/DOOM-3-BFG.git
synced 2025-04-24 10:38:53 +00:00
Optick: Add support for reporting runtime errors with text descriptions
(cherry picked from commit a743dfb54554a9524e47471b138e4a757e92cb6c)
This commit is contained in:
parent
62e9c561d5
commit
4e30cdce06
2 changed files with 6 additions and 4 deletions
|
@ -33,6 +33,7 @@
|
|||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdexcept>
|
||||
|
||||
#if defined(OPTICK_MSVC)
|
||||
|
||||
|
@ -143,11 +144,12 @@ static const ProcessID INVALID_PROCESS_ID = (ProcessID)-1;
|
|||
#ifdef _DEBUG
|
||||
#define OPTICK_ASSERT(arg, description) if (!(arg)) { OPTICK_DEBUG_BREAK; }
|
||||
#define OPTICK_FAILED(description) { OPTICK_DEBUG_BREAK; }
|
||||
#define OPTICK_VERIFY(arg, description, operation) if (!(arg)) { OPTICK_DEBUG_BREAK; operation; }
|
||||
#else
|
||||
#define OPTICK_ASSERT(arg, description)
|
||||
#define OPTICK_FAILED(description)
|
||||
#define OPTICK_FAILED(description) { throw std::runtime_error(description); }
|
||||
#define OPTICK_VERIFY(arg, description, operation) if (!(arg)) { OPTICK_FAILED(description); operation; }
|
||||
#endif
|
||||
#define OPTICK_VERIFY(arg, description, operation) if (!(arg)) { OPTICK_DEBUG_BREAK; operation; }
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -289,7 +289,7 @@ Server::Server(short port) : socket(Memory::New<Socket>()), saveCb(nullptr)
|
|||
{
|
||||
if (!socket->Bind(port, 4))
|
||||
{
|
||||
OPTICK_FAILED("Failed to bind a socket! Most probably the port is blocked by anti-virus! Change the port and verify that your game has enough permissions to communicate over the TCP\IP.");
|
||||
OPTICK_FAILED("Failed to bind a socket! Most probably the port is blocked by anti-virus! Change the port and verify that your game has enough permissions to communicate over the TCP/IP.");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -499,4 +499,4 @@ Server & Server::Get()
|
|||
|
||||
}
|
||||
|
||||
#endif //USE_OPTICK
|
||||
#endif //USE_OPTICK
|
||||
|
|
Loading…
Reference in a new issue