mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2025-08-18 09:25:49 +00:00
* vita: initial port * vita: implement events, enable input thread * vita: gethostbyname * vita: Enable audio * vita: Fix thread crash on discoonect process * vita: Handle cannot create thread * vita: now use newlib's socket apis * vita: Refactoring for moonlight-stream/moonlight-common-c * Fix review things https://github.com/moonlight-stream/moonlight-common-c/pull/22#pullrequestreview-2436093 - vita may not support IPv6; so add LC_ASSERT them. - define inet_ntop to sceNetInetNtop - guard about failure of sceKernelCreateMutex or sceKernelCreateCond - remove meanless macros https://github.com/moonlight-stream/moonlight-common-c/pull/22#pullrequestreview-2444677 - !*mutex to *mutex - remove useless LC_ASSERT then change to use inet_ntop in vita system not defined `sockaddr_in6`, so just use `sockaddr_in` instead this. https://github.com/moonlight-stream/moonlight-common-c/pull/22#pullrequestreview-2445642 - define sin6_addr
71 lines
1.2 KiB
C
71 lines
1.2 KiB
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>
|
|
#elif defined(__vita__)
|
|
#include <unistd.h>
|
|
#include <sys/time.h>
|
|
#include <netinet/in.h>
|
|
#include <psp2/kernel/threadmgr.h>
|
|
#else
|
|
#include <unistd.h>
|
|
#include <pthread.h>
|
|
#include <sys/time.h>
|
|
#include <sys/ioctl.h>
|
|
#include <arpa/inet.h>
|
|
#include <netinet/in.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)
|
|
void LimelogWindows(char* Format, ...);
|
|
#define Limelog(s, ...) \
|
|
LimelogWindows(s, ##__VA_ARGS__)
|
|
#elif defined(__vita__)
|
|
#define Limelog sceClibPrintf
|
|
#else
|
|
#define Limelog(s, ...) \
|
|
fprintf(stderr, s, ##__VA_ARGS__)
|
|
#endif
|
|
|
|
#if defined(LC_WINDOWS)
|
|
#include <crtdbg.h>
|
|
#ifdef LC_DEBUG
|
|
#define LC_ASSERT(x) __analysis_assume(x); \
|
|
_ASSERTE(x)
|
|
#else
|
|
#define LC_ASSERT(x)
|
|
#endif
|
|
#else
|
|
#ifndef LC_DEBUG
|
|
#ifndef NDEBUG
|
|
#define NDEBUG
|
|
#endif
|
|
#endif
|
|
#include <assert.h>
|
|
#define LC_ASSERT(x) assert(x)
|
|
#endif
|
|
|
|
int initializePlatform(void);
|
|
void cleanupPlatform(void);
|
|
|
|
uint64_t PltGetMillis(void);
|