Commit 0b5b2969 authored by Ghislain MARY's avatar Ghislain MARY

Merge branch 'fix/fix-build-for-uwp' into 'bc'

Fix build for UWP.

See merge request !1
parents 09166bb9 3aa0c24a
......@@ -370,9 +370,8 @@ if(MSVC)
elseif(NOT APPLE)
set_target_properties(xml2 PROPERTIES LINK_FLAGS "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/libxml2.syms")
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone")
target_compile_options(xml2 PRIVATE "/FIwindowsphone_port.h")
elseif(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
target_compile_options(xml2 PRIVATE "/FIuniversal_windows_port.h")
endif()
......
......@@ -2,6 +2,8 @@
#ifndef LIBXML2_PORT_H
#define LIBXML2_PORT_H
#include <windows.h>
#define GetVersionEx(osvi) (((osvi)->dwPlatformId = 0) != 0)
#define getcwd(a, b) NULL
......
#ifndef WINDOWSPHONE_PORT_H
#define WINDOWSPHONE_PORT_H
#define CreateMutex(a, b, c) CreateMutexExW(a, c, ((b) ? CREATE_MUTEX_INITIAL_OWNER : 0), 0)
#define GetVersionEx(osvi) (((osvi)->dwPlatformId = 0) != 0)
#define InitializeCriticalSection(cs) InitializeCriticalSectionEx(cs, 0, 0)
#define WaitForSingleObject(hHandle, dwMilliseconds) WaitForSingleObjectEx(hHandle, dwMilliseconds, 0)
#define Sleep(ms) { \
HANDLE sleepEvent = CreateEventEx(NULL, NULL, CREATE_EVENT_MANUAL_RESET, EVENT_ALL_ACCESS); \
if (!sleepEvent) return; \
WaitForSingleObjectEx(sleepEvent, ms, FALSE); \
}
#endif /* WINDOWSPHONE_PORT_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment