mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2025-08-17 17:05:50 +00:00
Add assert support for *NIX platforms. Asserts are now disabled by default. Define LC_DEBUG to enable them.
This commit is contained in:
parent
cc9614645c
commit
109e3ca537
@ -8,6 +8,9 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// Enable this definition during debugging to enable assertions
|
||||
//#define LC_DEBUG
|
||||
|
||||
typedef struct _STREAM_CONFIGURATION {
|
||||
// Dimensions in pixels of the desired video stream
|
||||
int width;
|
||||
|
@ -27,6 +27,7 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include "Limelight.h"
|
||||
|
||||
#if defined(LC_WINDOWS)
|
||||
extern WCHAR DbgBuf[512];
|
||||
#define Limelog(s, ...) \
|
||||
@ -38,14 +39,22 @@ extern WCHAR DbgBuf[512];
|
||||
#endif
|
||||
|
||||
#if defined(LC_WINDOWS)
|
||||
#include <crtdbg.h>
|
||||
#define LC_ASSERT(x) __analysis_assume(x); \
|
||||
_ASSERTE(x)
|
||||
#include <crtdbg.h>
|
||||
#ifdef LC_DEBUG
|
||||
#define LC_ASSERT(x) __analysis_assume(x); \
|
||||
_ASSERTE(x)
|
||||
#else
|
||||
#define LC_ASSERT(x)
|
||||
#endif
|
||||
#else
|
||||
#define LC_ASSERT(x)
|
||||
#ifndef LC_DEBUG
|
||||
#define NDEBUG
|
||||
#endif
|
||||
#include <assert.h>
|
||||
#define LC_ASSERT(x) assert(x)
|
||||
#endif
|
||||
|
||||
int initializePlatform(void);
|
||||
void cleanupPlatform(void);
|
||||
|
||||
uint64_t PltGetMillis(void);
|
||||
uint64_t PltGetMillis(void);
|
||||
|
Loading…
x
Reference in New Issue
Block a user