mirror of
https://github.com/DigitalDevices/pvr.octonet.git
synced 2023-10-10 13:36:57 +02:00
Build fixes for Windows
This commit is contained in:
parent
5f5d2965cf
commit
b80d446760
@ -28,4 +28,8 @@ set(OCTONET_SOURCES
|
||||
|
||||
build_addon(pvr.octonet OCTONET DEPLIBS)
|
||||
|
||||
if(WIN32)
|
||||
target_link_libraries(pvr.octonet wsock32 ws2_32)
|
||||
endif()
|
||||
|
||||
include(CPack)
|
||||
|
@ -6,9 +6,30 @@
|
||||
#include "client.h"
|
||||
#include <p8-platform/util/util.h>
|
||||
#include <kodi/libXBMC_addon.h>
|
||||
// #include <iostream>
|
||||
#include <cstring>
|
||||
#include <sstream>
|
||||
|
||||
#if defined(_WIN32) || defined(_WIN64)
|
||||
#define strtok_r strtok_s
|
||||
#define strncasecmp _strnicmp
|
||||
|
||||
int vasprintf(char **sptr, char *fmt, va_list argv) {
|
||||
int wanted = vsnprintf(*sptr = NULL, 0, fmt, argv);
|
||||
if((wanted < 0) || ((*sptr = (char *)malloc(1 + wanted)) == NULL))
|
||||
return -1;
|
||||
return vsprintf(*sptr, fmt, argv);
|
||||
}
|
||||
|
||||
int asprintf(char **sptr, char *fmt, ...) {
|
||||
int retval;
|
||||
va_list argv;
|
||||
va_start(argv, fmt);
|
||||
retval = vasprintf(sptr, fmt, argv);
|
||||
va_end(argv);
|
||||
return retval;
|
||||
}
|
||||
#endif
|
||||
|
||||
#define RTSP_DEFAULT_PORT 554
|
||||
#define RTSP_RECEIVE_BUFFER 2048
|
||||
#define RTP_HEADER_SIZE 12
|
||||
|
Loading…
Reference in New Issue
Block a user