Updating Xamarin/Microsoft file headers
[platform/upstream/libSkiaSharp.git] / include / xamarin / WinRTCompat.h
1 /*
2  * Copyright 2015 Xamarin Inc.
3  * Copyright 2017 Microsoft Corporation. All rights reserved.
4  *
5  * Use of this source code is governed by a BSD-style license that can be
6  * found in the LICENSE file.
7  */
8
9 #ifndef WinRTCompat_h
10 #define WinRTCompat_h
11
12 #ifdef SK_BUILD_FOR_WINRT
13
14 #include <Windows.h>
15
16 #ifdef __cplusplus
17 #define C_PLUS_PLUS_BEGIN_GUARD    extern "C" {
18 #define C_PLUS_PLUS_END_GUARD      }
19 #else
20 #include <stdbool.h>
21 #define C_PLUS_PLUS_BEGIN_GUARD
22 #define C_PLUS_PLUS_END_GUARD
23 #endif
24
25 #include <wchar.h>
26
27 C_PLUS_PLUS_BEGIN_GUARD
28
29 #ifdef _M_ARM
30
31 // This should have been not used, but as the code is designed for x86
32 // and there is a RUNTIME check for simd, this has to exist. As the
33 // runtime check will fail, and revert to a C implementation, this is 
34 // not a problem to have a stub.
35
36 // used in: deflate.c
37 unsigned int _mm_crc32_u32(unsigned int crc, unsigned int v);
38
39 #endif // _M_ARM
40
41 // used in: dng_string.cpp
42 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);
43 // used in: dng_string.cpp
44 UINT WINAPI GetACPCompat(void);
45 // used in: dng_pthread.cpp
46 HANDLE WINAPI OpenThreadCompat(_In_ DWORD dwDesiredAccess, _In_ BOOL bInheritHandle, _In_ DWORD dwThreadId);
47 // used in: dng_utils.cpp
48 DWORD  WINAPI GetTickCountCompat(VOID);
49 // used in: dng_utils.cpp
50 int WINAPI MessageBoxACompat(_In_opt_ HWND hWnd, _In_opt_ LPCSTR lpText, _In_opt_ LPCSTR lpCaption, _In_ UINT uType);
51 // used in: dng_pthread.cpp
52 DWORD WINAPI TlsAllocCompat(VOID);
53 // used in: dng_pthread.cpp
54 LPVOID WINAPI TlsGetValueCompat(_In_ DWORD dwTlsIndex);
55 // used in: dng_pthread.cpp
56 BOOL WINAPI TlsSetValueCompat(_In_ DWORD dwTlsIndex, _In_opt_ LPVOID lpTlsValue);
57 // used in: dng_pthread.cpp
58 BOOL WINAPI TlsFreeCompat(_In_ DWORD dwTlsIndex);
59 // used in: jsimd_xxx.c
60 char *getenvCompat(const char *name);
61
62 // override any previous declaration with ours
63
64 #define MessageBoxA MessageBoxACompat
65 #define CompareStringW CompareStringWCompat
66 #define GetACP GetACPCompat
67 #define OpenThread OpenThreadCompat
68 #define GetTickCount GetTickCountCompat
69 #define TlsAlloc TlsAllocCompat
70 #define TlsGetValue TlsGetValueCompat
71 #define TlsSetValue TlsSetValueCompat
72 #define TlsFree TlsFreeCompat
73 #define getenv getenvCompat
74
75 C_PLUS_PLUS_END_GUARD
76
77 #endif // SK_BUILD_FOR_WINRT
78
79 #endif // WinRTCompat_h