diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2018-12-25 19:27:19 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2018-12-25 19:27:19 +0100 |
commit | 66685c866a34cee8016599d80565a13192740f02 (patch) | |
tree | bf6b623ac673adc66948c5b44b694364c75a3f80 | |
parent | 7509b983edb4b95b38089a89305e1d1e988da09b (diff) |
fix build
-rw-r--r-- | compat/shm.cpp | 26 | ||||
-rw-r--r-- | compat/shm.hpp | 2 | ||||
-rw-r--r-- | proto-wine/opentrack-wrapper-wine-main.cxx | 6 | ||||
-rw-r--r-- | proto-wine/opentrack-wrapper-wine-windows.cxx | 4 |
4 files changed, 27 insertions, 11 deletions
diff --git a/compat/shm.cpp b/compat/shm.cpp index ce01de2a..265d8ff8 100644 --- a/compat/shm.cpp +++ b/compat/shm.cpp @@ -13,15 +13,29 @@ SHMXX_TYPE_NAME& SHMXX_TYPE_NAME::operator=(SHMXX_TYPE_NAME&&) noexcept = defaul // NOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init) SHMXX_TYPE_NAME::SHMXX_TYPE_NAME(const char* shm_name, const char* mutex_name, int map_size) { - shm_mem_impl_init(&impl, shm_name, mutex_name, map_size); + SHM_FUN_NAME(init)(&impl, shm_name, mutex_name, map_size); } SHMXX_TYPE_NAME::~SHMXX_TYPE_NAME() { - shm_mem_impl_free(&impl); + SHM_FUN_NAME(free)(&impl); } -bool SHMXX_TYPE_NAME::success() noexcept { return shm_mem_impl_success(&impl); } -void SHMXX_TYPE_NAME::lock() noexcept { shm_mem_impl_lock(&impl); } -void SHMXX_TYPE_NAME::unlock() noexcept { shm_mem_impl_unlock(&impl); } -void* SHMXX_TYPE_NAME::ptr() noexcept { return shm_mem_impl_ptr(&impl); } +bool SHMXX_TYPE_NAME::success() noexcept +{ + return SHM_FUN_NAME(success)(&impl); +} +void SHMXX_TYPE_NAME::lock() noexcept +{ + SHM_FUN_NAME(lock)(&impl); +} + +void SHMXX_TYPE_NAME::unlock() noexcept +{ + SHM_FUN_NAME(unlock)(&impl); +} + +void* SHMXX_TYPE_NAME::ptr() noexcept +{ + return SHM_FUN_NAME(ptr)(&impl); +} diff --git a/compat/shm.hpp b/compat/shm.hpp index a8e0965b..428764e4 100644 --- a/compat/shm.hpp +++ b/compat/shm.hpp @@ -16,7 +16,7 @@ class OTR_COMPAT_EXPORT SHMXX_TYPE_NAME final { - shm_mem_impl impl; + SHM_TYPE_NAME impl; public: SHMXX_TYPE_NAME(const char* shm_name, const char* mutex_name, int map_size); diff --git a/proto-wine/opentrack-wrapper-wine-main.cxx b/proto-wine/opentrack-wrapper-wine-main.cxx index 491cc917..84ef57ab 100644 --- a/proto-wine/opentrack-wrapper-wine-main.cxx +++ b/proto-wine/opentrack-wrapper-wine-main.cxx @@ -30,7 +30,7 @@ enum Axis { #define SHM_TYPE_NAME shm_impl_unix #define SHM_FUN_PREFIX shm_impl_unix_ #define SHMXX_TYPE_NAME mem_unix -#define SHM_WIN32_INIT +#define SHM_WIN32_INIT 0 #include "compat/shm.hpp" void create_registry_key(void); @@ -56,7 +56,7 @@ int main(void) while (!mem_unix.stop) { - MEMBAR(); + COMPILER_BARRIER(); data.Yaw = -mem_unix.data[Yaw]; data.Pitch = -mem_unix.data[Pitch]; data.Roll = mem_unix.data[Roll]; @@ -68,7 +68,7 @@ int main(void) mem_unix.gameid = mem_wine.GameID; for (int i = 0; i < 8; i++) mem_wine.table[i] = mem_wine.table[i]; - MEMBAR(); + COMPILER_BARRIER(); (void)usleep(4 * 1000); } } diff --git a/proto-wine/opentrack-wrapper-wine-windows.cxx b/proto-wine/opentrack-wrapper-wine-windows.cxx index a18900c3..063e35df 100644 --- a/proto-wine/opentrack-wrapper-wine-windows.cxx +++ b/proto-wine/opentrack-wrapper-wine-windows.cxx @@ -9,9 +9,11 @@ #include "wine-shm.h" #include "compat/library-path.hpp" + #include <cstring> -using std::strcat; +#include <windows.h> +#include <winreg.h> static void write_path(const char* key, const char* subkey) { |