emscripten compiler fixes

mangohud-subproject
FlightlessMango 8 months ago
parent 8da7e06b44
commit 3a4a62369c

@ -10,6 +10,7 @@
#include <stdio.h>
#include <stdbool.h>
#include <sys/types.h>
#ifdef _MSC_VER
#include <BaseTsd.h>
typedef SSIZE_T ssize_t;

@ -50,6 +50,8 @@
# include <errno.h>
#elif DETECT_OS_WINDOWS
# include <windows.h>
#elif __EMSCRIPTEN__
#else
# error Unsupported OS
#endif
@ -93,6 +95,8 @@ os_time_get_nano(void)
/ frequency.QuadPart;
return secs*INT64_C(1000000000) + nanosecs;
#elif __EMSCRIPTEN__
return 0;
#else
#error Unsupported OS
@ -120,6 +124,8 @@ os_time_sleep(int64_t usecs)
if (dwMilliseconds) {
Sleep(dwMilliseconds);
}
#elif __EMSCRIPTEN__
#else
# error Unsupported OS
#endif

@ -67,7 +67,6 @@ if is_unixy or cpp.get_id() == 'emscripten'
'memory.cpp',
'iostats.cpp',
'elfhacks.cpp',
'real_dlsym.cpp',
'pci_ids.cpp',
'battery.cpp',
'control.cpp',
@ -76,6 +75,10 @@ if is_unixy or cpp.get_id() == 'emscripten'
'intel.cpp'
)
if cpp.get_id() != 'emscripten'
vklayer_files += 'real_dlsym.cpp'
endif
if get_option('with_notify').enabled()
vklayer_files += 'notify.cpp'
endif

@ -97,9 +97,11 @@ static int
parse_control(const char *str)
{
std::string path(str);
#ifndef __EMSCRIPTEN__
size_t npos = path.find("%p");
if (npos != std::string::npos)
path.replace(npos, 2, std::to_string(getpid()));
#endif
SPDLOG_DEBUG("Socket: {}", path);
int ret = os_socket_listen_abstract(path.c_str(), 1);

Loading…
Cancel
Save