forked from microsoft/cppwinrt
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbase_version.h
More file actions
37 lines (31 loc) · 941 Bytes
/
base_version.h
File metadata and controls
37 lines (31 loc) · 941 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// WINRT_version is used by Microsoft to analyze C++/WinRT library adoption and inform future product decisions.
extern "C"
__declspec(selectany)
char const * const WINRT_version = "C++/WinRT version:" CPPWINRT_VERSION;
#if defined(_MSC_VER)
#ifdef _M_IX86
#pragma comment(linker, "/include:_WINRT_version")
#else
#pragma comment(linker, "/include:WINRT_version")
#endif
#pragma detect_mismatch("C++/WinRT version", CPPWINRT_VERSION)
#endif
WINRT_EXPORT namespace winrt
{
template <size_t BaseSize, size_t ComponentSize>
constexpr bool check_version(char const(&base)[BaseSize], char const(&component)[ComponentSize]) noexcept
{
if constexpr (BaseSize != ComponentSize)
{
return false;
}
for (size_t i = 0; i != BaseSize - 1; ++i)
{
if (base[i] != component[i])
{
return false;
}
}
return true;
}
}