mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2025-08-18 09:25:49 +00:00
Fix build errors and warnings on Windows
This commit is contained in:
parent
678afd9c30
commit
97a499fc50
@ -210,7 +210,7 @@ int PltCreateThread(ThreadEntry entry, void* context, PLT_THREAD *thread) {
|
|||||||
PltUnlockMutex(&thread_list_lock);
|
PltUnlockMutex(&thread_list_lock);
|
||||||
|
|
||||||
// Make a callback to managed code to ask for a thread to grab this
|
// Make a callback to managed code to ask for a thread to grab this
|
||||||
platformCallbacks.threadStart();
|
PlatformCallbacks.threadStart();
|
||||||
|
|
||||||
err = 0;
|
err = 0;
|
||||||
}
|
}
|
||||||
|
@ -17,11 +17,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
# if WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP
|
|
||||||
# define LC_WINDOWS_PHONE
|
|
||||||
# elif WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP
|
|
||||||
# define LC_WINDOWS
|
# define LC_WINDOWS
|
||||||
# endif
|
|
||||||
#else
|
#else
|
||||||
# define LC_POSIX
|
# define LC_POSIX
|
||||||
# if defined(__APPLE__)
|
# if defined(__APPLE__)
|
||||||
@ -33,10 +29,10 @@
|
|||||||
#include "Limelight.h"
|
#include "Limelight.h"
|
||||||
#if defined(LC_WINDOWS_PHONE) || defined(LC_WINDOWS)
|
#if defined(LC_WINDOWS_PHONE) || defined(LC_WINDOWS)
|
||||||
extern char DbgBuf[512];
|
extern char DbgBuf[512];
|
||||||
extern PLATFORM_CALLBACKS platformCallbacks;
|
extern PLATFORM_CALLBACKS PlatformCallbacks;
|
||||||
#define Limelog(s, ...) \
|
#define Limelog(s, ...) \
|
||||||
sprintf(DbgBuf, s, ##__VA_ARGS__); \
|
sprintf(DbgBuf, s, ##__VA_ARGS__); \
|
||||||
platformCallbacks.debugPrint(DbgBuf)
|
PlatformCallbacks.debugPrint(DbgBuf)
|
||||||
#else
|
#else
|
||||||
#define Limelog(s, ...) \
|
#define Limelog(s, ...) \
|
||||||
fprintf(stderr, s, ##__VA_ARGS__)
|
fprintf(stderr, s, ##__VA_ARGS__)
|
||||||
|
@ -3,8 +3,9 @@
|
|||||||
|
|
||||||
void addrToUrlSafeString(struct sockaddr_storage *addr, char* string)
|
void addrToUrlSafeString(struct sockaddr_storage *addr, char* string)
|
||||||
{
|
{
|
||||||
if (addr->ss_family == AF_INET6) {
|
|
||||||
char addrstr[INET6_ADDRSTRLEN];
|
char addrstr[INET6_ADDRSTRLEN];
|
||||||
|
|
||||||
|
if (addr->ss_family == AF_INET6) {
|
||||||
struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)addr;
|
struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)addr;
|
||||||
inet_ntop(addr->ss_family, &sin6->sin6_addr, addrstr, sizeof(addrstr));
|
inet_ntop(addr->ss_family, &sin6->sin6_addr, addrstr, sizeof(addrstr));
|
||||||
|
|
||||||
@ -13,7 +14,7 @@ void addrToUrlSafeString(struct sockaddr_storage *addr, char* string)
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
struct sockaddr_in *sin = (struct sockaddr_in *)addr;
|
struct sockaddr_in *sin = (struct sockaddr_in *)addr;
|
||||||
char *addrstr = inet_ntoa(sin->sin_addr);
|
inet_ntop(addr->ss_family, &sin->sin_addr, addrstr, sizeof(addrstr));
|
||||||
|
|
||||||
// IPv4 addresses are returned without changes
|
// IPv4 addresses are returned without changes
|
||||||
sprintf(string, "%s", addrstr);
|
sprintf(string, "%s", addrstr);
|
||||||
|
@ -15,7 +15,7 @@ static int getMessageLength(PRTSP_MESSAGE msg){
|
|||||||
POPTION_ITEM current;
|
POPTION_ITEM current;
|
||||||
|
|
||||||
/* Initialize to 1 for null terminator */
|
/* Initialize to 1 for null terminator */
|
||||||
int count = 1;
|
size_t count = 1;
|
||||||
/* Add the length of the protocol */
|
/* Add the length of the protocol */
|
||||||
count += strlen(msg->protocol);
|
count += strlen(msg->protocol);
|
||||||
|
|
||||||
@ -50,7 +50,7 @@ static int getMessageLength(PRTSP_MESSAGE msg){
|
|||||||
/* Add the length of the payload, if any */
|
/* Add the length of the payload, if any */
|
||||||
count += msg->payloadLength;
|
count += msg->payloadLength;
|
||||||
|
|
||||||
return count;
|
return (int)count;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Given an RTSP message string rtspMessage, parse it into an RTSP_MESSAGE struct msg */
|
/* Given an RTSP message string rtspMessage, parse it into an RTSP_MESSAGE struct msg */
|
||||||
|
@ -25,7 +25,7 @@ static void freeAttributeList(PSDP_OPTION head) {
|
|||||||
/* Get the size of the attribute list */
|
/* Get the size of the attribute list */
|
||||||
static int getSerializedAttributeListSize(PSDP_OPTION head) {
|
static int getSerializedAttributeListSize(PSDP_OPTION head) {
|
||||||
PSDP_OPTION currentEntry = head;
|
PSDP_OPTION currentEntry = head;
|
||||||
int size = 0;
|
size_t size = 0;
|
||||||
while (currentEntry != NULL) {
|
while (currentEntry != NULL) {
|
||||||
size += strlen("a=");
|
size += strlen("a=");
|
||||||
size += strlen(currentEntry->name);
|
size += strlen(currentEntry->name);
|
||||||
@ -35,7 +35,7 @@ static int getSerializedAttributeListSize(PSDP_OPTION head) {
|
|||||||
|
|
||||||
currentEntry = currentEntry->next;
|
currentEntry = currentEntry->next;
|
||||||
}
|
}
|
||||||
return size;
|
return (int)size;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Populate the serialized attribute list into a string */
|
/* Populate the serialized attribute list into a string */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user