diff --git a/CMakeLists.txt b/CMakeLists.txt index 1ff9f5bf..70e49e33 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -169,8 +169,9 @@ if (TARGET_WEBOS) pkg_check_modules(PBNJSON_C REQUIRED pbnjson_c) pkg_check_modules(PMLOG REQUIRED PmLogLib) pkg_check_modules(WEBOSI18N REQUIRED webosi18n) +elseif (OS_WINDOWS) + set(BUILD_SHARED_CORE_LIBS OFF) else () - set(BUILD_SHARED_CORE_LIBS ON) endif () diff --git a/core/libgamestream/CMakeLists.txt b/core/libgamestream/CMakeLists.txt index f7de7f05..dc2cf3b1 100644 --- a/core/libgamestream/CMakeLists.txt +++ b/core/libgamestream/CMakeLists.txt @@ -20,6 +20,9 @@ target_link_libraries(gamestream PRIVATE ${MBEDCRYPTO_LIBRARY} ${MBEDX509_LIBRAR target_link_libraries(gamestream PUBLIC commons-logging commons-uuidstr) target_include_directories(gamestream SYSTEM PRIVATE ${MBEDTLS_INCLUDE_DIRS}) target_link_libraries(gamestream PRIVATE ${CURL_LIBRARIES} ${EXPAT_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS}) +if (WIN32) + target_link_libraries(gamestream PUBLIC ws2_32) +endif() if (BUILD_SHARED_LIBS) install(TARGETS gamestream LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) endif() diff --git a/core/libgamestream/src/client.c b/core/libgamestream/src/client.c index 8060b982..ffc73f69 100644 --- a/core/libgamestream/src/client.c +++ b/core/libgamestream/src/client.c @@ -942,6 +942,17 @@ static bool construct_url(GS_CLIENT hnd, char *url, size_t ulen, bool secure, co return true; } +#if __WIN32__ +static char *stpncpy(char *dest, const char *src, size_t n) { + size_t i; + for (i = 0; i < n && src[i] != '\0'; i++) { + dest[i] = src[i]; + } + dest[i] = '\0'; + return dest + i; +} +#endif + static bool append_param(char *url, size_t ulen, const char *param, const char *value_fmt, ...) { char value[256]; va_list ap; diff --git a/core/libgamestream/src/conf.c b/core/libgamestream/src/conf.c index 11ce8578..fa430739 100644 --- a/core/libgamestream/src/conf.c +++ b/core/libgamestream/src/conf.c @@ -24,6 +24,7 @@ #if __WIN32 #include +#include #define PATH_SEPARATOR '\\' #define MKDIR(path) mkdir(path) diff --git a/core/libgamestream/src/mkcert.c b/core/libgamestream/src/mkcert.c index 43ed1890..b3fe2f02 100644 --- a/core/libgamestream/src/mkcert.c +++ b/core/libgamestream/src/mkcert.c @@ -37,9 +37,6 @@ static const int NUM_YEARS = 10; static int mkcert_generate_impl(mbedtls_pk_context *key, mbedtls_x509write_cert *crt, mbedtls_ctr_drbg_context *rng) { int ret; - mbedtls_mpi serial; - - mbedtls_mpi_init(&serial); char buf[512]; @@ -61,8 +58,15 @@ static int mkcert_generate_impl(mbedtls_pk_context *key, mbedtls_x509write_cert mbedtls_x509write_crt_set_subject_name(crt, "CN=NVIDIA GameStream Client"); mbedtls_x509write_crt_set_issuer_name(crt, "CN=NVIDIA GameStream Client"); +#if MBEDTLS_VERSION_NUMBER >= 0x03040000 + mbedtls_x509write_crt_set_serial_raw(crt, (unsigned char *) "1", 1); +#else + mbedtls_mpi serial; + mbedtls_mpi_init(&serial); mbedtls_mpi_read_string(&serial, 10, "1"); mbedtls_x509write_crt_set_serial(crt, &serial); + mbedtls_mpi_free(&serial); +#endif mbedtls_x509write_crt_set_version(crt, MBEDTLS_X509_CRT_VERSION_2); mbedtls_x509write_crt_set_md_alg(crt, MBEDTLS_MD_SHA256); @@ -87,7 +91,6 @@ static int mkcert_generate_impl(mbedtls_pk_context *key, mbedtls_x509write_cert } finally: - mbedtls_mpi_free(&serial); return ret; } diff --git a/src/app/app.c b/src/app/app.c index 911521bf..3e23743e 100644 --- a/src/app/app.c +++ b/src/app/app.c @@ -304,9 +304,9 @@ bool app_decoder_or_embedded_present(app_t *app) { static void libs_init(app_t *app, int argc, char *argv[]) { SS4S_SetLoggingFunction(commons_ss4s_logf); - int errno; - if ((errno = SS4S_ModulesList(&app->ss4s.modules, &app->os_info)) != 0) { - commons_log_error("SS4S", "Can't load modules list: %s", strerror(errno)); + int ret; + if ((ret = SS4S_ModulesList(&app->ss4s.modules, &app->os_info)) != 0) { + commons_log_error("SS4S", "Can't load modules list: %s", strerror(ret)); } SS4S_ModulePreferences module_preferences = { .audio_module = app_configuration->audio_backend, diff --git a/src/app/stream/input/vk.h b/src/app/stream/input/vk.h index 7037f2c1..ffc76dea 100644 --- a/src/app/stream/input/vk.h +++ b/src/app/stream/input/vk.h @@ -1,5 +1,6 @@ #pragma once +#ifndef __WIN32__ enum { VK_LBUTTON = 0x01,/*Left mouse button*/ VK_RBUTTON = 0x02,/*Right mouse button*/ @@ -46,42 +47,6 @@ enum { VK_INSERT = 0x2D,/*INS key*/ VK_DELETE = 0x2E,/*DEL key*/ VK_HELP = 0x2F,/*HELP key*/ - VK_0 = 0x30,/*0 key*/ - VK_1 = 0x31,/*1 key*/ - VK_2 = 0x32,/*2 key*/ - VK_3 = 0x33,/*3 key*/ - VK_4 = 0x34,/*4 key*/ - VK_5 = 0x35,/*5 key*/ - VK_6 = 0x36,/*6 key*/ - VK_7 = 0x37,/*7 key*/ - VK_8 = 0x38,/*8 key*/ - VK_9 = 0x39,/*9 key*/ - VK_A = 0x41,/*A key*/ - VK_B = 0x42,/*B key*/ - VK_C = 0x43,/*C key*/ - VK_D = 0x44,/*D key*/ - VK_E = 0x45,/*E key*/ - VK_F = 0x46,/*F key*/ - VK_G = 0x47,/*G key*/ - VK_H = 0x48,/*H key*/ - VK_I = 0x49,/*I key*/ - VK_J = 0x4A,/*J key*/ - VK_K = 0x4B,/*K key*/ - VK_L = 0x4C,/*L key*/ - VK_M = 0x4D,/*M key*/ - VK_N = 0x4E,/*N key*/ - VK_O = 0x4F,/*O key*/ - VK_P = 0x50,/*P key*/ - VK_Q = 0x51,/*Q key*/ - VK_R = 0x52,/*R key*/ - VK_S = 0x53,/*S key*/ - VK_T = 0x54,/*T key*/ - VK_U = 0x55,/*U key*/ - VK_V = 0x56,/*V key*/ - VK_W = 0x57,/*W key*/ - VK_X = 0x58,/*X key*/ - VK_Y = 0x59,/*Y key*/ - VK_Z = 0x5A,/*Z key*/ VK_LWIN = 0x5B,/*Left Windows key (Natural keyboard)*/ VK_RWIN = 0x5C,/*Right Windows key (Natural keyboard)*/ VK_APPS = 0x5D,/*Applications key (Natural keyboard)*/ @@ -176,4 +141,13 @@ enum { VK_NONAME = 0xFC,/*Reserved*/ VK_PA1 = 0xFD,/*PA1 key*/ VK_OEM_CLEAR = 0xFE,/*Clear key*/ +}; +#else + +#include "winuser.h" + +#endif +enum { + VK_0 = '0', + VK_A = 'A', }; \ No newline at end of file diff --git a/third_party/commons b/third_party/commons index 3a22070c..f776af2d 160000 --- a/third_party/commons +++ b/third_party/commons @@ -1 +1 @@ -Subproject commit 3a22070ce74b35119f892751d4cd4eb5b2289e02 +Subproject commit f776af2d97af2369da592beb44d0f514fbeafd18 diff --git a/third_party/ss4s b/third_party/ss4s index 03ad710b..f7ea9a99 160000 --- a/third_party/ss4s +++ b/third_party/ss4s @@ -1 +1 @@ -Subproject commit 03ad710b9033aa21f83e3c34d6437f11a39bf803 +Subproject commit f7ea9a990c2e70f707ea3c317d8d6adf2ce9980e