diff --git a/deps/w32-pthreads/CMakeLists.txt b/deps/w32-pthreads/CMakeLists.txt index eb037ff05..b73e59e85 100644 --- a/deps/w32-pthreads/CMakeLists.txt +++ b/deps/w32-pthreads/CMakeLists.txt @@ -1,8 +1,5 @@ project(w32-pthreads) -add_definitions(-D__CLEANUP_C) -add_definitions(-DPTW32_BUILD) - set(w32-pthreads_SOURCES pthread.c) @@ -15,6 +12,10 @@ set(w32-pthreads_HEADERS add_library(w32-pthreads SHARED ${w32-pthreads_SOURCES} ${w32-pthreads_HEADERS}) +target_compile_definitions(w32-pthreads + PRIVATE __CLEANUP_C PTW32_BUILD) +target_include_directories(w32-pthreads + PUBLIC .) target_link_libraries(w32-pthreads) install_obs_core(w32-pthreads) diff --git a/deps/w32-pthreads/pthread_win32_attach_detach_np.c b/deps/w32-pthreads/pthread_win32_attach_detach_np.c index bfad45065..6f67dd95e 100644 --- a/deps/w32-pthreads/pthread_win32_attach_detach_np.c +++ b/deps/w32-pthreads/pthread_win32_attach_detach_np.c @@ -37,6 +37,8 @@ #include "pthread.h" #include "implement.h" +#include + /* * Handle to quserex.dll */ @@ -80,8 +82,8 @@ pthread_win32_process_attach_np () } #else /* strncat is secure - this is just to avoid a warning */ - if(GetSystemDirectory(QuserExDLLPathBuf, sizeof(QuserExDLLPathBuf)) && - 0 == strncat_s(QuserExDLLPathBuf, sizeof(QuserExDLLPathBuf), "\\QUSEREX.DLL", 12)) + if(GetSystemDirectory(QuserExDLLPathBuf, sizeof(QuserExDLLPathBuf) / sizeof(TCHAR)) && + 0 == _tcsncat_s(QuserExDLLPathBuf, sizeof(QuserExDLLPathBuf) / sizeof(TCHAR), TEXT("\\QUSEREX.DLL"), 12)) { ptw32_h_quserex = LoadLibrary(QuserExDLLPathBuf); }