mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2025-08-18 01:15:46 +00:00
51 lines
944 B
C
51 lines
944 B
C
#pragma once
|
|
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
#include <stdint.h>
|
|
|
|
#ifdef _WIN32
|
|
#define WIN32_LEAN_AND_MEAN
|
|
#include <Windows.h>
|
|
#include <Winsock2.h>
|
|
#include <ws2tcpip.h>
|
|
#else
|
|
#include <unistd.h>
|
|
#include <pthread.h>
|
|
#include <sys/time.h>
|
|
#include <arpa/inet.h>
|
|
#endif
|
|
|
|
#ifdef _WIN32
|
|
# define LC_WINDOWS
|
|
#else
|
|
# define LC_POSIX
|
|
# if defined(__APPLE__)
|
|
# define LC_DARWIN
|
|
# endif
|
|
#endif
|
|
|
|
#include <stdio.h>
|
|
#include "Limelight.h"
|
|
#if defined(LC_WINDOWS)
|
|
extern WCHAR DbgBuf[512];
|
|
#define Limelog(s, ...) \
|
|
swprintf(DbgBuf, sizeof(DbgBuf) / sizeof(WCHAR), L ## s, ##__VA_ARGS__); \
|
|
OutputDebugStringW(DbgBuf)
|
|
#else
|
|
#define Limelog(s, ...) \
|
|
fprintf(stderr, s, ##__VA_ARGS__)
|
|
#endif
|
|
|
|
#if defined(LC_WINDOWS)
|
|
#include <crtdbg.h>
|
|
#define LC_ASSERT(x) __analysis_assume(x); \
|
|
_ASSERTE(x)
|
|
#else
|
|
#define LC_ASSERT(x)
|
|
#endif
|
|
|
|
int initializePlatform(void);
|
|
void cleanupPlatform(void);
|
|
|
|
uint64_t PltGetMillis(void); |