Add vita environment (#22)

* 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
This commit is contained in:
Sunguk Lee
2016-10-06 08:43:33 +09:00
committed by Cameron Gutman
parent 293c6a7274
commit ba27e97698
7 changed files with 140 additions and 6 deletions

View File

@@ -9,6 +9,11 @@
#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>
@@ -34,6 +39,8 @@
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__)