2 * Copyright 2015 Xamarin Inc.
3 * Copyright 2017 Microsoft Corporation. All rights reserved.
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
9 #include "WinRTCompat.h"
11 #ifdef SK_BUILD_FOR_WINRT
17 unsigned int _mm_crc32_u32(unsigned int crc, unsigned int v)
24 DWORD WINAPI TlsAllocCompat(VOID)
26 return ::FlsAlloc(NULL);
29 LPVOID WINAPI TlsGetValueCompat(_In_ DWORD dwTlsIndex)
31 return ::FlsGetValue(dwTlsIndex);
34 BOOL WINAPI TlsSetValueCompat(_In_ DWORD dwTlsIndex, _In_opt_ LPVOID lpTlsValue)
36 return ::FlsSetValue(dwTlsIndex, lpTlsValue);
39 BOOL WINAPI TlsFreeCompat(_In_ DWORD dwTlsIndex)
41 return ::FlsFree(dwTlsIndex);
44 char *getenvCompat(const char *name)
46 // there is no environment in WinRT
50 int WINAPI CompareStringWCompat(_In_ LCID Locale, _In_ DWORD dwCmpFlags, _In_NLS_string_(cchCount1) PCNZWCH lpString1, _In_ int cchCount1, _In_NLS_string_(cchCount2) PCNZWCH lpString2, _In_ int cchCount2)
52 WCHAR localeName[LOCALE_NAME_MAX_LENGTH];
53 LCIDToLocaleName(Locale, localeName, LOCALE_NAME_MAX_LENGTH, 0);
54 return CompareStringEx(localeName, dwCmpFlags, lpString1, cchCount1, lpString2, cchCount2, NULL, NULL, NULL);
57 UINT WINAPI GetACPCompat(void)
62 HANDLE WINAPI OpenThreadCompat(_In_ DWORD dwDesiredAccess, _In_ BOOL bInheritHandle, _In_ DWORD dwThreadId)
64 // TODO: implementation
68 DWORD WINAPI GetTickCountCompat(VOID)
70 return (long)GetTickCount64();
73 int WINAPI MessageBoxACompat(_In_opt_ HWND hWnd, _In_opt_ LPCSTR lpText, _In_opt_ LPCSTR lpCaption, _In_ UINT uType)
75 // TODO: implementation
79 #endif // SK_BUILD_FOR_WINRT