mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2025-08-18 01:15:46 +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" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Enable this definition during debugging to enable assertions
|
||||||
|
//#define LC_DEBUG
|
||||||
|
|
||||||
typedef struct _STREAM_CONFIGURATION {
|
typedef struct _STREAM_CONFIGURATION {
|
||||||
// Dimensions in pixels of the desired video stream
|
// Dimensions in pixels of the desired video stream
|
||||||
int width;
|
int width;
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "Limelight.h"
|
#include "Limelight.h"
|
||||||
|
|
||||||
#if defined(LC_WINDOWS)
|
#if defined(LC_WINDOWS)
|
||||||
extern WCHAR DbgBuf[512];
|
extern WCHAR DbgBuf[512];
|
||||||
#define Limelog(s, ...) \
|
#define Limelog(s, ...) \
|
||||||
@ -38,14 +39,22 @@ extern WCHAR DbgBuf[512];
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(LC_WINDOWS)
|
#if defined(LC_WINDOWS)
|
||||||
#include <crtdbg.h>
|
#include <crtdbg.h>
|
||||||
#define LC_ASSERT(x) __analysis_assume(x); \
|
#ifdef LC_DEBUG
|
||||||
_ASSERTE(x)
|
#define LC_ASSERT(x) __analysis_assume(x); \
|
||||||
|
_ASSERTE(x)
|
||||||
|
#else
|
||||||
|
#define LC_ASSERT(x)
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
#define LC_ASSERT(x)
|
#ifndef LC_DEBUG
|
||||||
|
#define NDEBUG
|
||||||
|
#endif
|
||||||
|
#include <assert.h>
|
||||||
|
#define LC_ASSERT(x) assert(x)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int initializePlatform(void);
|
int initializePlatform(void);
|
||||||
void cleanupPlatform(void);
|
void cleanupPlatform(void);
|
||||||
|
|
||||||
uint64_t PltGetMillis(void);
|
uint64_t PltGetMillis(void);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user