Merged PR 817004: Mac OS X clang compiler support

What's done:
* Cleaned-up all clang compiler warnings during library build
* PAL Device ID GUID
* PAL appId

Further TODO:
* BVT for Mac
* Verify all header-only APIs for warnings
* Guidance on custom HTTP provider - Edge team should handle this
* Possibly use our own sqlite3 instead of OS, as very old OS X dyn sqlite3 might be too old

Related work items: #1470816
This commit is contained in:
Max Golovanov 2018-11-07 06:39:27 +00:00
Родитель 4a17e7ba00
Коммит fff773d6b1
86 изменённых файлов: 1963 добавлений и 4516 удалений

1
.gitignore поставляемый
Просмотреть файл

@ -103,3 +103,4 @@ wrappers/go/offlinestorage.db.session64
/tests/ecs/node_modules
*.ipch
/Solutions/Testing/Temporary
/Default/

Просмотреть файл

@ -11,11 +11,17 @@ set(INSTALL_INC_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE PATH "Installation d
#set(CMAKE_CXX_FLAGS -m32)
# End of i386 build
if (NOT TARGET_ARCH)
set(TARGET_ARCH ${CMAKE_SYSTEM_PROCESSOR})
endif()
message("-- CMAKE_SYSTEM_INFO_FILE: ${CMAKE_SYSTEM_INFO_FILE}")
message("-- CMAKE_SYSTEM_NAME: ${CMAKE_SYSTEM_NAME}")
message("-- CMAKE_SYSTEM_PROCESSOR: ${CMAKE_SYSTEM_PROCESSOR}")
message("-- CMAKE_SYSTEM: ${CMAKE_SYSTEM}")
message("-- CMAKE_SYSTEM_VERSION: ${CMAKE_SYSTEM_VERSION}")
message("-- CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
message("-- TARGET_ARCH: ${TARGET_ARCH}")
include(tools/ParseOsRelease.cmake)
@ -26,12 +32,12 @@ set(DBG_FLAGS "-ggdb -gdwarf-2 -O0 -fno-builtin-malloc -fno-builtin-calloc -fno-
if (CMAKE_BUILD_TYPE STREQUAL "Release")
#TODO: -fno-rtti
message("-- Building Release ...")
message("Building Release ...")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11 ${REL_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 ${REL_FLAGS}")
else()
set(USE_TCMALLOC 1)
message("-- Building Debug ...")
message("Building Debug ...")
include(tools/FindTcmalloc.cmake)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11 ${DEB_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 ${DEB_FLAGS}")
@ -40,23 +46,17 @@ endif()
include(tools/Utils.cmake)
# Stand-alone or Skype (dev_buildtools etc.) build
if (NOT DEFAULT_PAL_IMPLEMENTATION)
# Linux, Mac OS X, MinGW, etc.
set(DEFAULT_PAL_IMPLEMENTATION CPP11)
endif()
# Linux
set(DEFAULT_PAL_IMPLEMENTATION CPP11)
set(SYSROOT ${CMAKE_SOURCE_DIR}/sysroot)
# User options
option(BUILD_HEADERS "Build API headers" YES)
option(BUILD_LIBRARY "Build library" YES)
option(BUILD_TEST_TOOL "Build console test tool" YES)
option(BUILD_UNIT_TESTS "Build unit tests" NO)
option(BUILD_FUNC_TESTS "Build functional tests" NO)
option(BUILD_JNI_WRAPPER "Build JNI wrapper" NO)
option(BUILD_PACKAGE "Build package" YES)
# TODO: [MG] - remove. No longer needed - legacy stuff from Skype.
#set(SYSROOT ${CMAKE_SOURCE_DIR}/sysroot)
set(PAL_IMPLEMENTATION ${DEFAULT_PAL_IMPLEMENTATION})
message(STATUS "PAL implementation: ${PAL_IMPLEMENTATION}")
message(STATUS "-- PAL implementation: ${PAL_IMPLEMENTATION}")
string(TOUPPER ${PAL_IMPLEMENTATION} PAL_IMPLEMENTATION_UPPER)
add_definitions(-DARIASDK_PAL_${PAL_IMPLEMENTATION_UPPER}=1)
@ -65,9 +65,11 @@ if(GCC5_CXX11_ABI_WORKAROUND)
add_definitions(-D_GLIBCXX_USE_CXX11_ABI=0)
endif()
# Build version
set(SDK_VERSION_PREFIX "ACT")
message(STATUS "SDK version prefix: ${SDK_VERSION_PREFIX}")
################################################################################################
# Build prefix and version
################################################################################################
set(SDK_VERSION_PREFIX "EVT")
add_definitions("-DARIASDK_VERSION_PREFIX=\"${SDK_VERSION_PREFIX}\"")
set(ARIASDK_API_VERSION "3.0")
@ -84,19 +86,36 @@ if(DEFINED BUILD_VERSION AND NOT BUILD_VERSION STREQUAL "0.0.0.0")
set(ARIASDK_BUILD_VERSION ${BUILD_VERSION})
else()
set(ARIASDK_BUILD_VERSION ${ARIASDK_API_VERSION}.${DAYNUMBER}.0)
message(STATUS "Build Version ${ARIASDK_BUILD_VERSION}")
endif()
message(STATUS "-- SDK version: ${SDK_VERSION_PREFIX}-${ARIASDK_BUILD_VERSION}")
include(FindCURL)
find_package(CURL REQUIRED)
if (NOT CURL_FOUND)
message (FATAL_ERROR "libcurl not found! Have you installed deps?")
endif (NOT CURL_FOUND)
################################################################################################
# HTTP stack section
################################################################################################
include_directories(CURL_INCLUDE_DIRS)
set(CMAKE_REQUIRED_LIBRARIES "${CURL_LIBRARIES}")
list(APPEND LIBS "${CURL_LIBRARIES}")
# Only use custom curl if compiling with CPP11 PAL
if (PAL_IMPLEMENTATION STREQUAL "CPP11")
include(FindCURL)
find_package(CURL REQUIRED)
if (NOT CURL_FOUND)
message (FATAL_ERROR "libcurl not found! Have you installed deps?")
endif (NOT CURL_FOUND)
include_directories(CURL_INCLUDE_DIRS)
set(CMAKE_REQUIRED_LIBRARIES "${CURL_LIBRARIES}")
list(APPEND LIBS "${CURL_LIBRARIES}")
endif()
################################################################################################
# User options
################################################################################################
option(BUILD_HEADERS "Build API headers" YES)
option(BUILD_LIBRARY "Build library" YES)
option(BUILD_TEST_TOOL "Build console test tool" YES)
option(BUILD_UNIT_TESTS "Build unit tests" NO)
option(BUILD_FUNC_TESTS "Build functional tests" NO)
option(BUILD_JNI_WRAPPER "Build JNI wrapper" NO)
option(BUILD_PACKAGE "Build package" YES)
if(BUILD_UNIT_TESTS OR BUILD_FUNC_TESTS)
add_library(gtest STATIC IMPORTED GLOBAL)
@ -104,7 +123,6 @@ if(BUILD_UNIT_TESTS OR BUILD_FUNC_TESTS)
endif()
# Bond Lite subdirectories
include_directories(bondlite/include)
if(BUILD_UNIT_TESTS)
@ -112,18 +130,6 @@ if(BUILD_UNIT_TESTS)
add_subdirectory(bondlite/tests)
endif()
# SDK subdirectories
if (BUILD_PACKAGE)
if (${CMAKE_PACKAGE_TYPE} STREQUAL "deb")
# FIXME: hardcode it for 64-bit Linux for now
set(INSTALL_LIB_DIR ${CMAKE_INSTALL_PREFIX}/lib/${CPACK_DEBIAN_ARCHITECTURE}-linux-gnu)
include(tools/MakeDeb.cmake)
else()
include(tools/MakeRpm.cmake)
endif()
endif()
if(BUILD_HEADERS)
add_subdirectory(lib/include)
endif()
@ -141,3 +147,26 @@ endif()
#if(BUILD_TEST_TOOL)
# add_subdirectory(linktest)
#endif()
################################################################################################
# Packaging
################################################################################################
if (BUILD_PACKAGE)
if (${CMAKE_PACKAGE_TYPE} STREQUAL "deb")
# FIXME: hardcode it for 64-bit Linux for now
set(INSTALL_LIB_DIR ${CMAKE_INSTALL_PREFIX}/lib/${CPACK_DEBIAN_ARCHITECTURE}-linux-gnu)
include(tools/MakeDeb.cmake)
endif()
if (${CMAKE_PACKAGE_TYPE} STREQUAL "rpm")
# TODO: [MG] - fix path
set(INSTALL_LIB_DIR ${CMAKE_INSTALL_PREFIX}/lib/${CMAKE_SYSTEM_PROCESSOR}-linux-gnu)
include(tools/MakeRpm.cmake)
endif()
if (${CMAKE_PACKAGE_TYPE} STREQUAL "tgz")
# TODO: [MG] - fix path... should we simply use /usr/local/lib without CPU?
# TODO: [MG] - Windows path is not ideal -- C:/Program Files (x86)/AriaSDK/* - what should we use instead?
set(INSTALL_LIB_DIR ${CMAKE_INSTALL_PREFIX}/lib/${CMAKE_BUILD_TYPE}/${TARGET_ARCH})
include(tools/MakeTgz.cmake)
endif()
endif()

Просмотреть файл

@ -54,9 +54,7 @@
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\lib\offline\StorageObserver.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\lib\packager\BondSplicer.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\lib\packager\Packager.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\lib\pal\DeviceInformationImpl.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\lib\pal\InformationProviderImpl.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\lib\pal\NetworkInformationImpl.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\lib\pal\PAL_Win32.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\lib\pal\win32\WindowsEnvironmentInfo.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\lib\stats\MetaStats.cpp" />
@ -138,6 +136,7 @@
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\lib\include\public\LogConfiguration.hpp" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\lib\include\public\LogManager.hpp" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\lib\include\public\LogManagerBase.hpp" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\lib\include\public\CAPIClient.hpp" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\lib\include\public\LogManagerProvider.hpp" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\lib\include\public\LogSessionData.hpp" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\lib\include\public\NullObjects.hpp" />

Просмотреть файл

@ -141,12 +141,6 @@
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\lib\pal\InformationProviderImpl.cpp">
<Filter>pal</Filter>
</ClCompile>
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\lib\pal\DeviceInformationImpl.cpp">
<Filter>pal</Filter>
</ClCompile>
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\lib\pal\NetworkInformationImpl.cpp">
<Filter>pal</Filter>
</ClCompile>
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\lib\tpm\DeviceStateHandler.cpp">
<Filter>tpm</Filter>
</ClCompile>
@ -557,6 +551,9 @@
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\lib\system\EventPropertiesStorage.hpp">
<Filter>system</Filter>
</ClInclude>
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\lib\include\public\CAPIClient.hpp">
<Filter>include\public</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="$(MSBuildThisFileDirectory)..\..\lib\include\public\Version.hpp.template">

Просмотреть файл

@ -174,7 +174,7 @@
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>true</CompileAsWinRT>
<PreprocessorDefinitions>ZLIB_WINAPI;WIN32;ARIASDK_PLATFORM_WINDOWS=1;ARIASDK_SHARED_LIB;_ARIA_UTC_SDK;_WINRT_DLL;_CRT_SECURE_NO_WARNINGS;USE_BOND;BOND_COMPACT_BINARY_PROTOCOL;ARIASDK_VERSION_PREFIX="EVT";ENABLE_ECSCLIENT;_ARIA_UTC_SDK;USE_SQLITE;WIN10_CS;_CRTDBG_MAP_ALLOC;_ARIA_UTC_SDK;USE_TIMERSHIM2;USE_SQLITE;WINAPI_FAMILY=WINAPI_FAMILY_APP;_WINRT_DLL;ARIASDK_SHARED_LIB;_CRT_SECURE_NO_WARNINGS;USE_BOND;BOND_COMPACT_BINARY_PROTOCOL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>ZLIB_WINAPI;WIN32;ARIASDK_PLATFORM_WINDOWS=1;ARIASDK_SHARED_LIB;_ARIA_UTC_SDK;_WINRT_DLL;_CRT_SECURE_NO_WARNINGS;USE_BOND;ARIASDK_VERSION_PREFIX="EVT";ENABLE_ECSCLIENT;_ARIA_UTC_SDK;USE_SQLITE;WIN10_CS;_CRTDBG_MAP_ALLOC;_ARIA_UTC_SDK;USE_TIMERSHIM2;USE_SQLITE;WINAPI_FAMILY=WINAPI_FAMILY_APP;_WINRT_DLL;ARIASDK_SHARED_LIB;_CRT_SECURE_NO_WARNINGS;USE_BOND;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(ProjectDir)..\..\lib;$(ProjectDir)..\..\lib\include\public;$(ProjectDir)..\..\lib\include\aria;$(ProjectDir)..\..\bondlite\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CallingConvention>Cdecl</CallingConvention>
@ -210,7 +210,7 @@
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>true</CompileAsWinRT>
<PreprocessorDefinitions>ZLIB_WINAPI;WIN32;ARIASDK_PLATFORM_WINDOWS=1;ARIASDK_SHARED_LIB;_ARIA_UTC_SDK;_WINRT_DLL;_CRT_SECURE_NO_WARNINGS;USE_BOND;BOND_COMPACT_BINARY_PROTOCOL;ARIASDK_VERSION_PREFIX="EVT";ENABLE_ECSCLIENT;_ARIA_UTC_SDK;USE_SQLITE;WIN10_CS;WINAPI_FAMILY=WINAPI_FAMILY_APP;_WINRT_DLL;ARIASDK_SHARED_LIB;_CRT_SECURE_NO_WARNINGS;USE_BOND;BOND_COMPACT_BINARY_PROTOCOL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>ZLIB_WINAPI;WIN32;ARIASDK_PLATFORM_WINDOWS=1;ARIASDK_SHARED_LIB;_ARIA_UTC_SDK;_WINRT_DLL;_CRT_SECURE_NO_WARNINGS;USE_BOND;ARIASDK_VERSION_PREFIX="EVT";ENABLE_ECSCLIENT;_ARIA_UTC_SDK;USE_SQLITE;WIN10_CS;WINAPI_FAMILY=WINAPI_FAMILY_APP;_WINRT_DLL;ARIASDK_SHARED_LIB;_CRT_SECURE_NO_WARNINGS;USE_BOND;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(ProjectDir)..\..\lib;$(ProjectDir)..\..\lib\include\public;$(ProjectDir)..\..\lib\include\aria;$(ProjectDir)..\..\bondlite\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<Optimization>MinSpace</Optimization>
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
@ -241,7 +241,7 @@
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>true</CompileAsWinRT>
<PreprocessorDefinitions>ZLIB_WINAPI;WIN32;ARIASDK_PLATFORM_WINDOWS=1;ARIASDK_SHARED_LIB;_ARIA_UTC_SDK;_WINRT_DLL;_CRT_SECURE_NO_WARNINGS;USE_BOND;BOND_COMPACT_BINARY_PROTOCOL;ARIASDK_VERSION_PREFIX="EVT";ENABLE_ECSCLIENT;_ARIA_UTC_SDK;USE_SQLITE;WIN10_CS;_ARIA_UTC_SDK;USE_TIMERSHIM2;USE_SQLITE;WINAPI_FAMILY=WINAPI_FAMILY_PHONE_APP;_WINRT_DLL;ARIASDK_SHARED_LIB;_CRT_SECURE_NO_WARNINGS;USE_BOND;BOND_COMPACT_BINARY_PROTOCOL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>ZLIB_WINAPI;WIN32;ARIASDK_PLATFORM_WINDOWS=1;ARIASDK_SHARED_LIB;_ARIA_UTC_SDK;_WINRT_DLL;_CRT_SECURE_NO_WARNINGS;USE_BOND;ARIASDK_VERSION_PREFIX="EVT";ENABLE_ECSCLIENT;_ARIA_UTC_SDK;USE_SQLITE;WIN10_CS;_ARIA_UTC_SDK;USE_TIMERSHIM2;USE_SQLITE;WINAPI_FAMILY=WINAPI_FAMILY_PHONE_APP;_WINRT_DLL;ARIASDK_SHARED_LIB;_CRT_SECURE_NO_WARNINGS;USE_BOND;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(ProjectDir)..\..\lib;$(ProjectDir)..\..\lib\include\public;$(ProjectDir)..\..\lib\include\aria;$(ProjectDir)..\..\bondlite\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CallingConvention>Cdecl</CallingConvention>
<CompileAsManaged>false</CompileAsManaged>
@ -272,7 +272,7 @@
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>true</CompileAsWinRT>
<PreprocessorDefinitions>ZLIB_WINAPI;WIN32;ARIASDK_PLATFORM_WINDOWS=1;ARIASDK_SHARED_LIB;_ARIA_UTC_SDK;_WINRT_DLL;_CRT_SECURE_NO_WARNINGS;USE_BOND;BOND_COMPACT_BINARY_PROTOCOL;ARIASDK_VERSION_PREFIX="EVT";ENABLE_ECSCLIENT;_ARIA_UTC_SDK;USE_SQLITE;WIN10_CS;WINAPI_FAMILY=WINAPI_FAMILY_PHONE_APP;_WINRT_DLL;ARIASDK_SHARED_LIB;_CRT_SECURE_NO_WARNINGS;USE_BOND;BOND_COMPACT_BINARY_PROTOCOL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>ZLIB_WINAPI;WIN32;ARIASDK_PLATFORM_WINDOWS=1;ARIASDK_SHARED_LIB;_ARIA_UTC_SDK;_WINRT_DLL;_CRT_SECURE_NO_WARNINGS;USE_BOND;ARIASDK_VERSION_PREFIX="EVT";ENABLE_ECSCLIENT;_ARIA_UTC_SDK;USE_SQLITE;WIN10_CS;WINAPI_FAMILY=WINAPI_FAMILY_PHONE_APP;_WINRT_DLL;ARIASDK_SHARED_LIB;_CRT_SECURE_NO_WARNINGS;USE_BOND;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(ProjectDir)..\..\lib;$(ProjectDir)..\..\lib\include\public;$(ProjectDir)..\..\lib\include\aria;$(ProjectDir)..\..\bondlite\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<Optimization>MinSpace</Optimization>
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
@ -303,7 +303,7 @@
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>true</CompileAsWinRT>
<PreprocessorDefinitions>ZLIB_WINAPI;WIN32;ARIASDK_PLATFORM_WINDOWS=1;ARIASDK_SHARED_LIB;_ARIA_UTC_SDK;_WINRT_DLL;_CRT_SECURE_NO_WARNINGS;USE_BOND;BOND_COMPACT_BINARY_PROTOCOL;ARIASDK_VERSION_PREFIX="EVT";ENABLE_ECSCLIENT;_ARIA_UTC_SDK;USE_SQLITE;WIN10_CS;_ARIA_UTC_SDK;USE_TIMERSHIM2;USE_SQLITE;WINAPI_FAMILY=WINAPI_FAMILY_APP;_WINRT_DLL;ARIASDK_SHARED_LIB;_CRT_SECURE_NO_WARNINGS;USE_BOND;BOND_COMPACT_BINARY_PROTOCOL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>ZLIB_WINAPI;WIN32;ARIASDK_PLATFORM_WINDOWS=1;ARIASDK_SHARED_LIB;_ARIA_UTC_SDK;_WINRT_DLL;_CRT_SECURE_NO_WARNINGS;USE_BOND;ARIASDK_VERSION_PREFIX="EVT";ENABLE_ECSCLIENT;_ARIA_UTC_SDK;USE_SQLITE;WIN10_CS;_ARIA_UTC_SDK;USE_TIMERSHIM2;USE_SQLITE;WINAPI_FAMILY=WINAPI_FAMILY_APP;_WINRT_DLL;ARIASDK_SHARED_LIB;_CRT_SECURE_NO_WARNINGS;USE_BOND;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(ProjectDir)..\..\lib;$(ProjectDir)..\..\lib\include\public;$(ProjectDir)..\..\lib\include\aria;$(ProjectDir)..\..\bondlite\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CallingConvention>Cdecl</CallingConvention>
@ -335,7 +335,7 @@
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>true</CompileAsWinRT>
<PreprocessorDefinitions>ZLIB_WINAPI;WIN32;ARIASDK_PLATFORM_WINDOWS=1;ARIASDK_SHARED_LIB;_ARIA_UTC_SDK;_WINRT_DLL;_CRT_SECURE_NO_WARNINGS;USE_BOND;BOND_COMPACT_BINARY_PROTOCOL;ARIASDK_VERSION_PREFIX="EVT";ENABLE_ECSCLIENT;_ARIA_UTC_SDK;USE_SQLITE;WIN10_CS;WINAPI_FAMILY=WINAPI_FAMILY_APP;_WINRT_DLL;ARIASDK_SHARED_LIB;_CRT_SECURE_NO_WARNINGS;USE_BOND;BOND_COMPACT_BINARY_PROTOCOL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>ZLIB_WINAPI;WIN32;ARIASDK_PLATFORM_WINDOWS=1;ARIASDK_SHARED_LIB;_ARIA_UTC_SDK;_WINRT_DLL;_CRT_SECURE_NO_WARNINGS;USE_BOND;ARIASDK_VERSION_PREFIX="EVT";ENABLE_ECSCLIENT;_ARIA_UTC_SDK;USE_SQLITE;WIN10_CS;WINAPI_FAMILY=WINAPI_FAMILY_APP;_WINRT_DLL;ARIASDK_SHARED_LIB;_CRT_SECURE_NO_WARNINGS;USE_BOND;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(ProjectDir)..\..\lib;$(ProjectDir)..\..\lib\include\public;$(ProjectDir)..\..\lib\include\aria;$(ProjectDir)..\..\bondlite\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<Optimization>MinSpace</Optimization>
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
@ -368,7 +368,7 @@
<AdditionalIncludeDirectories>$(ProjectDir)..\..\lib;$(ProjectDir)..\..\lib\include\public;$(ProjectDir)..\..\lib\include\aria;$(ProjectDir)..\..\bondlite\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<SupportJustMyCode>false</SupportJustMyCode>
<CompileAsManaged>false</CompileAsManaged>
<PreprocessorDefinitions>ZLIB_WINAPI;WIN32;ARIASDK_PLATFORM_WINDOWS=1;ARIASDK_SHARED_LIB;_ARIA_UTC_SDK;_WINRT_DLL;_CRT_SECURE_NO_WARNINGS;USE_BOND;BOND_COMPACT_BINARY_PROTOCOL;ARIASDK_VERSION_PREFIX="EVT";ENABLE_ECSCLIENT;WIN10_CS;WINAPI_FAMILY=WINAPI_FAMILY_PHONE_APP;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>ZLIB_WINAPI;WIN32;ARIASDK_PLATFORM_WINDOWS=1;ARIASDK_SHARED_LIB;_ARIA_UTC_SDK;_WINRT_DLL;_CRT_SECURE_NO_WARNINGS;USE_BOND;ARIASDK_VERSION_PREFIX="EVT";ENABLE_ECSCLIENT;WIN10_CS;WINAPI_FAMILY=WINAPI_FAMILY_PHONE_APP;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<AdditionalDependencies>sqlite-uwp.lib;zlib.lib;WindowsApp.lib;%(AdditionalDependencies)</AdditionalDependencies>
@ -382,7 +382,7 @@
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<AdditionalIncludeDirectories>$(ProjectDir)..\..\lib;$(ProjectDir)..\..\lib\include\public;$(ProjectDir)..\..\lib\include\aria;$(ProjectDir)..\..\bondlite\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAsManaged>false</CompileAsManaged>
<PreprocessorDefinitions>ZLIB_WINAPI;WIN32;ARIASDK_PLATFORM_WINDOWS=1;ARIASDK_SHARED_LIB;_ARIA_UTC_SDK;_WINRT_DLL;_CRT_SECURE_NO_WARNINGS;USE_BOND;BOND_COMPACT_BINARY_PROTOCOL;ARIASDK_VERSION_PREFIX="EVT";ENABLE_ECSCLIENT;WIN10_CS;WINAPI_FAMILY=WINAPI_FAMILY_PHONE_APP;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>ZLIB_WINAPI;WIN32;ARIASDK_PLATFORM_WINDOWS=1;ARIASDK_SHARED_LIB;_ARIA_UTC_SDK;_WINRT_DLL;_CRT_SECURE_NO_WARNINGS;USE_BOND;ARIASDK_VERSION_PREFIX="EVT";ENABLE_ECSCLIENT;WIN10_CS;WINAPI_FAMILY=WINAPI_FAMILY_PHONE_APP;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<AdditionalDependencies>sqlite-uwp.lib;zlib.lib;WindowsApp.lib;%(AdditionalDependencies)</AdditionalDependencies>

Просмотреть файл

@ -170,7 +170,7 @@
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>true</CompileAsWinRT>
<PreprocessorDefinitions>ZLIB_WINAPI;WIN32;ARIASDK_VERSION_PREFIX="EVT";ARIASDK_PLATFORM_WINDOWS=1;ARIASDK_SHARED_LIB;_ARIA_UTC_SDK;_WINRT_DLL;_CRT_SECURE_NO_WARNINGS;USE_BOND;BOND_COMPACT_BINARY_PROTOCOL;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>ZLIB_WINAPI;WIN32;ARIASDK_VERSION_PREFIX="EVT";ARIASDK_PLATFORM_WINDOWS=1;ARIASDK_SHARED_LIB;_ARIA_UTC_SDK;_WINRT_DLL;_CRT_SECURE_NO_WARNINGS;USE_BOND;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(ProjectDir)..\..\lib;$(ProjectDir)..\..\lib\include\public;$(ProjectDir)..\..\lib\include\aria;$(ProjectDir)..\..\bondlite\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CallingConvention>Cdecl</CallingConvention>
@ -205,7 +205,7 @@
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>true</CompileAsWinRT>
<PreprocessorDefinitions>ZLIB_WINAPI;WIN32;ARIASDK_VERSION_PREFIX="EVT";ARIASDK_PLATFORM_WINDOWS=1;ARIASDK_SHARED_LIB;_ARIA_UTC_SDK;_WINRT_DLL;_CRT_SECURE_NO_WARNINGS;USE_BOND;BOND_COMPACT_BINARY_PROTOCOL;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>ZLIB_WINAPI;WIN32;ARIASDK_VERSION_PREFIX="EVT";ARIASDK_PLATFORM_WINDOWS=1;ARIASDK_SHARED_LIB;_ARIA_UTC_SDK;_WINRT_DLL;_CRT_SECURE_NO_WARNINGS;USE_BOND;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(ProjectDir)..\..\lib;$(ProjectDir)..\..\lib\include\public;$(ProjectDir)..\..\lib\include\aria;$(ProjectDir)..\..\bondlite\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<Optimization>Disabled</Optimization>
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
@ -234,7 +234,7 @@
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>true</CompileAsWinRT>
<PreprocessorDefinitions>ZLIB_WINAPI;WIN32;ARIASDK_VERSION_PREFIX="EVT";ARIASDK_PLATFORM_WINDOWS=1;ARIASDK_SHARED_LIB;_ARIA_UTC_SDK;_WINRT_DLL;_CRT_SECURE_NO_WARNINGS;USE_BOND;BOND_COMPACT_BINARY_PROTOCOL;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>ZLIB_WINAPI;WIN32;ARIASDK_VERSION_PREFIX="EVT";ARIASDK_PLATFORM_WINDOWS=1;ARIASDK_SHARED_LIB;_ARIA_UTC_SDK;_WINRT_DLL;_CRT_SECURE_NO_WARNINGS;USE_BOND;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(ProjectDir)..\..\lib;$(ProjectDir)..\..\lib\include\public;$(ProjectDir)..\..\lib\include\aria;$(ProjectDir)..\..\bondlite\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CallingConvention>Cdecl</CallingConvention>
<ExceptionHandling>Async</ExceptionHandling>
@ -265,7 +265,7 @@
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>true</CompileAsWinRT>
<PreprocessorDefinitions>ZLIB_WINAPI;WIN32;ARIASDK_VERSION_PREFIX="EVT";ARIASDK_PLATFORM_WINDOWS=1;ARIASDK_SHARED_LIB;_ARIA_UTC_SDK;_WINRT_DLL;_CRT_SECURE_NO_WARNINGS;USE_BOND;BOND_COMPACT_BINARY_PROTOCOL;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>ZLIB_WINAPI;WIN32;ARIASDK_VERSION_PREFIX="EVT";ARIASDK_PLATFORM_WINDOWS=1;ARIASDK_SHARED_LIB;_ARIA_UTC_SDK;_WINRT_DLL;_CRT_SECURE_NO_WARNINGS;USE_BOND;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(ProjectDir)..\..\lib;$(ProjectDir)..\..\lib\include\public;$(ProjectDir)..\..\lib\include\aria;$(ProjectDir)..\..\bondlite\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<Optimization>Disabled</Optimization>
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
@ -295,7 +295,7 @@
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>true</CompileAsWinRT>
<PreprocessorDefinitions>ZLIB_WINAPI;WIN32;ARIASDK_VERSION_PREFIX="EVT";ARIASDK_PLATFORM_WINDOWS=1;ARIASDK_SHARED_LIB;_ARIA_UTC_SDK;_WINRT_DLL;_CRT_SECURE_NO_WARNINGS;USE_BOND;BOND_COMPACT_BINARY_PROTOCOL;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>ZLIB_WINAPI;WIN32;ARIASDK_VERSION_PREFIX="EVT";ARIASDK_PLATFORM_WINDOWS=1;ARIASDK_SHARED_LIB;_ARIA_UTC_SDK;_WINRT_DLL;_CRT_SECURE_NO_WARNINGS;USE_BOND;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(ProjectDir)..\..\lib;$(ProjectDir)..\..\lib\include\public;$(ProjectDir)..\..\lib\include\aria;$(ProjectDir)..\..\bondlite\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CallingConvention>Cdecl</CallingConvention>
@ -327,7 +327,7 @@
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>true</CompileAsWinRT>
<PreprocessorDefinitions>ZLIB_WINAPI;WIN32;ARIASDK_VERSION_PREFIX="EVT";ARIASDK_PLATFORM_WINDOWS=1;ARIASDK_SHARED_LIB;_ARIA_UTC_SDK;_WINRT_DLL;_CRT_SECURE_NO_WARNINGS;USE_BOND;BOND_COMPACT_BINARY_PROTOCOL;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>ZLIB_WINAPI;WIN32;ARIASDK_VERSION_PREFIX="EVT";ARIASDK_PLATFORM_WINDOWS=1;ARIASDK_SHARED_LIB;_ARIA_UTC_SDK;_WINRT_DLL;_CRT_SECURE_NO_WARNINGS;USE_BOND;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(ProjectDir)..\..\lib;$(ProjectDir)..\..\lib\include\public;$(ProjectDir)..\..\lib\include\aria;$(ProjectDir)..\..\bondlite\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<Optimization>Disabled</Optimization>
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
@ -358,7 +358,7 @@
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<AdditionalIncludeDirectories>$(ProjectDir)..\..\lib;$(ProjectDir)..\..\lib\include\public;$(ProjectDir)..\..\lib\include\aria;$(ProjectDir)..\..\bondlite\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>ZLIB_WINAPI;WIN32;ARIASDK_VERSION_PREFIX="EVT";ARIASDK_PLATFORM_WINDOWS=1;ARIASDK_SHARED_LIB;_ARIA_UTC_SDK;_WINRT_DLL;_CRT_SECURE_NO_WARNINGS;USE_BOND;BOND_COMPACT_BINARY_PROTOCOL;_WINDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>ZLIB_WINAPI;WIN32;ARIASDK_VERSION_PREFIX="EVT";ARIASDK_PLATFORM_WINDOWS=1;ARIASDK_SHARED_LIB;_ARIA_UTC_SDK;_WINRT_DLL;_CRT_SECURE_NO_WARNINGS;USE_BOND;_WINDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SupportJustMyCode>false</SupportJustMyCode>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
@ -374,7 +374,7 @@
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<AdditionalIncludeDirectories>$(ProjectDir)..\..\lib;$(ProjectDir)..\..\lib\include\public;$(ProjectDir)..\..\lib\include\aria;$(ProjectDir)..\..\bondlite\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>ZLIB_WINAPI;WIN32;ARIASDK_VERSION_PREFIX="EVT";ARIASDK_PLATFORM_WINDOWS=1;ARIASDK_SHARED_LIB;_ARIA_UTC_SDK;_WINRT_DLL;_CRT_SECURE_NO_WARNINGS;USE_BOND;BOND_COMPACT_BINARY_PROTOCOL;_WINDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>ZLIB_WINAPI;WIN32;ARIASDK_VERSION_PREFIX="EVT";ARIASDK_PLATFORM_WINDOWS=1;ARIASDK_SHARED_LIB;_ARIA_UTC_SDK;_WINRT_DLL;_CRT_SECURE_NO_WARNINGS;USE_BOND;_WINDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
<Link>

Просмотреть файл

@ -165,7 +165,7 @@
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>true</CompileAsWinRT>
<PreprocessorDefinitions>ZLIB_WINAPI;WIN32;ARIASDK_VERSION_PREFIX="EVT";ARIASDK_PLATFORM_WINDOWS=1;ARIASDK_STATIC_LIB;_ARIA_UTC_SDK;_WINRT_DLL;_CRT_SECURE_NO_WARNINGS;USE_BOND;BOND_COMPACT_BINARY_PROTOCOL;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>ZLIB_WINAPI;WIN32;ARIASDK_VERSION_PREFIX="EVT";ARIASDK_PLATFORM_WINDOWS=1;ARIASDK_STATIC_LIB;_ARIA_UTC_SDK;_WINRT_DLL;_CRT_SECURE_NO_WARNINGS;USE_BOND;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(ProjectDir)..\..\lib;$(ProjectDir)..\..\lib\include\public;$(ProjectDir)..\..\lib\include\aria;$(ProjectDir)..\..\bondlite\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CallingConvention>Cdecl</CallingConvention>
@ -195,7 +195,7 @@
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>true</CompileAsWinRT>
<PreprocessorDefinitions>ZLIB_WINAPI;WIN32;ARIASDK_VERSION_PREFIX="EVT";ARIASDK_PLATFORM_WINDOWS=1;ARIASDK_STATIC_LIB;_ARIA_UTC_SDK;_WINRT_DLL;_CRT_SECURE_NO_WARNINGS;USE_BOND;BOND_COMPACT_BINARY_PROTOCOL;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>ZLIB_WINAPI;WIN32;ARIASDK_VERSION_PREFIX="EVT";ARIASDK_PLATFORM_WINDOWS=1;ARIASDK_STATIC_LIB;_ARIA_UTC_SDK;_WINRT_DLL;_CRT_SECURE_NO_WARNINGS;USE_BOND;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(ProjectDir)..\..\lib;$(ProjectDir)..\..\lib\include\public;$(ProjectDir)..\..\lib\include\aria;$(ProjectDir)..\..\bondlite\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<Optimization>MinSpace</Optimization>
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
@ -222,7 +222,7 @@
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>true</CompileAsWinRT>
<PreprocessorDefinitions>ZLIB_WINAPI;WIN32;ARIASDK_VERSION_PREFIX="EVT";ARIASDK_PLATFORM_WINDOWS=1;ARIASDK_STATIC_LIB;_ARIA_UTC_SDK;_WINRT_DLL;_CRT_SECURE_NO_WARNINGS;USE_BOND;BOND_COMPACT_BINARY_PROTOCOL;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>ZLIB_WINAPI;WIN32;ARIASDK_VERSION_PREFIX="EVT";ARIASDK_PLATFORM_WINDOWS=1;ARIASDK_STATIC_LIB;_ARIA_UTC_SDK;_WINRT_DLL;_CRT_SECURE_NO_WARNINGS;USE_BOND;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(ProjectDir)..\..\lib;$(ProjectDir)..\..\lib\include\public;$(ProjectDir)..\..\lib\include\aria;$(ProjectDir)..\..\bondlite\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CallingConvention>Cdecl</CallingConvention>
<ExceptionHandling>Async</ExceptionHandling>
@ -247,7 +247,7 @@
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>true</CompileAsWinRT>
<PreprocessorDefinitions>ZLIB_WINAPI;WIN32;ARIASDK_VERSION_PREFIX="EVT";ARIASDK_PLATFORM_WINDOWS=1;ARIASDK_STATIC_LIB;_ARIA_UTC_SDK;_WINRT_DLL;_CRT_SECURE_NO_WARNINGS;USE_BOND;BOND_COMPACT_BINARY_PROTOCOL;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>ZLIB_WINAPI;WIN32;ARIASDK_VERSION_PREFIX="EVT";ARIASDK_PLATFORM_WINDOWS=1;ARIASDK_STATIC_LIB;_ARIA_UTC_SDK;_WINRT_DLL;_CRT_SECURE_NO_WARNINGS;USE_BOND;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(ProjectDir)..\..\lib;$(ProjectDir)..\..\lib\include\public;$(ProjectDir)..\..\lib\include\aria;$(ProjectDir)..\..\bondlite\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<Optimization>MinSpace</Optimization>
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
@ -276,7 +276,7 @@
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>true</CompileAsWinRT>
<PreprocessorDefinitions>ZLIB_WINAPI;WIN32;ARIASDK_VERSION_PREFIX="EVT";ARIASDK_PLATFORM_WINDOWS=1;ARIASDK_STATIC_LIB;_ARIA_UTC_SDK;_WINRT_DLL;_CRT_SECURE_NO_WARNINGS;USE_BOND;BOND_COMPACT_BINARY_PROTOCOL;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>ZLIB_WINAPI;WIN32;ARIASDK_VERSION_PREFIX="EVT";ARIASDK_PLATFORM_WINDOWS=1;ARIASDK_STATIC_LIB;_ARIA_UTC_SDK;_WINRT_DLL;_CRT_SECURE_NO_WARNINGS;USE_BOND;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(ProjectDir)..\..\lib;$(ProjectDir)..\..\lib\include\public;$(ProjectDir)..\..\lib\include\aria;$(ProjectDir)..\..\bondlite\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<Optimization>MinSpace</Optimization>
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
@ -303,7 +303,7 @@
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>true</CompileAsWinRT>
<PreprocessorDefinitions>ZLIB_WINAPI;WIN32;ARIASDK_VERSION_PREFIX="EVT";ARIASDK_PLATFORM_WINDOWS=1;ARIASDK_STATIC_LIB;_ARIA_UTC_SDK;_WINRT_DLL;_CRT_SECURE_NO_WARNINGS;USE_BOND;BOND_COMPACT_BINARY_PROTOCOL;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>ZLIB_WINAPI;WIN32;ARIASDK_VERSION_PREFIX="EVT";ARIASDK_PLATFORM_WINDOWS=1;ARIASDK_STATIC_LIB;_ARIA_UTC_SDK;_WINRT_DLL;_CRT_SECURE_NO_WARNINGS;USE_BOND;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(ProjectDir)..\..\lib;$(ProjectDir)..\..\lib\include\public;$(ProjectDir)..\..\lib\include\aria;$(ProjectDir)..\..\bondlite\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CallingConvention>Cdecl</CallingConvention>
@ -329,7 +329,7 @@
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>true</CompileAsWinRT>
<PreprocessorDefinitions>ZLIB_WINAPI;WIN32;ARIASDK_VERSION_PREFIX="EVT";ARIASDK_PLATFORM_WINDOWS=1;ARIASDK_STATIC_LIB;_ARIA_UTC_SDK;_WINRT_DLL;_CRT_SECURE_NO_WARNINGS;USE_BOND;BOND_COMPACT_BINARY_PROTOCOL;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>ZLIB_WINAPI;WIN32;ARIASDK_VERSION_PREFIX="EVT";ARIASDK_PLATFORM_WINDOWS=1;ARIASDK_STATIC_LIB;_ARIA_UTC_SDK;_WINRT_DLL;_CRT_SECURE_NO_WARNINGS;USE_BOND;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(ProjectDir)..\..\lib;$(ProjectDir)..\..\lib\include\public;$(ProjectDir)..\..\lib\include\aria;$(ProjectDir)..\..\bondlite\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<Optimization>MinSpace</Optimization>
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
@ -357,7 +357,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PreprocessorDefinitions>ZLIB_WINAPI;WIN32;ARIASDK_VERSION_PREFIX="EVT";ARIASDK_PLATFORM_WINDOWS=1;ARIASDK_STATIC_LIB;_ARIA_UTC_SDK;_WINRT_DLL;_CRT_SECURE_NO_WARNINGS;USE_BOND;BOND_COMPACT_BINARY_PROTOCOL;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>ZLIB_WINAPI;WIN32;ARIASDK_VERSION_PREFIX="EVT";ARIASDK_PLATFORM_WINDOWS=1;ARIASDK_STATIC_LIB;_ARIA_UTC_SDK;_WINRT_DLL;_CRT_SECURE_NO_WARNINGS;USE_BOND;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(ProjectDir)..\..\lib;$(ProjectDir)..\..\lib\include\public;$(ProjectDir)..\..\lib\include\aria;$(ProjectDir)..\..\bondlite\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ControlFlowGuard>Guard</ControlFlowGuard>
<CompileAsWinRT>true</CompileAsWinRT>
@ -366,7 +366,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PreprocessorDefinitions>ZLIB_WINAPI;WIN32;ARIASDK_VERSION_PREFIX="EVT";ARIASDK_PLATFORM_WINDOWS=1;ARIASDK_STATIC_LIB;_ARIA_UTC_SDK;_WINRT_DLL;_CRT_SECURE_NO_WARNINGS;USE_BOND;BOND_COMPACT_BINARY_PROTOCOL;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>ZLIB_WINAPI;WIN32;ARIASDK_VERSION_PREFIX="EVT";ARIASDK_PLATFORM_WINDOWS=1;ARIASDK_STATIC_LIB;_ARIA_UTC_SDK;_WINRT_DLL;_CRT_SECURE_NO_WARNINGS;USE_BOND;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(ProjectDir)..\..\lib;$(ProjectDir)..\..\lib\include\public;$(ProjectDir)..\..\lib\include\aria;$(ProjectDir)..\..\bondlite\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ControlFlowGuard>Guard</ControlFlowGuard>
<WholeProgramOptimization>false</WholeProgramOptimization>

Просмотреть файл

@ -164,7 +164,7 @@
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>ZLIB_WINAPI;WIN32;ARIASDK_VERSION_PREFIX="EVT";ARIASDK_PLATFORM_WINDOWS=1;ARIASDK_SHARED_LIB=1;_ARIA_UTC_SDK;_CRT_SECURE_NO_WARNINGS;USE_BOND;BOND_COMPACT_BINARY_PROTOCOL;WIN32;_DEBUG;_WINDOWS;_USRDLL;WINVER=_WIN32_WINNT_WIN7;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>ZLIB_WINAPI;WIN32;ARIASDK_VERSION_PREFIX="EVT";ARIASDK_PLATFORM_WINDOWS=1;ARIASDK_SHARED_LIB=1;_ARIA_UTC_SDK;_CRT_SECURE_NO_WARNINGS;USE_BOND;WIN32;_DEBUG;_WINDOWS;_USRDLL;WINVER=_WIN32_WINNT_WIN7;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(ProjectDir)..\..\lib;$(ProjectDir)..\..\lib\include\public;$(ProjectDir)..\..\lib\include\aria;$(ProjectDir)..\..\bondlite\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAsManaged>false</CompileAsManaged>
@ -255,7 +255,7 @@
<Optimization Condition="'$(Platform)'=='ARM64'">MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>false</IntrinsicFunctions>
<PreprocessorDefinitions>ZLIB_WINAPI;WIN32;ARIASDK_VERSION_PREFIX="EVT";ARIASDK_PLATFORM_WINDOWS=1;ARIASDK_SHARED_LIB=1;_ARIA_UTC_SDK;_CRT_SECURE_NO_WARNINGS;USE_BOND;BOND_COMPACT_BINARY_PROTOCOL;WIN32;NDEBUG;_WINDOWS;_USRDLL;WINVER=_WIN32_WINNT_WIN7;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>ZLIB_WINAPI;WIN32;ARIASDK_VERSION_PREFIX="EVT";ARIASDK_PLATFORM_WINDOWS=1;ARIASDK_SHARED_LIB=1;_ARIA_UTC_SDK;_CRT_SECURE_NO_WARNINGS;USE_BOND;WIN32;NDEBUG;_WINDOWS;_USRDLL;WINVER=_WIN32_WINNT_WIN7;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(ProjectDir)..\..\lib;$(ProjectDir)..\..\lib\include\public;$(ProjectDir)..\..\lib\include\aria;$(ProjectDir)..\..\bondlite\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAsManaged>false</CompileAsManaged>
<CompileAsWinRT>false</CompileAsWinRT>

Просмотреть файл

@ -258,7 +258,7 @@
</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>ZLIB_WINAPI;WIN32;ARIASDK_VERSION_PREFIX="EVT";ARIASDK_PLATFORM_WINDOWS=1;ARIASDK_SHARED_LIB=1;_ARIA_UTC_SDK;_CRT_SECURE_NO_WARNINGS;USE_BOND;BOND_COMPACT_BINARY_PROTOCOL;WIN32;_DEBUG;_WINDOWS;_USRDLL;WINVER=_WIN32_WINNT_WIN7;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>ZLIB_WINAPI;WIN32;ARIASDK_VERSION_PREFIX="EVT";ARIASDK_PLATFORM_WINDOWS=1;ARIASDK_SHARED_LIB=1;_ARIA_UTC_SDK;_CRT_SECURE_NO_WARNINGS;USE_BOND;WIN32;_DEBUG;_WINDOWS;_USRDLL;WINVER=_WIN32_WINNT_WIN7;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(ProjectDir)..\..\lib;$(ProjectDir)..\..\lib\include\public;$(ProjectDir)..\..\lib\include\aria;$(ProjectDir)..\..\bondlite\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAsManaged>false</CompileAsManaged>
@ -323,7 +323,7 @@
</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>ZLIB_WINAPI;WIN32;ARIASDK_VERSION_PREFIX="EVT";ARIASDK_PLATFORM_WINDOWS=1;ARIASDK_SHARED_LIB=1;_ARIA_UTC_SDK;_CRT_SECURE_NO_WARNINGS;USE_BOND;BOND_COMPACT_BINARY_PROTOCOL;WIN32;_DEBUG;_WINDOWS;_USRDLL;WINVER=_WIN32_WINNT_WIN7;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>ZLIB_WINAPI;WIN32;ARIASDK_VERSION_PREFIX="EVT";ARIASDK_PLATFORM_WINDOWS=1;ARIASDK_SHARED_LIB=1;_ARIA_UTC_SDK;_CRT_SECURE_NO_WARNINGS;USE_BOND;WIN32;_DEBUG;_WINDOWS;_USRDLL;WINVER=_WIN32_WINNT_WIN7;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(ProjectDir)..\..\lib;$(ProjectDir)..\..\lib\include\public;$(ProjectDir)..\..\lib\include\aria;$(ProjectDir)..\..\bondlite\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAsManaged>false</CompileAsManaged>
@ -395,7 +395,7 @@
<Optimization Condition="'$(Platform)'=='ARM64'">MinSpace</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>false</IntrinsicFunctions>
<PreprocessorDefinitions>ZLIB_WINAPI;WIN32;ARIASDK_VERSION_PREFIX="EVT";ARIASDK_PLATFORM_WINDOWS=1;ARIASDK_SHARED_LIB=1;_ARIA_UTC_SDK;_CRT_SECURE_NO_WARNINGS;USE_BOND;BOND_COMPACT_BINARY_PROTOCOL;WIN32;NDEBUG;_WINDOWS;_USRDLL;WINVER=_WIN32_WINNT_WIN7;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>ZLIB_WINAPI;WIN32;ARIASDK_VERSION_PREFIX="EVT";ARIASDK_PLATFORM_WINDOWS=1;ARIASDK_SHARED_LIB=1;_ARIA_UTC_SDK;_CRT_SECURE_NO_WARNINGS;USE_BOND;WIN32;NDEBUG;_WINDOWS;_USRDLL;WINVER=_WIN32_WINNT_WIN7;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(ProjectDir)..\..\lib;$(ProjectDir)..\..\lib\include\public;$(ProjectDir)..\..\lib\include\aria;$(ProjectDir)..\..\bondlite\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAsManaged>false</CompileAsManaged>
<CompileAsWinRT>false</CompileAsWinRT>
@ -468,7 +468,7 @@
<Optimization Condition="'$(Platform)'=='ARM64'">MinSpace</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>false</IntrinsicFunctions>
<PreprocessorDefinitions>ZLIB_WINAPI;WIN32;ARIASDK_VERSION_PREFIX="EVT";ARIASDK_PLATFORM_WINDOWS=1;ARIASDK_SHARED_LIB=1;_ARIA_UTC_SDK;_CRT_SECURE_NO_WARNINGS;USE_BOND;BOND_COMPACT_BINARY_PROTOCOL;WIN32;NDEBUG;_WINDOWS;_USRDLL;WINVER=_WIN32_WINNT_WIN7;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>ZLIB_WINAPI;WIN32;ARIASDK_VERSION_PREFIX="EVT";ARIASDK_PLATFORM_WINDOWS=1;ARIASDK_SHARED_LIB=1;_ARIA_UTC_SDK;_CRT_SECURE_NO_WARNINGS;USE_BOND;WIN32;NDEBUG;_WINDOWS;_USRDLL;WINVER=_WIN32_WINNT_WIN7;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(ProjectDir)..\..\lib;$(ProjectDir)..\..\lib\include\public;$(ProjectDir)..\..\lib\include\aria;$(ProjectDir)..\..\bondlite\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAsManaged>false</CompileAsManaged>
<CompileAsWinRT>false</CompileAsWinRT>

6
build-clang.sh Executable file
Просмотреть файл

@ -0,0 +1,6 @@
#!/bin/sh
export CLANG_PATH=/tools/clang+llvm-7.0.0-x86_64-apple-darwin/bin
export PATH=$CLANG_PATH:$PATH
export CC=$CLANG_PATH/clang-7
export CXX=$CLANG_PATH/clang++
source ./build.sh

66
build-cmake-clang.cmd Normal file
Просмотреть файл

@ -0,0 +1,66 @@
@echo off
setlocal enableextensions
setlocal enabledelayedexpansion
set ROOT=%~dp0
REM ********************************************************************
REM Use cmake
REM ********************************************************************
set PATH="C:\Program Files\CMake\bin\";%PATH%
REM ********************************************************************
REM Use clang compiler
REM ********************************************************************
set CLANG_PATH="C:\Program Files\LLVM\bin"
set CC=%CLANG_PATH%\clang.exe
set CXX=%CLANG_PATH%\clang++.exe
set LLVM_VER=LLVM
REM ********************************************************************
REM Set output directory, clean and/or create as-needed
REM ********************************************************************
set OUTDIR=%ROOT%\Solutions\out
if "%1" == "clean" (
@rmdir /s /q %OUTDIR%
)
if not exist "%OUTDIR%" mkdir %OUTDIR%
cd %OUTDIR%
REM ********************************************************************
REM Build all deps using MSVC - Visual Studio 2017 (15)
REM ********************************************************************
if "%1" == "nodeps" goto NODEPS
call tools\build-deps.cmd
:NODEPS
REM ********************************************************************
REM Invoke the build script
REM ********************************************************************
set CMAKE_PACKAGE_TYPE=tgz
for %%a in ( m32 m64 ) do (
for %%c in ( Debug Release ) do (
if "%%a"=="m32" (
set ARCH=Win32
set ARCH_GEN=
)
if "%%a"=="m64" (
set ARCH=x64
set ARCH_GEN= Win64
)
@mkdir %OUTDIR%\%%c\!ARCH!
cd %OUTDIR%\%%c\!ARCH!
set CFLAGS=-%%a
set CXXFLAGS=-%%a
cmake -G"Visual Studio 15 2017!ARCH_GEN!" ^
-T"%LLVM_VER%" ^
-DTARGET_ARCH=!ARCH! ^
-DBUILD_SHARED_LIBS=OFF ^
-DCMAKE_BUILD_TYPE=%%c ^
-DCMAKE_PACKAGE_TYPE=%CMAKE_PACKAGE_TYPE% ^
-DDEFAULT_PAL_IMPLEMENTATION=WIN32 ^
%ROOT%
cmake --build . --config %%c -- /p:Configuration=%%c
)
)
cd %ROOT%

Просмотреть файл

@ -15,23 +15,40 @@ fi
# Install build tools and recent sqlite3
FILE=.buildtools
if [ ! -f .buildtools ]; then
sudo tools/setup-buildtools.sh
echo >.buildtools
OS_NAME=`uname -a`
if [ ! -f $FILE ]; then
case "$OS_NAME" in
*Darwin*) echo "TODO: install build tools on Mac OS X..." ;;
*Linux*) sudo tools/setup-buildtools.sh ;;
*) echo "WARNING: unsupported OS $OS_NAME , skipping build tools installation.."
esac
# Assume that the build tools have been successfully installed
echo > $FILE
fi
if [ -f /usr/bin/gcc ]; then
echo "gcc version: `gcc --version`"
echo "gcc version: `gcc --version`"
fi
if [ -f /usr/bin/clang ]; then
echo "clang version: `clang --version`"
fi
#rm -rf out
mkdir -p out
cd out
# .tgz package
CMAKE_PACKAGE_TYPE=tgz
# .deb package
if [ -f /usr/bin/dpkg ]; then
export CMAKE_PACKAGE_TYPE=deb
fi
# .rpm package
if [ -f /usr/bin/rpmbuild ]; then
export CMAKE_PACKAGE_TYPE=rpm
else
export CMAKE_PACKAGE_TYPE=deb
fi
if [ "$2" == "release" ]; then
@ -43,7 +60,9 @@ else
fi
# Build all
make
# TODO: what are the pros and cons of using 'make' vs 'cmake --build' ?
#make
cmake --build .
# Remove old package
rm -f *.deb *.rpm
@ -51,24 +70,25 @@ rm -f *.deb *.rpm
# Build new package
make package
# Debian / Ubuntu / Raspbian
if [ -f /usr/bin/dpkg ]; then
# Install new package
sudo dpkg -i *.deb
else
fi
# RedHat / CentOS
if [ -f /usr/bin/rpmbuild ]; then
sudo rpm -i --force -v *.rpm
fi
# TODO: remove this section below ... consider moving 'strip' commands to release configuration above
#
# Install SDK headers and lib to /usr/local
#
#cd ..
#ARIA_SDK_INSTALL_DIR="${ARIA_SDK_INSTALL_DIR:-/usr/local}"
#echo "Install SDK to $ARIA_SDK_INSTALL_DIR .."
#sudo mkdir -p $ARIA_SDK_INSTALL_DIR/lib/aria
#sudo cp out/lib/libaria.a $ARIA_SDK_INSTALL_DIR/lib/aria
## TODO: [MG] - fix this section for shared library
## strip --strip-unneeded out/lib/libaria.so
## strip -S --strip-unneeded --remove-section=.note.gnu.gold-version --remove-section=.comment --remove-section=.note --remove-section=.note.gnu.build-id --remove-section=.note.ABI-tag out/lib/libaria.so
#sudo cp out/lib/libaria.so $ARIA_SDK_INSTALL_DIR/lib/aria
#sudo mkdir -p $ARIA_SDK_INSTALL_DIR/include/aria
#sudo cp lib/include/public/* $ARIA_SDK_INSTALL_DIR/include/aria
if [ "$CMAKE_PACKAGE_TYPE" == "tgz" ]; then
cd ..
ARIA_SDK_INSTALL_DIR="${ARIA_SDK_INSTALL_DIR:-/usr/local}"
sudo ./install.sh $ARIA_SDK_INSTALL_DIR
fi

Просмотреть файл

@ -37,7 +37,13 @@ else()
set (SQLITE3_LIB "sqlite3")
endif()
set (PLATFORM_LIBS "")
# Add flags for obtaining system UUID via IOKit
if (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
set (PLATFORM_LIBS "-framework CoreFoundation -framework IOKit")
endif()
#tcmalloc turned off by default
#target_link_libraries(HelloAria ${ARIA_SDK_LIB}/libaria.a curl z ${CMAKE_THREAD_LIBS_INIT} ${SQLITE3_LIB} dl tcmalloc)
target_link_libraries(HelloAria ${ARIA_SDK_LIB}/libaria.a curl z ${CMAKE_THREAD_LIBS_INIT} ${SQLITE3_LIB} dl)
target_link_libraries(HelloAria ${ARIA_SDK_LIB}/libaria.a curl z ${CMAKE_THREAD_LIBS_INIT} ${SQLITE3_LIB} ${PLATFORM_LIBS} dl)

Просмотреть файл

@ -1,11 +1,37 @@
#include <aria.h>
#include <stdio.h>
#include <stdlib.h>
const char *TOKEN = "6d084bbf6a9644ef83f40a77c9e34580-c2d379e0-4408-4325-9b4d-2a7d78131e14-7322";
#define API_KEY "6d084bbf6a9644ef83f40a77c9e34580-c2d379e0-4408-4325-9b4d-2a7d78131e14-7322"
void test_c_api()
{
printf("Testing C API...\n");
#if 0 // Initialize using TOKEN
evt_handle_t handle = evt_open(TOKEN);
#else // Initialize using ILogConfiguration in JSON format
// Attemppt to load an alternate impl if possible
evt_load((evt_handle_t)LoadLibrary(L"ClientTelemetry2.Dll"));
static const char* config =
"{"
"\"cacheFilePath\":\"MyOfflineStorage.db\"," // Custom storage path
"\"config\":{\"host\": \"*\"}," // Attach as guest to any host
"\"name\":\"C-API-Client-0\"," // Module ID
"\"version\":\"1.0.0\"," // Module semver
"\"primaryToken\":\"" API_KEY "\"," // Primary Token
"\"maxTeardownUploadTimeInSec\":5," // Allow up to 5 seconds for upload
"\"hostMode\":false," // Explicitly declare yourself as guest
"\"minimumTraceLevel\":0," // Debug printout level
"\"sdkmode\":0" // Aria direct-upload mode
"}";
evt_handle_t handle = evt_open(config);
#endif
// Ref. https://docs.microsoft.com/en-us/windows/privacy/basic-level-windows-diagnostic-events-and-fields for description of Common Schema fields
aria_prop event[] = ARIA_EVENT
evt_prop event[] = TELEMETRY_EVENT
(
// Common Data Extensions.Envelope - reserved keywords that C API should not use.
// Alternate solution is to declare a special macro for envelope 'root' namespace props,
@ -14,23 +40,24 @@ void test_c_api()
_STR("ver", "3.0"), // Represents the major and minor version of the extension
_STR("time", "1979-08-12"), // Represents the event date time in Coordinated Universal Time(UTC) when the event was generated on the client.This should be in ISO 8601 format
_INT("popSample", 100), // Represents the effective sample rate for this event at the time it was generated by a client
_STR("iKey", TOKEN), // Represents an ID for applications or other logical groupings of events.
// FIXME: [MG] - iKey should only be needed if logging to alternate token, otherwise we should use the primaryToken by default
_STR("iKey", API_KEY), // Represents an ID for applications or other logical groupings of events.
_INT("flags", 0xffffffff), // Represents a collection of bits that describe how the event should be processed ...
_STR("cV", "12345"), // Represents the Correlation Vector : A single field for tracking partial order of related telemetry events across component boundaries.
// Customer Data fields go as part of userdata
_STR("strKey", "value1"),
_INT("intKey", 12345),
PII_STR("piiKey", "secret", 1), // TODO: copy-paste-translate the Pii Kind enum from C++ to C
// Part "X" demo - populating CS extension props
// Common Data Extensions.App
PII_STR("ext.app.userId", "maxgolov@microsoft.com", 1),
_STR("ext.app.ver", "1.0.0")
);
aria_logevent(event);
aria_flush();
aria_upload();
aria_teardown();
}
evt_log(handle, event);
evt_flush(handle);
// FIXME: [MG] - default settings are optimized for 'fast shutdown' and not giving enough time for SDK to upload the event logged.
// However, if you restart this sample - events from a previous run get uploaded. Modify the
evt_upload(handle);
evt_close(handle);
}

Просмотреть файл

@ -164,6 +164,12 @@ extern "C" void test_c_api();
int main()
{
if (1)
{
test_c_api();
return 0;
}
#ifdef OFFICE_TEST /* Custom test for a stats crash scenario experienced by OTEL */
OfficeTest();
if (1)
@ -185,8 +191,13 @@ int main()
// config["stats"]["interval"] = 1; // uncomment for accelerated stats sent every second
#ifdef __APPLE__
config[CFG_STR_CACHE_FILE_PATH] = "/tmp/offlinestorage.db";
#else
config[CFG_STR_CACHE_FILE_PATH] = "offlinestorage.db";
config[CFG_INT_TRACE_LEVEL_MASK] = 0; 0xFFFFFFFF ^ 128;
#endif
config[CFG_INT_TRACE_LEVEL_MASK] = 0; // 0xFFFFFFFF ^ 128;
config[CFG_INT_TRACE_LEVEL_MIN] = ACTTraceLevel_Warn; // ACTTraceLevel_Info; // ACTTraceLevel_Debug;
config[CFG_INT_SDK_MODE] = SdkModeTypes::SdkModeTypes_Aria; // SdkModeTypes::SdkModeTypes_UTCCommonSchema
config[CFG_INT_MAX_TEARDOWN_TIME] = 10;
@ -196,8 +207,6 @@ int main()
config[CFG_INT_RAM_QUEUE_SIZE] = 32 * 1024 * 1024; // 32 MB heap limit for sqlite3
config[CFG_INT_CACHE_FILE_SIZE] = 16 * 1024 * 1024; // 16 MB storage file limit
// printf("LogConfiguration: %s\n", configuration.data());
printf("Adding debug event listeners...\n");
auto eventsList = {
DebugEventType::EVT_LOG_EVENT,
@ -230,6 +239,10 @@ int main()
printf("LogManager::GetSemanticContext \n");
ISemanticContext* semanticContext = LogManager::GetSemanticContext();
semanticContext->SetAppVersion("1.0.1");
semanticContext->SetAppLanguage("en-US");
// semanticContext->SetUserId("maxgolov@microsoft.com");
semanticContext->SetUserLanguage("en-US");
// Ingest events of various latencies
printf("Starting stress-test...\n");

Просмотреть файл

@ -1,12 +1,11 @@
#!/bin/bash
#
# Clean-up previous results
#
sudo rm /tmp/aria*.log
sudo rm offline*
sudo rm -f heap*
##
## Clean-up previous results
##
#sudo rm /tmp/aria*.log
#sudo rm offline*
#sudo rm -f heap*
BIN=./out/HelloAria

Просмотреть файл

@ -0,0 +1,20 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual C++ Express 2010
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HelloCAPI", "HelloCAPI.vcxproj", "{277AEB2C-E995-4A40-B63A-B16B8A3A4550}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{277AEB2C-E995-4A40-B63A-B16B8A3A4550}.Debug|Win32.ActiveCfg = Debug|Win32
{277AEB2C-E995-4A40-B63A-B16B8A3A4550}.Debug|Win32.Build.0 = Debug|Win32
{277AEB2C-E995-4A40-B63A-B16B8A3A4550}.Release|Win32.ActiveCfg = Release|Win32
{277AEB2C-E995-4A40-B63A-B16B8A3A4550}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

Просмотреть файл

@ -0,0 +1,109 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{277AEB2C-E995-4A40-B63A-B16B8A3A4550}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>HelloCAPI</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<LibraryPath>$(MSBuildProjectDirectory)\lib\$(Configuration)\$(Platform);$(VCInstallDir)lib;$(VCInstallDir)atlmfc\lib;$(WindowsSdkDir)lib;$(FrameworkSDKDir)\lib</LibraryPath>
<IncludePath>$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSdkDir)include;$(FrameworkSDKDir)\include;$(MSBuildProjectDirectory)\include</IncludePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<PreBuildEvent>
<Command>$(MSBuildProjectDirectory)\deploy-dll.cmd $(Configuration) $(Platform) $(OutDir)</Command>
</PreBuildEvent>
<PreBuildEvent>
<Message>Deploy DLLs</Message>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeaderFile>
</PrecompiledHeaderFile>
<PrecompiledHeaderOutputFile>
</PrecompiledHeaderOutputFile>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>ClientTelemetry.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<PreBuildEvent>
<Command>$(MSBuildProjectDirectory)\deploy-dll.cmd $(Configuration) $(Platform) $(OutDir)</Command>
</PreBuildEvent>
<PreBuildEvent>
<Message>Deploy DLLs</Message>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="main.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="include\aria.h" />
<ClInclude Include="include\CAPIClient.hpp" />
<ClInclude Include="include\ctmacros.hpp" />
<ClInclude Include="include\Version.h" />
</ItemGroup>
<ItemGroup>
<None Include="deploy-dll.cmd" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

Просмотреть файл

@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="main.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="include\aria.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\CAPIClient.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\ctmacros.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\Version.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="deploy-dll.cmd" />
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,16 @@
@echo off
set PROJECT_DIR=%~dp0
mkdir %PROJECT_DIR%\include
copy %PROJECT_DIR%..\..\lib\include\public\aria.h %PROJECT_DIR%\include
copy %PROJECT_DIR%..\..\lib\include\public\Version.h %PROJECT_DIR%\include
copy %PROJECT_DIR%..\..\lib\include\public\ctmacros.hpp %PROJECT_DIR%\include
mkdir %PROJECT_DIR%\lib\%1\%2
copy %PROJECT_DIR%..\..\Solutions\out\%1\%2\win32-dll\*.lib %PROJECT_DIR%\lib\%1\%2
mkdir %PROJECT_DIR%\%1\%2
copy %PROJECT_DIR%..\..\
copy %PROJECT_DIR%..\..\Solutions\out\%1\%2\win32-dll\*.* %PROJECT_DIR%\lib\%1\%2
copy %PROJECT_DIR%..\..\Solutions\out\%1\%2\win32-dll\*.* %3
exit /b 0

66
examples/HelloCAPI/main.c Normal file
Просмотреть файл

@ -0,0 +1,66 @@
#include <stdio.h>
#include <stdlib.h>
#include "aria.h"
#define API_KEY "6d084bbf6a9644ef83f40a77c9e34580-c2d379e0-4408-4325-9b4d-2a7d78131e14-7322"
char* config =
"{"
"\"cacheFilePath\":\"MyOfflineStorage.db\"," // Custom storage path
"\"config\":{\"host\": \"*\"}," // Attach as guest to any host
"\"name\":\"C-API-Client-0\"," // Module ID
"\"version\":\"1.0.0\"," // Module semver
"\"primaryToken\":\"" API_KEY "\"," // Primary Token
"\"maxTeardownUploadTimeInSec\":5," // Allow up to 5 seconds for upload
"\"hostMode\":false," // Explicitly declare yourself as guest
"\"minimumTraceLevel\":0," // Debug printout level
"\"sdkmode\":0" // Aria direct-upload mode
"}";
void test_c_api()
{
evt_handle_t handle;
evt_prop event[] = TELEMETRY_EVENT
(
// Common Data Extensions.Envelope - reserved keywords that C API should not use.
// Alternate solution is to declare a special macro for envelope 'root' namespace props,
// such as $STR, $INT, etc.
_STR("name", "Event.Name.Pure.C.vs2010"), // Represents the uniquely qualified name for the event
_STR("ver", "3.0"), // Represents the major and minor version of the extension
_STR("time", "1979-08-12"), // Represents the event date time in Coordinated Universal Time(UTC) when the event was generated on the client.This should be in ISO 8601 format
_INT("popSample", 100), // Represents the effective sample rate for this event at the time it was generated by a client
// FIXME: [MG] - iKey should only be needed if logging to alternate token, otherwise we should use the primaryToken by default
_STR("iKey", API_KEY), // Represents an ID for applications or other logical groupings of events.
_INT("flags", 0xffffffff), // Represents a collection of bits that describe how the event should be processed ...
_STR("cV", "12345"), // Represents the Correlation Vector : A single field for tracking partial order of related telemetry events across component boundaries.
// Customer Data fields go as part of userdata
_STR("strKey", "value1"),
_INT("intKey", 12345),
PII_STR("piiKey", "secret", 1), // TODO: copy-paste-translate the Pii Kind enum from C++ to C
// Part "X" demo - populating CS extension props
// Common Data Extensions.App
PII_STR("ext.app.userId", "maxgolov@microsoft.com", 1),
_STR("ext.app.ver", "1.0.0")
);
printf("Testing C API...\n");
handle = evt_open(config);
// Ref. https://docs.microsoft.com/en-us/windows/privacy/basic-level-windows-diagnostic-events-and-fields for description of Common Schema fields
evt_log(handle, event);
evt_flush(handle);
// FIXME: [MG] - default settings are optimized for 'fast shutdown' and not giving enough time for SDK to upload the event logged.
// However, if you restart this sample - events from a previous run get uploaded. Modify the
evt_upload(handle);
evt_close(handle);
}
int main(int argc, char *argv[])
{
printf("Hello, Aria C API!\n");
test_c_api();
return 0;
}

3
examples/HelloClang/.gitignore поставляемый Normal file
Просмотреть файл

@ -0,0 +1,3 @@
.vs/
include/
lib/

Просмотреть файл

@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28010.2016
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HelloClang", "HelloClang.vcxproj", "{8C0967B4-1A46-43DF-ACC5-6FEAC5E985F1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{8C0967B4-1A46-43DF-ACC5-6FEAC5E985F1}.Debug|x64.ActiveCfg = Debug|x64
{8C0967B4-1A46-43DF-ACC5-6FEAC5E985F1}.Debug|x64.Build.0 = Debug|x64
{8C0967B4-1A46-43DF-ACC5-6FEAC5E985F1}.Debug|x86.ActiveCfg = Release|x64
{8C0967B4-1A46-43DF-ACC5-6FEAC5E985F1}.Debug|x86.Build.0 = Release|x64
{8C0967B4-1A46-43DF-ACC5-6FEAC5E985F1}.Release|x64.ActiveCfg = Release|x64
{8C0967B4-1A46-43DF-ACC5-6FEAC5E985F1}.Release|x64.Build.0 = Release|x64
{8C0967B4-1A46-43DF-ACC5-6FEAC5E985F1}.Release|x86.ActiveCfg = Release|Win32
{8C0967B4-1A46-43DF-ACC5-6FEAC5E985F1}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {3636DF36-75D8-4F85-8D01-BA48BDA3BD6A}
EndGlobalSection
EndGlobal

Просмотреть файл

@ -0,0 +1,115 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{8c0967b4-1a46-43df-acc5-6feac5e985f1}</ProjectGuid>
<Keyword>Clang</Keyword>
<RootNamespace>HelloClang</RootNamespace>
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
<WindowsTargetPlatformVersion>10.0.14393.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>llvm</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>llvm</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>llvm</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>llvm</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings" />
<ImportGroup Label="Shared" />
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros" />
<ItemDefinitionGroup>
<ClCompile>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">WIN32;_DEBUG;_WINDOWS;_USRDLL;HelloClang_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">WIN32;NDEBUG;_WINDOWS;_USRDLL;HelloClang_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">_DEBUG;_WINDOWS;_USRDLL;HelloClang_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NDEBUG;_WINDOWS;_USRDLL;HelloClang_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)include</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)include</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectDir)include</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectDir)include</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">sqlite.lib;zlib.lib;wininet.lib;aria.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">sqlite.lib;zlib.lib;wininet.lib;aria.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">sqlite.lib;zlib.lib;wininet.lib;aria.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies Condition="'$(Configuration)|$(Platform)'=='Release|x64'">sqlite.lib;zlib.lib;wininet.lib;aria.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)lib\$(Configuration)\$(Platform);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)lib\$(Configuration)\$(Platform);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectDir)lib\$(Configuration)\$(Platform);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectDir)lib\$(Configuration)\$(Platform);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="main.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="include\AggregatedMetric.hpp" />
<ClInclude Include="include\aria.h" />
<ClInclude Include="include\CorrelationVector.hpp" />
<ClInclude Include="include\ctmacros.hpp" />
<ClInclude Include="include\DebugEvents.hpp" />
<ClInclude Include="include\Enums.hpp" />
<ClInclude Include="include\EventProperties.hpp" />
<ClInclude Include="include\EventProperty.hpp" />
<ClInclude Include="include\IAFDClient.hpp" />
<ClInclude Include="include\IAuthTokensController.hpp" />
<ClInclude Include="include\IBandwidthController.hpp" />
<ClInclude Include="include\IECSClient.hpp" />
<ClInclude Include="include\IHttpClient.hpp" />
<ClInclude Include="include\ILogConfiguration.hpp" />
<ClInclude Include="include\ILogger.hpp" />
<ClInclude Include="include\ILogManager.hpp" />
<ClInclude Include="include\ISemanticContext.hpp" />
<ClInclude Include="include\LogConfiguration.hpp" />
<ClInclude Include="include\LogManager.hpp" />
<ClInclude Include="include\LogManagerBase.hpp" />
<ClInclude Include="include\LogManagerProvider.hpp" />
<ClInclude Include="include\LogSessionData.hpp" />
<ClInclude Include="include\NullObjects.hpp" />
<ClInclude Include="include\TransmitProfiles.hpp" />
<ClInclude Include="include\Variant.hpp" />
<ClInclude Include="include\VariantType.hpp" />
<ClInclude Include="include\Version.hpp" />
</ItemGroup>
<ItemGroup>
<None Include="include\Version.hpp.template" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets" />
</Project>

Просмотреть файл

@ -0,0 +1,108 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="main.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="include\AggregatedMetric.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\aria.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\CorrelationVector.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\ctmacros.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\DebugEvents.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\Enums.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\EventProperties.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\EventProperty.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\IAFDClient.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\IAuthTokensController.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\IBandwidthController.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\IECSClient.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\IHttpClient.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\ILogConfiguration.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\ILogger.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\ILogManager.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\ISemanticContext.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\LogConfiguration.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\LogManager.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\LogManagerBase.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\LogManagerProvider.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\LogSessionData.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\NullObjects.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\TransmitProfiles.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\Variant.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\VariantType.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\Version.hpp">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="include\Version.hpp.template" />
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,37 @@
#include <cstdlib>
#include <cstdio>
#include "LogManager.hpp"
LOGMANAGER_INSTANCE
#define TOKEN "6d084bbf6a9644ef83f40a77c9e34580-c2d379e0-4408-4325-9b4d-2a7d78131e14-7322"
using namespace MAT;
int main(int argc, char *argv[])
{
printf("Setting up configuration...\n");
auto& config = LogManager::GetLogConfiguration();
config["name"] = "HelloAria";
config["version"] = "1.2.5";
config["config"]["host"] = "HelloAria"; // host
config["compat"]["dotType"] = false; // Legacy v1 behaviour with respect to SetType using underscore instead of a dot
config[CFG_STR_CACHE_FILE_PATH] = "offlinestorage.db";
config[CFG_INT_TRACE_LEVEL_MASK] = 0; // 0xFFFFFFFF ^ 128;
config[CFG_INT_TRACE_LEVEL_MIN] = ACTTraceLevel_Warn; // ACTTraceLevel_Info; // ACTTraceLevel_Debug;
config[CFG_INT_SDK_MODE] = SdkModeTypes::SdkModeTypes_Aria; // SdkModeTypes::SdkModeTypes_UTCCommonSchema
config[CFG_INT_MAX_TEARDOWN_TIME] = 10;
config[CFG_INT_RAM_QUEUE_SIZE] = 32 * 1024 * 1024; // 32 MB heap limit for sqlite3
config[CFG_INT_CACHE_FILE_SIZE] = 16 * 1024 * 1024; // 16 MB storage file limit
printf("LogManager::Initialize\n");
ILogger *logger = LogManager::Initialize(TOKEN);
logger->LogEvent("fooBar");
LogManager::FlushAndTeardown();
printf("[ DONE ]\n");
return 0;
}

7
install.sh Executable file
Просмотреть файл

@ -0,0 +1,7 @@
#!/bin/sh
ARIA_SDK_INSTALL_DIR=$1
echo "Install SDK to $ARIA_SDK_INSTALL_DIR"
mkdir -p $ARIA_SDK_INSTALL_DIR/lib/aria
cp out/lib/libaria.a $ARIA_SDK_INSTALL_DIR/lib
mkdir -p $ARIA_SDK_INSTALL_DIR/include/aria
cp lib/include/public/* $ARIA_SDK_INSTALL_DIR/include/aria

Просмотреть файл

@ -34,8 +34,6 @@ set(SRCS decorators/BaseDecorator.cpp
exp/ecs/ecsclient/ECSConfigCache.cpp
exp/JsonHelper.cpp
exp/EXPCommonClient.cpp
pal/NetworkInformationImpl.cpp
pal/DeviceInformationImpl.cpp
pal/InformationProviderImpl.cpp
http/HttpClientManager.cpp
http/HttpRequestEncoder.cpp
@ -57,23 +55,35 @@ if(PAL_IMPLEMENTATION STREQUAL "CPP11")
http/HttpClient.hpp
pal/PAL_CPP11.cpp
pal/PAL_CPP11.hpp
pal/linux/LinuxDeviceInformationImpl.cpp
pal/linux/LinuxNetworkInformationImpl.cpp
pal/linux/LinuxSystemInformationImpl.cpp
pal/linux/sysinfo_sources.cpp
pal/posix/DeviceInformationImpl.cpp
pal/posix/NetworkInformationImpl.cpp
pal/posix/SystemInformationImpl.cpp
pal/posix/sysinfo_sources.cpp
)
elseif(PAL_IMPLEMENTATION STREQUAL "WIN32")
# Win32 Desktop for now.
# TODO: define a separate PAL for Win10 cmake build
include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/../zlib ${CMAKE_CURRENT_SOURCE_DIR}/../sqlite)
add_definitions(-D_UNICODE -DUNICODE -DZLIB_WINAPI -DWIN32 -DARIASDK_PLATFORM_WINDOWS=1 -DARIASDK_SHARED_LIB=1 -D_ARIA_UTC_SDK -D_CRT_SECURE_NO_WARNINGS -DUSE_BOND -D_WINDOWS -D_USRDLL -DWINVER=_WIN32_WINNT_WIN7)
remove_definitions(-D_MBCS)
list(APPEND SRCS
http/HttpClient_WinInet.cpp
http/HttpClient_WinInet.hpp
http/HttpClient.hpp
pal/PAL_Win32.cpp
pal/PAL_Win32.hpp
pal/win32/WindowsDesktopDeviceInformationImpl.cpp
pal/win32/WindowsDesktopNetworkInformationImpl.cpp
pal/win32/WindowsDesktopSystemInformationImpl.cpp
pal/win32/WindowsEnvironmentInfo.cpp
pal/win32/NetworkDetector.cpp
pal/win32/UtcHelpers.cpp
system/UtcTelemetrySystem.cpp
)
else()
message(FATAL_ERROR "No platform abstraction library configured. Set PAL_IMPLEMENTATION.")
endif()
if(ARIASDK_UTC_ENABLED)
list(APPEND SRCS
utc/MicrosoftTelemetry.h
utc/traceloggingdynamic.h
utc/UtcForwarder.cpp
utc/UtcForwarder.hpp
)
endif()
create_source_files_groups_per_folder(${SRCS})

Просмотреть файл

@ -233,6 +233,9 @@ namespace ARIASDK_NS_BEGIN {
void LogManagerImpl::Configure()
{
// TODO: [MG] - this API should allow to reconfigure the instance
// at runtime using customer-provided instance of ILogConfiguration object
// without having to restart the instance.
};
@ -411,7 +414,8 @@ namespace ARIASDK_NS_BEGIN {
/// <param name="name"></param>
/// <param name="value"></param>
/// <param name="piiKind"></param>
status_t LogManagerImpl::SetContext(const std::string& name, int64_t value, PiiKind piiKind) {
status_t LogManagerImpl::SetContext(const std::string& name, int64_t value, PiiKind piiKind)
{
LOG_INFO("SetContext");
EventProperty prop(value, piiKind);
m_context.setCustomField(name, prop);
@ -424,7 +428,8 @@ namespace ARIASDK_NS_BEGIN {
/// <param name="name"></param>
/// <param name="value"></param>
/// <param name="piiKind"></param>
status_t LogManagerImpl::SetContext(const std::string& name, bool value, PiiKind piiKind) {
status_t LogManagerImpl::SetContext(const std::string& name, bool value, PiiKind piiKind)
{
LOG_INFO("SetContext");
EventProperty prop(value, piiKind);
m_context.setCustomField(name, prop);
@ -437,7 +442,8 @@ namespace ARIASDK_NS_BEGIN {
/// <param name="name"></param>
/// <param name="value"></param>
/// <param name="piiKind"></param>
status_t LogManagerImpl::SetContext(const std::string& name, time_ticks_t value, PiiKind piiKind) {
status_t LogManagerImpl::SetContext(const std::string& name, time_ticks_t value, PiiKind piiKind)
{
LOG_INFO("SetContext");
EventProperty prop(value, piiKind);
m_context.setCustomField(name, prop);
@ -450,13 +456,23 @@ namespace ARIASDK_NS_BEGIN {
/// <param name="name"></param>
/// <param name="value"></param>
/// <param name="piiKind"></param>
status_t LogManagerImpl::SetContext(const std::string& name, GUID_t value, PiiKind piiKind) {
status_t LogManagerImpl::SetContext(const std::string& name, GUID_t value, PiiKind piiKind)
{
LOG_INFO("SetContext");
EventProperty prop(value, piiKind);
m_context.setCustomField(name, prop);
return STATUS_SUCCESS;
}
/// <summary>
/// Obtain current ILogConfiguration instance associated with the LogManager
/// </summary>
ILogConfiguration & LogManagerImpl::GetLogConfiguration()
{
return m_logConfiguration;
}
ILogger* LogManagerImpl::GetLogger(std::string const& tenantToken, std::string const& source, std::string const& experimentationProject)
{
if (m_alive)
@ -547,7 +563,6 @@ namespace ARIASDK_NS_BEGIN {
return m_logSessionData.get();
}
status_t LogManagerImpl::SetExclusionFilter(const char* tenantToken, const char** filterStrings, uint32_t filterCount)
{
return m_eventFilterRegulator.SetExclusionFilter(tenantToken, filterStrings, filterCount);

Просмотреть файл

@ -31,14 +31,11 @@ namespace ARIASDK_NS_BEGIN {
class ITelemetrySystem;
class ILogManagerInternal : public ILogManager {
public:
static std::recursive_mutex managers_lock;
static std::set<ILogManager*> managers;
virtual void sendEvent(IncomingEventContextPtr const& event) = 0;
};
class Logger;
@ -65,7 +62,7 @@ namespace ARIASDK_NS_BEGIN {
virtual status_t SetTransmitProfile(TransmitProfile profile) override;
virtual status_t SetTransmitProfile(const std::string& profile) override;
virtual status_t LoadTransmitProfiles(const std::string& profiles_json) override;
virtual status_t ResetTransmitProfiles();
virtual status_t ResetTransmitProfiles() override;
virtual const std::string& GetTransmitProfileName() override;
/**
@ -101,6 +98,7 @@ namespace ARIASDK_NS_BEGIN {
virtual status_t SetContext(const std::string& name, GUID_t value, PiiKind piiKind = PiiKind_None) override;
virtual ILogConfiguration & GetLogConfiguration() override;
/**
* GetLogger method
@ -109,7 +107,7 @@ namespace ARIASDK_NS_BEGIN {
LogSessionData* GetLogSessionData() override;
ILogController *GetLogController(void);
ILogController *GetLogController(void) override;
IAuthTokensController* GetAuthTokensController() override;
@ -147,7 +145,7 @@ namespace ARIASDK_NS_BEGIN {
/// <param name="filterStrings">The filter strings.</param>
/// <param name="filterCount">The filter count.</param>
/// <returns></returns>
status_t SetExclusionFilter(const char* tenantToken, const char** filterStrings, uint32_t filterCount);
status_t SetExclusionFilter(const char* tenantToken, const char** filterStrings, uint32_t filterCount) override;
/// <summary>
@ -158,7 +156,7 @@ namespace ARIASDK_NS_BEGIN {
/// <param name="filterRates">The filter rates.</param>
/// <param name="filterCount">The filter count.</param>
/// <returns></returns>
status_t SetExclusionFilter(const char* tenantToken, const char** filterStrings, const uint32_t* filterRates, uint32_t filterCount);
status_t SetExclusionFilter(const char* tenantToken, const char** filterStrings, const uint32_t* filterRates, uint32_t filterCount) override;
/// <summary>
/// Adds the incoming event.

Просмотреть файл

@ -2,96 +2,243 @@
#define ARIASDK_DECLSPEC __declspec(dllexport)
#endif
#include <LogManager.hpp>
namespace ARIASDK_NS_BEGIN {
class ModuleCAPI : public ILogConfiguration {};
class LogManagerC : public LogManagerBase<ModuleCAPI> {};
DEFINE_LOGMANAGER(LogManagerC, ModuleCAPI);
} ARIASDK_NS_END;
#include "LogManagerProvider.hpp"
#include "aria.h"
#include "utils/Utils.hpp"
#include <map>
using namespace MAT;
static std::atomic<bool> is_inited = false;
typedef struct
{
ILogConfiguration cfg;
ILogManager * lm;
} entry;
// FIXME: [MG] - add locking around lms
std::map < evt_handle_t, entry > lms;
/**
* Obtain log manager ptr using C API handle
*/
ILogManager* GetLogManager(evt_handle_t handle)
{
auto it = lms.find(handle);
return (it != lms.end()) ?
it->second.lm :
nullptr;
}
evt_status_t aria_open(evt_context_t *ctx)
{
char* config = (char *)ctx->data;
evt_handle_t code = static_cast<evt_handle_t>(hashCode(config));
auto it = lms.find(code);
if (it != lms.end())
{
// Already open?..
//
// FIXME: [MG] - check for hashCode collisions. If there's a collision - different tenant,
// but same hash code, then keep trying with a different seed until a good unused hash is
// found.
return EALREADY;
}
if (config == nullptr)
{
// Invalid configuration
return EFAULT;
}
if (config[0] == '{')
{
// Create new configuration object from JSON
lms[code].cfg = MAT::FromJSON(config);
}
else
{
// Assume that config is a token string
std::string moduleName = "CAPI-Client-";
moduleName += std::to_string(code);
lms[code].cfg =
{
{ "name", moduleName },
{ "version", "1.0.0" },
{ "config",
{
{ "host", "*" }
}
},
{ CFG_STR_PRIMARY_TOKEN, config }
};
}
// Pass a reference to obtain or create new log manager instance
auto & cfg = lms[code].cfg;
status_t status;
ILogManager *lm = LogManagerProvider::CreateLogManager(cfg, status);
// Verify that the instance pointer is valid
if (lm == nullptr)
{
status = static_cast<status_t>(EFAULT);
}
else
{
// Remember the pointer to current ILogManager instance
lms[code].lm = lm;
}
ctx->result = (evt_status_t)status;
ctx->handle = code;
return ctx->result;
}
//
// Marashal C struct tro Aria C++ API
//
evt_status_t aria_log(evt_context_t *ctx)
{
ILogManager *lm = GetLogManager(ctx->handle);
if (lm == nullptr)
{
return ENOENT;
}
evt_prop *evt = (evt_prop*)ctx->data;
EventProperties props;
props.unpack(evt);
// TODO: should we remove the iKey from props?
auto m = props.GetProperties();
EventProperty &prop = m["iKey"];
std::string token = prop.as_string;
// TODO: should we support source passed in evt?
ILogger *logger = lm->GetLogger(token);
logger->LogEvent(props);
ctx->result = EOK;
return EOK;
}
evt_status_t aria_close(evt_context_t *ctx)
{
ILogManager *lm = GetLogManager(ctx->handle);
if (lm == nullptr)
{
return ENOENT;
}
auto & cfg = lm->GetLogConfiguration();
return (evt_status_t)LogManagerProvider::Release(cfg);
}
evt_status_t aria_pause(evt_context_t *ctx)
{
ILogManager *lm = GetLogManager(ctx->handle);
if (lm == nullptr)
{
return ENOENT;
}
return (evt_status_t)lm->PauseTransmission();
}
evt_status_t aria_resume(evt_context_t *ctx)
{
ILogManager *lm = GetLogManager(ctx->handle);
if (lm == nullptr)
{
return ENOENT;
}
return (evt_status_t)lm->ResumeTransmission();
}
evt_status_t aria_upload(evt_context_t *ctx)
{
ILogManager *lm = GetLogManager(ctx->handle);
if (lm == nullptr)
{
return ENOENT;
}
return (evt_status_t)lm->UploadNow();
}
evt_status_t aria_flush(evt_context_t *ctx)
{
ILogManager *lm = GetLogManager(ctx->handle);
if (lm == nullptr)
{
return ENOENT;
}
return (evt_status_t)lm->Flush();
}
extern "C" {
//
// TODO: expose struct LogConfiguration as a second parameter
// TODO: allow the customer to specify their module name
//
bool ARIASDK_LIBABI_CDECL aria_initialize(const char* token)
/**
* Simple stable backwards- / forward- compatible ABI interface
*/
EVTSDK_LIBABI evt_status_t EVTSDK_LIBABI_CDECL evt_api_call_default(evt_context_t *ctx)
{
if (!is_inited.exchange(true))
evt_status_t result = EFAIL;
if (ctx != nullptr)
{
switch (ctx->call)
{
case EVT_OP_LOAD:
result = ENOTSUP;
break;
// Each pure C API caller module name starts with CAPI
// with tenant token appended after dash.
std::string moduleName = "CAPI";
moduleName += "-";
moduleName += token;
case EVT_OP_UNLOAD:
result = ENOTSUP;
break;
// Obtain the current LogManagerC configuration.
// Different customers going thru the pure C API
// all get the same guest log manager for now
auto& config = LogManagerC::GetLogConfiguration();
config["name"] = moduleName;
config["version"] = "1.0";
config["config"] = { { "host", "*" } }; // Any host
return (LogManagerC::Initialize(token) != nullptr);
case EVT_OP_OPEN:
result = aria_open(ctx);
break;
case EVT_OP_CLOSE:
result = aria_close(ctx);
break;
case EVT_OP_CONFIG:
result = ENOTSUP;
break;
case EVT_OP_LOG:
result = aria_log(ctx);
break;
case EVT_OP_PAUSE:
result = aria_pause(ctx);
break;
case EVT_OP_RESUME:
result = aria_resume(ctx);
break;
case EVT_OP_UPLOAD:
result = aria_upload(ctx);
break;
case EVT_OP_FLUSH:
result = aria_flush(ctx);
break;
case EVT_OP_VERSION:
result = ENOTSUP;
break;
// Add more OPs here
default:
result = ENOTSUP;
break;
}
}
// Already initialized.
// TODO: should we log an error here?
return false;
return result;
}
//
// Marashal C struct tro Aria C++ API
//
void ARIASDK_LIBABI_CDECL aria_logevent(aria_prop* evt)
{
EventProperties props;
props.unpack(evt);
// TODO: should we remove the iKey from props?
auto m = props.GetProperties();
EventProperty &prop = m["iKey"];
std::string token = prop.as_string;
// Initialize if needed
if (!token.empty())
{
aria_initialize(token.c_str());
}
// TODO: should we support source passed in evt?
ILogger *logger = LogManagerC::GetLogger(token);
logger->LogEvent(props);
}
void ARIASDK_LIBABI_CDECL aria_teardown()
{
LogManagerC::FlushAndTeardown();
}
void ARIASDK_LIBABI_CDECL aria_pause()
{
LogManagerC::PauseTransmission();
}
void ARIASDK_LIBABI_CDECL aria_resume()
{
LogManagerC::ResumeTransmission();
}
void ARIASDK_LIBABI_CDECL aria_upload()
{
LogManagerC::UploadNow();
}
void ARIASDK_LIBABI_CDECL aria_flush()
{
LogManagerC::Flush();
}
}
}

Просмотреть файл

@ -175,7 +175,7 @@ namespace ARIASDK_NS_BEGIN {
return config[CFG_INT_MAX_TEARDOWN_TIME];
}
virtual Variant & operator[](const char* key)
virtual Variant & operator[](const char* key) override
{
return config[key]; // FIXME: [MG] - Error #116: LEAK 32 bytes
}

Просмотреть файл

@ -29,63 +29,71 @@ namespace Microsoft { namespace Applications { namespace Experimentation { names
AFDClient();
virtual ~AFDClient();
virtual void Initialize(const AFDClientConfiguration& config);
virtual void Initialize(const AFDClientConfiguration& config) override;
virtual bool AddListener(IAFDClientCallback* listener);
virtual bool AddListener(IAFDClientCallback* listener) override;
virtual bool RemoveListener(IAFDClientCallback* listener);
virtual bool RemoveListener(IAFDClientCallback* listener) override;
// Register a logger to auto-tag events sent by the logger with AFD configuration infos like ETag
virtual bool RegisterLogger(MAT::ILogger* pLoger, const std::string& agentName);
virtual bool RegisterLogger(MAT::ILogger* pLoger, const std::string& agentName) override;
virtual bool SetRequestParameters(const std::map<std::string, std::string>& requestParams);
virtual bool SetRequestParameters(const std::map<std::string, std::string>& requestParams) override;
virtual bool SetRequestHeaders(const std::map<std::string, std::string>& headerParams);
virtual bool SetRequestHeaders(const std::map<std::string, std::string>& headerParams) override;
virtual bool Start();
virtual bool Start() override;
virtual bool Stop();
virtual bool Stop() override;
virtual bool Suspend();
virtual bool Suspend() override;
virtual bool Resume(bool fetchConfig = true);
virtual bool Resume(bool fetchConfig = true) override;
virtual std::string GetETag();
virtual std::string GetETag() override;
virtual std::vector<std::string> GetFlights();
virtual std::vector<std::string> GetFlights() override;
virtual std::vector<std::string> GetFeatures();
virtual std::vector<std::string> GetFeatures() override;
virtual std::map<std::string, std::string> GetConfigs();
virtual std::map<std::string, std::string> GetConfigs() override;
virtual std::string GetSetting(const std::string& agentName, const std::string& settingPath, const std::string& defaultValue);
virtual std::string GetSetting(const std::string& agentName, const std::string& settingPath, const std::string& defaultValue) override;
virtual bool GetSetting(const std::string& agentName, const std::string& settingPath, const bool defaultValue);
virtual bool GetSetting(const std::string& agentName, const std::string& settingPath, const bool defaultValue) override;
virtual int GetSetting(const std::string& agentName, const std::string& settingPath, const int defaultValue);
virtual int GetSetting(const std::string& agentName, const std::string& settingPath, const int defaultValue) override;
virtual double GetSetting(const std::string& agentName, const std::string& settingPath, const double defaultValue);
virtual double GetSetting(const std::string& agentName, const std::string& settingPath, const double defaultValue) override;
virtual std::vector<std::string> GetSettings(const std::string& agentName, const std::string& settingPath);
virtual std::vector<std::string> GetSettings(const std::string& agentName, const std::string& settingPath) override;
virtual std::vector<int> GetSettingsAsInts(const std::string& agentName, const std::string& settingPath);
virtual std::vector<int> GetSettingsAsInts(const std::string& agentName, const std::string& settingPath) override;
virtual std::vector<double> GetSettingsAsDbls(const std::string& agentName, const std::string& settingPath);
virtual std::vector<double> GetSettingsAsDbls(const std::string& agentName, const std::string& settingPath) override;
std::vector<std::string> GetKeys(const std::string& agentName, const std::string& keysPath);
std::vector<std::string> GetKeys(const std::string& agentName, const std::string& keysPath) override;
virtual void HandleHttpCallback(Message& msg, bool& isActiveConfigUpdatedOnAFD, bool& isActiveConfigUpdatedOnAFDSaveNeeded) override;
virtual void FireClientEvent(CommonClientEventType evtType, bool fConfigUpdateFromServer) override;
virtual void HandleConfigReload(Message& msg, bool& isActiveConfigSwitched, bool& isActiveConfigSwitchedSaveNeeded) override;
virtual void HandleConfigSave(bool isActiveConfigSwitchedSaveNeeded, bool isActiveConfigUpdatedOnEXPSaveNeeded) override;
virtual void HandleUpdateClient(bool isActiveConfigSwitched, bool isActiveConfigUpdatedOnEXP, bool isActiveConfigUpdatedOnEXPSaveNeeded) override;
virtual bool FetchFromServerIfRequired() override;
virtual unsigned int GetExpiryTimeInSec() override;
virtual nlohmann::json GetActiveConfigVariant() override;
virtual void HandleHttpCallback(Message& msg, bool& isActiveConfigUpdatedOnAFD, bool& isActiveConfigUpdatedOnAFDSaveNeeded);
virtual void FireClientEvent(CommonClientEventType evtType, bool fConfigUpdateFromServer);
virtual void HandleConfigReload(Message& msg, bool& isActiveConfigSwitched, bool& isActiveConfigSwitchedSaveNeeded);
virtual void HandleConfigSave(bool isActiveConfigSwitchedSaveNeeded, bool isActiveConfigUpdatedOnEXPSaveNeeded);
virtual void HandleUpdateClient(bool isActiveConfigSwitched, bool isActiveConfigUpdatedOnEXP, bool isActiveConfigUpdatedOnEXPSaveNeeded);
virtual bool FetchFromServerIfRequired();
virtual unsigned int GetExpiryTimeInSec();
virtual nlohmann::json GetActiveConfigVariant();
virtual std::string GetAFDConfiguration() override;
virtual void SetRetryTimeFactor(int time);
virtual void SetRetryTimeFactor(int time) override;
private:
nlohmann::json _GetActiveConfigVariant();

Просмотреть файл

@ -101,7 +101,12 @@ namespace Microsoft {
char month[4] = {};
// There should be 7 valid fields scanned.
#ifdef _MSC_VER
if (7 == sscanf_s(gmt.c_str(), "%3c, %d %3c %d %d:%d:%d", wday, 3, &tms.tm_mday, month, 3, &tms.tm_year, &tms.tm_hour, &tms.tm_min, &tms.tm_sec))
#else
// There is NO sscanf_s in the standard, so we cannot use it with clang and gcc. Previous 'hack' for gcc won't work for clang
if (7 == sscanf(gmt.c_str(), "%3c, %d %3c %d %d:%d:%d", wday, &tms.tm_mday, month, &tms.tm_year, &tms.tm_hour, &tms.tm_min, &tms.tm_sec))
#endif
{
tms.tm_wday = GetDayIndex(wday);
tms.tm_mon = GetMonthIndex(month);

Просмотреть файл

@ -30,9 +30,9 @@ namespace ARIASDK_NS_BEGIN
virtual status_t SetExclusionFilter(const char* tenantToken, const char** filterStrings, uint32_t filterCount) override;
virtual status_t SetExclusionFilter(const char* tenantToken, const char** filterStrings, const uint32_t* filterRates, uint32_t filterCount) override;
virtual IEventFilter& GetTenantFilter(const std::string& normalizedTenantToken) override;
virtual void Reset();
virtual void Reset() override;
};
} ARIASDK_NS_END
#endif // !ARIA_EVENTFILTERREGULATOR_HPP
#endif // !ARIA_EVENTFILTERREGULATOR_HPP

Просмотреть файл

@ -15,7 +15,11 @@
#endif
#endif
#ifdef _WIN32
#define USE_SYNC_HTTPRESPONSE_HANDLER
#else
// Linux and Mac OS X with libcurl require an async handler for now
#endif
namespace ARIASDK_NS_BEGIN {

Просмотреть файл

@ -49,8 +49,14 @@ namespace PAL_NS_BEGIN {
/// </summary>
/// <returns>Source of power the device is using</returns>
virtual PowerSource GetPowerSource() const = 0;
/// <summary>
/// Gets the device ticket.
/// </summary>
/// <returns>Device ticket</returns>
virtual std::string GetDeviceTicket() const = 0;
};
} PAL_NS_END
#endif
#endif

Просмотреть файл

@ -0,0 +1,91 @@
#ifndef EVENTSCLIENT_HPP
#define EVENTSCLIENT_HPP
#pragma once
//
// Header-only implementation of C++03 API on top of stable C ABI
//
#include "Version.hpp"
#include "aria.h"
namespace ARIASDK_NS_BEGIN {
// TODO: [MG] - consider __fastcall for all methods here for best perf
class CAPIClient
{
protected:
evt_handle_t handle;
evt_handle_t lib;
public:
CAPIClient(evt_handle_t lib = 0) :
handle(0),
lib(lib)
{
if (lib != 0)
evt_load(lib);
}
virtual ~CAPIClient()
{
if (lib != 0)
evt_unload(lib);
}
evt_handle_t open(const char* config)
{
handle = evt_open(config);
return handle;
};
evt_status_t configure(const char* config)
{
return evt_configure(handle, config);
}
// TODO: [MG] - header-only EventProperties class?
evt_status_t log(evt_prop* evt)
{
return evt_log(handle, evt);
}
evt_status_t pause()
{
return evt_pause(handle);
}
evt_status_t resume()
{
return evt_resume(handle);
}
evt_status_t upload()
{
return evt_upload(handle);
}
evt_status_t flush()
{
return evt_flush(handle);
}
evt_status_t close()
{
return evt_close(handle);
}
const char * version()
{
// FIXME: [MG] - pass version hardcoded in our header
return evt_version("1.0.0");
}
};
} ARIASDK_NS_END
#endif

Просмотреть файл

@ -8,30 +8,34 @@
#include <vector>
#include <map>
#ifndef _WIN32
#include <sys/errno.h>
#endif
namespace ARIASDK_NS_BEGIN {
/// <summary> 
/// The status_t enumeration contains a set of status code. 
/// </summary> 
/// <summary>
/// The status_t enumeration contains a set of status code.
/// </summary>
enum status_t
{
/// <summary>General failure</summary> 
STATUS_EFAIL = -1,
/// <summary>General failure</summary>
STATUS_EFAIL = -1,
/// <summary>Success.</summary>
STATUS_SUCCESS = 0,
STATUS_SUCCESS = 0,
/// <summary>Permission denied</summary> 
STATUS_EPERM = EPERM,
/// <summary>Permission denied</summary>
STATUS_EPERM = EPERM,
/// <summary>Already done / already in progress</summary> 
/// <summary>Already done / already in progress</summary>
STATUS_EALREADY = EALREADY,
/// <summary>Not implemented or no-op</summary> 
STATUS_ENOSYS = ENOSYS,
/// <summary>Not implemented or no-op</summary>
STATUS_ENOSYS = ENOSYS,
/// <summary>Not supported.</summary> 
STATUS_ENOTSUP = ENOTSUP
/// <summary>Not supported.</summary>
STATUS_ENOTSUP = ENOTSUP
};
enum DataCategory
@ -557,4 +561,4 @@ namespace ARIASDK_NS_BEGIN {
} ARIASDK_NS_END
#endif //EVENTPRIORITY_H
#endif //EVENTPRIORITY_H

Просмотреть файл

@ -307,8 +307,8 @@ namespace ARIASDK_NS_BEGIN
#ifdef ARIA_C_API
/// Implementation of ABI-safe packing of EventProperties object
aria_prop* pack();
bool unpack(aria_prop *packed);
evt_prop* pack();
bool unpack(evt_prop *packed);
#endif
private:

Просмотреть файл

@ -113,7 +113,7 @@ namespace ARIASDK_NS_BEGIN
/// This class is used to manage the Events logging system
/// </summary>
class ARIASDK_LIBABI ILogManager :
protected ILogController,
public ILogController,
public IContextProvider,
public DebugEventDispatcher
{
@ -124,7 +124,7 @@ namespace ARIASDK_NS_BEGIN
/// </summary>
/// <param name="evt">DebugEvent</param>
/// <returns></returns>
virtual bool DispatchEvent(DebugEvent evt) = 0;
virtual bool DispatchEvent(DebugEvent evt) override = 0;
/// <summary>
/// Dispatches broadcast event to all active ILogManager instances.
@ -271,6 +271,9 @@ namespace ARIASDK_NS_BEGIN
/// <returns>A pointer to the ILogger instance.</returns>
virtual ILogger* GetLogger(std::string const& tenantToken, std::string const& source = std::string(), std::string const& experimentationProject = std::string()) = 0;
/// <summary>Retrieves the current LogManager instance configuration</summary>
virtual ILogConfiguration& GetLogConfiguration() = 0;
/// <summary>
/// Adds the event listener.
/// </summary>
@ -335,4 +338,4 @@ namespace ARIASDK_NS_BEGIN
} ARIASDK_NS_END
#endif
#endif

Просмотреть файл

@ -2,12 +2,14 @@
#define ARIA_LOGMANAGER_HPP
// Copyright (c) Microsoft. All rights reserved.
// TODO: [MG] - temporary workaround for error: ISO C++ does not permit XXX::foo to be defined as YYY::foo
// TODO: [MG] - temporary workaround for error: ISO C++ does not permit <EFBFBD>XXX::foo<6F> to be defined as <20>YYY::foo<6F>
// This error is benign and this syntax is allowed by MSVC and clang. We utilize this down there below to
// instantiate a private singleton using a macro and a template.
#pragma warning(push)
#pragma warning(disable:4459 4100 4121 4244)
#pragma warning(disable:4459 4100 4121 4244 4068)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wundefined-var-template"
#ifdef _MANAGED
#include <msclr/lock.h>
@ -32,6 +34,16 @@ public:
return STATUS_EFAIL; \
}
#define LM_SAFE_CALL_STR(method , ... ) \
{ \
LM_LOCKGUARD(stateLock()); \
if (nullptr != instance) \
{ \
return instance-> method ( __VA_ARGS__);\
} \
return ""; \
}
#define LM_SAFE_CALL_PTR(method , ... ) \
{ \
LM_LOCKGUARD(stateLock()); \
@ -338,8 +350,8 @@ namespace ARIASDK_NS_BEGIN
/// <summary>Get profile name based on built-in profile enum<summary>
/// <param name="profile">Transmit profile</param>
static const std::string& GetTransmitProfileName()
LM_SAFE_CALL_PTR(GetTransmitProfileName);
static std::string GetTransmitProfileName()
LM_SAFE_CALL_STR(GetTransmitProfileName);
/// <summary>
/// Retrieve an ISemanticContext interface through which to specify context information
@ -565,7 +577,7 @@ namespace ARIASDK_NS_BEGIN
};
// Implements LogManager<T> singleton template static members
#if defined(_MANAGED) || defined(_MSC_VER)
#if (defined(_MANAGED) || defined(_MSC_VER)) && (!defined(__clang__))
// Definition that is compatible with managed and native code compiled with MSVC.
// Unfortuantey we can't use ISO C++11 template definitions because of compiler bug
// that causes improper global static templated member initialization:
@ -580,5 +592,8 @@ namespace ARIASDK_NS_BEGIN
#endif
} ARIASDK_NS_END
#pragma clang diagnostic pop
#pragma warning(pop)
#endif

Просмотреть файл

@ -139,6 +139,12 @@ namespace ARIASDK_NS_BEGIN {
return STATUS_ENOSYS;
}
virtual ILogConfiguration& GetLogConfiguration() override
{
static ILogConfiguration nullConfig;
return nullConfig;
}
virtual const std::string & GetTransmitProfileName() override
{
static std::string nothing;
@ -246,7 +252,7 @@ namespace ARIASDK_NS_BEGIN {
return nullptr;
}
virtual ILogController* GetLogController()
virtual ILogController* GetLogController() override
{
return this;
}

Просмотреть файл

@ -8,10 +8,10 @@
#endif
// Constructor and getter for Variant type
#define VARIANT_PROP(basetype, field, typeenum) \
Variant(basetype v) : field(v), type(typeenum) {} ; \
operator basetype() { return (basetype)field; }; \
Variant& operator=(basetype v) { field = v; type = typeenum; return *this; };
#define VARIANT_PROP(basetype, field, typeenum) \
Variant(basetype v) : field(v), type(typeenum) {} ; \
operator basetype() { return (basetype)field; }; \
Variant& operator=(basetype v) { field = v; type = typeenum; return *this; };
/**
* Variant type for containers
@ -19,10 +19,10 @@
class Variant {
union {
int64_t iV;
double dV;
const char* sV;
bool bV;
int64_t iV;
double dV;
const char* sV;
bool bV;
};
// Unfortunately keeping object pointers inside the union above causes issues
@ -58,11 +58,11 @@ public:
Variant() : iV(0), type(TYPE_NULL) {};
// All integer types
VARIANT_PROP(int8_t, iV, TYPE_INT);
VARIANT_PROP(int16_t, iV, TYPE_INT);
VARIANT_PROP(int32_t, iV, TYPE_INT);
VARIANT_PROP(int64_t, iV, TYPE_INT);
VARIANT_PROP(uint8_t, iV, TYPE_INT);
VARIANT_PROP(int8_t, iV, TYPE_INT);
VARIANT_PROP(int16_t, iV, TYPE_INT);
VARIANT_PROP(int32_t, iV, TYPE_INT);
VARIANT_PROP(int64_t, iV, TYPE_INT);
VARIANT_PROP(uint8_t, iV, TYPE_INT);
VARIANT_PROP(uint16_t, iV, TYPE_INT);
VARIANT_PROP(uint32_t, iV, TYPE_INT);
VARIANT_PROP(uint64_t, iV, TYPE_INT);
@ -119,39 +119,39 @@ public:
type = other.type;
switch (other.type)
{
case TYPE_NULL:
iV = 0;
break;
case TYPE_INT:
iV = other.iV;
break;
case TYPE_DOUBLE:
dV = other.dV;
break;
case TYPE_NULL:
iV = 0;
break;
case TYPE_INT:
iV = other.iV;
break;
case TYPE_DOUBLE:
dV = other.dV;
break;
case TYPE_STRING:
type = TYPE_STRING2;
SV = (other.sV) ? other.sV : "";
break;
case TYPE_STRING:
type = TYPE_STRING2;
SV = (other.sV) ? other.sV : "";
break;
case TYPE_STRING2:
SV = other.SV;
break;
case TYPE_STRING2:
SV = other.SV;
break;
case TYPE_BOOL:
bV = other.bV;
break;
case TYPE_BOOL:
bV = other.bV;
break;
case TYPE_OBJ:
for (const auto& kv : other.mV)
{
mV[kv.first] = kv.second;
}
break;
case TYPE_OBJ:
for (const auto& kv : other.mV)
{
mV[kv.first] = kv.second;
}
break;
case TYPE_ARR:
// std::swap(aV, other.aV);
break;
case TYPE_ARR:
// std::swap(aV, other.aV);
break;
}
return *this;
@ -195,9 +195,9 @@ public:
mV.clear();
}
else
if (type == TYPE_ARR) {
aV.clear();
}
if (type == TYPE_ARR) {
aV.clear();
}
}
operator std::string&()

Просмотреть файл

@ -2,8 +2,8 @@
// WARNING: DO NOT MODIFY THIS FILE!
// Copyright (c) Microsoft. All rights reserved.
// This file has been automatically generated, manual changes will be lost.
#define BUILD_VERSION_STR "3.0.289.1"
#define BUILD_VERSION 3,0,289,1
#define BUILD_VERSION_STR "3.0.309.0"
#define BUILD_VERSION 3,0,309,0
#ifndef RESOURCE_COMPILER_INVOKED
#include <stdint.h>
@ -24,15 +24,15 @@ namespace ARIASDK_NS_BEGIN {
uint64_t const Version =
((uint64_t)3 << 48) |
((uint64_t)0 << 32) |
((uint64_t)289 << 16) |
((uint64_t)1);
((uint64_t)309 << 16) |
((uint64_t)0);
// TODO: [MG] - move declaration of ARIA_SDK_UNUSED to separate include file
#ifdef ARIASDK_UNUSED
#elif defined(__GNUC__) || defined(__clang__)
# define ARIASDK_UNUSED(x) (x) /* __attribute__((unused)) */
#elif defined(__LCLINT__)
# define ARIASDK_UNUSED(x) /*@unused@*/ x
# define ARIASDK_UNUSED(x) /**/ x
#elif defined(__cplusplus)
# define ARIASDK_UNUSED(x)
#else
@ -46,4 +46,3 @@ uint64_t const Version =
namespace PAL_NS_BEGIN { } PAL_NS_END
#endif // RESOURCE_COMPILER_INVOKED

Просмотреть файл

@ -1,87 +1,159 @@
#ifndef ARIA_H
#define ARIA_H
#ifndef TELEMETRY_EVENTS_H
#define TELEMETRY_EVENTS_H
#include <ctmacros.hpp>
#ifdef _WIN32
#include <Windows.h>
#endif
#if (_MSC_VER == 1500) || (_MSC_VER == 1600)
/* Visual Studio 2010 */
typedef __int64 int64_t;
typedef unsigned __int64 uint64_t;
typedef __int32 int32_t;
typedef unsigned __int32 uint32_t;
typedef __int16 int16_t;
typedef unsigned __int16 uint16_t;
typedef __int8 int8_t;
typedef unsigned __int8 uint8_t;
typedef int bool;
#define inline
#else
/* Other compilers with C11 support */
#include <inttypes.h>
#include <stdbool.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
#include <inttypes.h>
#include <stdbool.h>
typedef enum
{
EVT_OP_LOAD = 0x00000001,
EVT_OP_UNLOAD = 0x00000002,
EVT_OP_OPEN = 0x00000003,
EVT_OP_CLOSE = 0x00000004,
EVT_OP_CONFIG = 0x00000005,
EVT_OP_LOG = 0x00000006,
EVT_OP_PAUSE = 0x00000007,
EVT_OP_RESUME = 0x00000008,
EVT_OP_UPLOAD = 0x00000009,
EVT_OP_FLUSH = 0x0000000A,
EVT_OP_VERSION = 0x0000000B,
//
EVT_OP_MAX = EVT_OP_VERSION + 1
} evt_call_t;
typedef enum
{
// Basic types
TYPE_STRING,
TYPE_INT64,
TYPE_DOUBLE,
TYPE_TIME,
TYPE_BOOLEAN,
TYPE_GUID,
// Arrays of basic types
TYPE_STRING_ARRAY,
TYPE_INT64_ARRAY,
TYPE_DOUBLE_ARRAY,
TYPE_TIME_ARRAY,
TYPE_BOOL_ARRAY,
TYPE_GUID_ARRAY,
// NULL-type
TYPE_NULL
} aria_prop_type;
typedef struct
{
/// <summary>
/// Specifies the first eight hexadecimal digits of the GUID.
/// </summary>
uint32_t Data1;
/// <summary>
/// Specifies the first group of four hexadecimal digits.
///</summary>
uint16_t Data2;
/// <summary>
/// Specifies the second group of four hexadecimal digits.
/// </summary>
uint16_t Data3;
/// <summary>
/// An array of eight bytes.
/// The first two bytes contain the third group of four hexadecimal digits.
/// The remaining six bytes contain the final 12 hexadecimal digits.
/// </summary>
uint8_t Data4[8];
} aria_guid_t;
typedef struct aria_event aria_event;
typedef struct
{
char* name;
aria_prop_type type;
union
typedef enum
{
// Basic types
char* as_string;
int64_t as_int64;
double as_double;
bool as_bool;
aria_guid_t* as_guid;
uint64_t as_time;
// Array types are nullptr-terminated array of pointers
char** as_arr_string;
int64_t** as_arr_int64;
bool** as_arr_bool;
double** as_arr_double;
aria_guid_t** as_arr_guid;
uint64_t** as_arr_time;
} value;
uint32_t piiKind;
} aria_prop;
TYPE_STRING,
TYPE_INT64,
TYPE_DOUBLE,
TYPE_TIME,
TYPE_BOOLEAN,
TYPE_GUID,
// Arrays of basic types
TYPE_STRING_ARRAY,
TYPE_INT64_ARRAY,
TYPE_DOUBLE_ARRAY,
TYPE_TIME_ARRAY,
TYPE_BOOL_ARRAY,
TYPE_GUID_ARRAY,
// NULL-type
TYPE_NULL
} evt_prop_t;
#define ARIA_EVENT(...) { __VA_ARGS__ , { .name = NULL, .type = TYPE_NULL } }
typedef struct
{
/// <summary>
/// Specifies the first eight hexadecimal digits of the GUID.
/// </summary>
uint32_t Data1;
/// <summary>
/// Specifies the first group of four hexadecimal digits.
///</summary>
uint16_t Data2;
/// <summary>
/// Specifies the second group of four hexadecimal digits.
/// </summary>
uint16_t Data3;
/// <summary>
/// An array of eight bytes.
/// The first two bytes contain the third group of four hexadecimal digits.
/// The remaining six bytes contain the final 12 hexadecimal digits.
/// </summary>
uint8_t Data4[8];
} evt_guid_t;
// FIXME: [MG] - this should be the size of platform void*, e.g. 32 or 64 bit
typedef int64_t evt_handle_t;
typedef int32_t evt_status_t;
typedef struct evt_event evt_event;
typedef struct
{
evt_call_t call; /* In */
evt_handle_t handle; /* In / Out */
void* data; /* In / Out */
evt_status_t result; /* Out */
// TODO: add context version here?
} evt_context_t;
typedef struct
{
char* name;
evt_prop_t type;
union
{
// Basic types
char* as_string;
int64_t as_int64;
double as_double;
bool as_bool;
evt_guid_t* as_guid;
uint64_t as_time;
// Array types are nullptr-terminated array of pointers
char** as_arr_string;
int64_t** as_arr_int64;
bool** as_arr_bool;
double** as_arr_double;
evt_guid_t** as_arr_guid;
uint64_t** as_arr_time;
} value;
uint32_t piiKind;
} evt_prop;
#if (_MSC_VER == 1500) || (_MSC_VER == 1600)
/* Code to support C89 compiler, including VS2010 */
#define TELEMETRY_EVENT(...) { __VA_ARGS__ , { NULL, TYPE_NULL } }
/* With C89-style initializers, structure members must be initialized in the order declared.
...and (!) - only the first member of a union can be initialized.
Which means that we have to do the hack of C-style casting from value to char* ...
*/
#define _STR(key, val) { key, TYPE_STRING, { (char *)val } }
#define _INT(key, val) { key, TYPE_INT64, { (char *)val } }
#define _DBL(key, val) { key, TYPE_DOUBLE, { (char *)val } }
#define _BOOL(key, val) { key, TYPE_BOOLEAN, { (char *)val } }
#define _GUID(key, val) { key, TYPE_GUID, { (char *)val } }
#define _TIME(key, val) { key, TYPE_TIME, { (char *)val } }
#define PII_STR(key, val, kind) { key, TYPE_STRING, { (char *)val }, kind }
#define PII_INT(key, val, kind) { key, TYPE_INT64, { (char *)val }, kind }
#define PII_DBL(key, val, kind) { key, TYPE_DOUBLE, { (char *)val }, kind }
#define PII_BOOL(key, val, kind) { key, TYPE_BOOLEAN, { (char *)val }, kind }
#define PII_GUID(key, val, kind) { key, TYPE_GUID, { (char *)val }, kind }
#define PII_TIME(key, val, kind) { key, TYPE_TIME, { (char *)val }, kind }
#else
/* Code to support any modern C99 compiler */
#define TELEMETRY_EVENT(...) { __VA_ARGS__ , { .name = NULL, .type = TYPE_NULL } }
#define _STR(key, val) { .name = key, .type = TYPE_STRING, .value = { .as_string = val }, .piiKind = 0 }
#define _INT(key, val) { .name = key, .type = TYPE_INT64, .value = { .as_int64 = val }, .piiKind = 0 }
@ -97,16 +169,142 @@ typedef struct
#define PII_GUID(key, val, kind) { .name = key, .type = TYPE_GUID, .value = { .as_guid = val }, .piiKind = kind }
#define PII_TIME(key, val, kind) { .name = key, .type = TYPE_TIME, .value = { .as_time = val }, .piiKind = kind }
ARIASDK_LIBABI bool ARIASDK_LIBABI_CDECL aria_initialize(const char* token);
ARIASDK_LIBABI void ARIASDK_LIBABI_CDECL aria_logevent(aria_prop* evt);
ARIASDK_LIBABI void ARIASDK_LIBABI_CDECL aria_teardown();
ARIASDK_LIBABI void ARIASDK_LIBABI_CDECL aria_pause();
ARIASDK_LIBABI void ARIASDK_LIBABI_CDECL aria_resume();
ARIASDK_LIBABI void ARIASDK_LIBABI_CDECL aria_upload();
ARIASDK_LIBABI void ARIASDK_LIBABI_CDECL aria_flush();
#endif
typedef evt_status_t(EVTSDK_LIBABI_CDECL *evt_app_call_t)(evt_context_t *);
EVTSDK_LIBABI evt_status_t EVTSDK_LIBABI_CDECL evt_api_call_default(evt_context_t *ctx);
#ifdef _MSC_VER
/* User of the library may delay-load the invocation of __impl_evt_api_call to assign their own implementation */
__declspec(selectany) evt_app_call_t evt_api_call = evt_api_call_default;
#else
/* Implementation of evt_api_call can be provided by the executable module that includes this header */
__attribute__((weak)) evt_app_call_t evt_api_call = evt_api_call_default;
#endif
/*
* Load implementation of a Client Telemetry library.
*
* TODO: consider accepting a library path on Linux and Mac rather than a handle.
* Assume we accept a handle on Windows. The code to load a corresponding library
* in-proc would have to reside in customer's code.
*
*/
static inline evt_status_t evt_load(evt_handle_t handle)
{
#ifdef _WIN32
evt_app_call_t impl = (evt_app_call_t)GetProcAddress((HMODULE)handle, "evt_api_call_default");
if (impl != NULL)
{
evt_api_call = impl;
return 0;
}
// Unable to load alternate implementation
return -1;
#else
/* review this for consistency on other platforms */
evt_context_t ctx;
ctx.call = EVT_OP_LOAD;
ctx.handle = handle;
return evt_api_call(&ctx);
#endif
}
/* TODO: [MG] - we don't need to unload the routine that has been loaded... consider removal of that funciton. */
static inline evt_status_t evt_unload(evt_handle_t handle)
{
evt_context_t ctx;
ctx.call = EVT_OP_UNLOAD;
ctx.handle = handle;
return evt_api_call(&ctx);
}
static inline evt_handle_t evt_open(const char* config)
{
evt_context_t ctx;
ctx.call = EVT_OP_OPEN;
ctx.data = (void *)config;
evt_api_call(&ctx);
return ctx.handle;
}
static inline evt_status_t evt_close(evt_handle_t handle)
{
evt_context_t ctx;
ctx.call = EVT_OP_CLOSE;
ctx.handle = handle;
return evt_api_call(&ctx);
}
static inline evt_status_t evt_configure(evt_handle_t handle, const char* config)
{
evt_context_t ctx;
ctx.call = EVT_OP_CONFIG;
ctx.handle = handle;
ctx.data = (void *)config;
return evt_api_call(&ctx);
}
static inline evt_status_t evt_log(evt_handle_t handle, evt_prop* evt)
{
evt_context_t ctx;
ctx.call = EVT_OP_LOG;
ctx.handle = handle;
ctx.data = (void *)evt;
return evt_api_call(&ctx);
}
static inline evt_status_t evt_pause(evt_handle_t handle)
{
evt_context_t ctx;
ctx.call = EVT_OP_PAUSE;
ctx.handle = handle;
return evt_api_call(&ctx);
}
static inline evt_status_t evt_resume(evt_handle_t handle)
{
evt_context_t ctx;
ctx.call = EVT_OP_RESUME;
ctx.handle = handle;
return evt_api_call(&ctx);
}
static inline evt_status_t evt_upload(evt_handle_t handle)
{
evt_context_t ctx;
ctx.call = EVT_OP_UPLOAD;
ctx.handle = handle;
return evt_api_call(&ctx);
}
static inline evt_status_t evt_flush(evt_handle_t handle)
{
evt_context_t ctx;
ctx.call = EVT_OP_FLUSH;
ctx.handle = handle;
return evt_api_call(&ctx);
}
static inline const char * evt_version(const char* libSemver)
{
evt_context_t ctx;
ctx.call = EVT_OP_VERSION;
ctx.data = (void*)libSemver;
evt_api_call(&ctx);
// TODO: [MG] - make sure that the API call always returns a const char *
return (const char *)(ctx.data);
}
// TODO: [MG] - more API calls can be added later using evt_api_call(&ctx) for backwards-forward ABI compat
#ifdef __cplusplus
}
#endif
#ifdef __cplusplus
#include "CAPIClient.hpp"
#endif
#endif

Просмотреть файл

@ -69,4 +69,8 @@
#define ARCH_ARM
#endif
#define EVTSDK_LIBABI ARIASDK_LIBABI
#define EVTSDK_LIBABI_CDECL ARIASDK_LIBABI_CDECL
#define EVTSDK_SPEC ARIASDK_SPEC
#endif

Просмотреть файл

@ -50,7 +50,9 @@ namespace ARIASDK_NS_BEGIN {
}
if (m_reserved_records.size())
{
LOG_WARN("Discarding %u reserved records", m_reserved_records.size());
}
}
/// <summary>

Просмотреть файл

@ -162,7 +162,7 @@ namespace ARIASDK_NS_BEGIN {
return ::sqlite3_step(stmt);
}
int64_t sqlite3_soft_heap_limit64(int64_t N)
int64_t sqlite3_soft_heap_limit64(int64_t N) override
{
return ::sqlite3_soft_heap_limit64((sqlite3_int64)N);
}

Просмотреть файл

@ -1,19 +0,0 @@
#include "DeviceInformationImpl.hpp"
namespace PAL_NS_BEGIN {
///// IDeviceInformation API
int DeviceInformationImpl::RegisterInformationChangedCallback(IPropertyChangedCallback* pCallback)
{
m_registredCount++;
return m_info_helper.RegisterInformationChangedCallback(pCallback);
}
void DeviceInformationImpl::UnRegisterInformationChangedCallback(int callbackToken)
{
--m_registredCount;
m_info_helper.UnRegisterInformationChangedCallback(callbackToken);
}
} PAL_NS_END

Просмотреть файл

@ -1,6 +1,6 @@
#ifndef DEVICEINFORMATIONIMPL_HPP
#define DEVICEINFORMATIONIMPL_HPP
// Copyright (c) Microsoft. All rights reserved.
#include <pal/PAL.hpp>
#include "Enums.hpp"
@ -16,17 +16,25 @@ namespace PAL_NS_BEGIN {
public:
static IDeviceInformation* Create();
// IInformationProvider API
virtual int RegisterInformationChangedCallback(PAL::IPropertyChangedCallback* pCallback) override;
virtual void UnRegisterInformationChangedCallback(int callbackToken) override;
virtual int RegisterInformationChangedCallback(PAL::IPropertyChangedCallback* pCallback) override
{
m_registredCount++;
return m_info_helper.RegisterInformationChangedCallback(pCallback);
}
virtual void UnRegisterInformationChangedCallback(int callbackToken) override
{
--m_registredCount;
m_info_helper.UnRegisterInformationChangedCallback(callbackToken);
}
// IDeviceInformation API
virtual std::string const& GetDeviceId() const { return m_device_id; }
virtual std::string const& GetManufacturer() const { return m_manufacturer; }
virtual std::string const& GetModel() const { return m_model; }
virtual OsArchitectureType GetOsArchitectureType() const { return m_os_architecture; }
virtual PowerSource GetPowerSource() const { return m_powerSource; }
virtual std::string GetDeviceTicket();
virtual std::string const& GetDeviceId() const override { return m_device_id; }
virtual std::string const& GetManufacturer() const override { return m_manufacturer; }
virtual std::string const& GetModel() const override { return m_model; }
virtual OsArchitectureType GetOsArchitectureType() const override { return m_os_architecture; }
virtual PowerSource GetPowerSource() const override { return m_powerSource; }
virtual std::string GetDeviceTicket() const override;
private:
std::string m_device_id;

Просмотреть файл

@ -1,7 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
#include "pal/PAL.hpp"
#include "InformationProviderImpl.hpp"
#include <vector>
#ifdef _WIN32

Просмотреть файл

@ -1,6 +1,6 @@
#ifndef INFORMATIONPROVIDERIMPL_HPP
#define INFORMATIONPROVIDERIMPL_HPP
// Copyright (c) Microsoft Corporation. All rights reserved.
#include <pal/PAL.hpp>
#include <IInformationProvider.hpp>

Просмотреть файл

@ -1,21 +0,0 @@
#include "NetworkInformationImpl.hpp"
namespace PAL_NS_BEGIN {
bool NetworkInformationImpl::IsEthernetAvailable()
{
return false;
}
bool NetworkInformationImpl::IsWifiAvailable()
{
return false;
}
bool NetworkInformationImpl::IsWwanAvailable()
{
return false;
}
} PAL_NS_END

Просмотреть файл

@ -1,3 +1,4 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
#pragma once
#include "pal/PAL.hpp"
#include "Enums.hpp"
@ -24,9 +25,9 @@ namespace PAL_NS_BEGIN {
virtual NetworkType GetNetworkType() { return m_type; }
virtual NetworkCost GetNetworkCost() { return m_cost; }
virtual bool IsEthernetAvailable();
virtual bool IsWifiAvailable();
virtual bool IsWwanAvailable();
virtual bool IsEthernetAvailable() { return false; }
virtual bool IsWifiAvailable() { return false; }
virtual bool IsWwanAvailable() { return false; }
NetworkInformationImpl();
virtual ~NetworkInformationImpl();

Просмотреть файл

@ -1,5 +1,4 @@
// Copyright (c) Microsoft. All rights reserved.
// Copyright (c) Microsoft Corporation. All rights reserved.
#pragma once
#include <Version.hpp>

Просмотреть файл

@ -1,5 +1,4 @@
// Copyright (c) Microsoft. All rights reserved.
// Copyright (c) Microsoft Corporation. All rights reserved.
#include "PAL.hpp"
#ifdef ARIASDK_PAL_CPP11
#include "ILogManager.hpp"
@ -87,7 +86,11 @@ namespace PAL_NS_BEGIN {
namespace detail {
#ifdef NDEBUG
LogLevel g_logLevel = LogLevel::Error;
#else
LogLevel g_logLevel = LogLevel::Detail;
#endif
#define DBG_BUFFER_LEN 2048
@ -279,9 +282,17 @@ namespace PAL_NS_BEGIN {
m_hThread.detach();
}
catch (...) {};
assert(m_queue.empty());
// FIXME: [MG] - investigate why sometimes we shutdown on non-empty queue?!
assert(m_timerQueue.empty());
// TODO: [MG] - investigate how often that happens.
// Side-effect is that we have a queued work item discarded on shutdown.
if (!m_queue.empty())
{
LOG_WARN("m_queue is not empty!");
}
if (!m_timerQueue.empty())
{
LOG_WARN("m_timerQueue is not empty!");
}
}
void queue(detail::WorkerThreadItemPtr item)
@ -336,11 +347,14 @@ namespace PAL_NS_BEGIN {
protected:
static void threadFunc(void* lpThreadParameter)
{
uint64_t wakeupCount = 0;
WorkerThread* self = reinterpret_cast<WorkerThread*>(lpThreadParameter);
LOG_INFO("Running thread %u", std::this_thread::get_id());
detail::WorkerThreadItemPtr item = nullptr;
for (;;) {
wakeupCount++;
unsigned nextTimerInMs = UINT_MAX;
{
LOCKGUARD(self->m_lock);
@ -361,16 +375,16 @@ namespace PAL_NS_BEGIN {
}
if (!item) {
self->m_event.wait(nextTimerInMs);
Sleep(100);
if (!self->m_event.Reset())
self->m_event.wait(nextTimerInMs);
continue;
}
if (item->type == detail::WorkerThreadItem::Shutdown) {
break;
break; // TODO: [MG] - delete item
}
LOG_TRACE("Execute item=%p type=%s\n", item, item->typeName.c_str() );
LOG_TRACE("%10llu Execute item=%p type=%s\n", wakeupCount, item, item->typeName.c_str() );
self->m_itemInProgress = item;
(*item)();
self->m_itemInProgress = nullptr;
@ -436,6 +450,7 @@ namespace PAL_NS_BEGIN {
return getUtcSystemTimeMs() / 1000;
}
// TODO: [MG] - use time_ticks_t for that
int64_t getUtcSystemTimeinTicks()
{
#ifdef _WIN32
@ -482,10 +497,9 @@ namespace PAL_NS_BEGIN {
}
char buf[sizeof("YYYY-MM-DDTHH:MM:SS.sssZ") + 1] = { 0 };
int rc = snprintf(buf, sizeof(buf), "%04d-%02d-%02dT%02d:%02d:%02d.%03dZ",
snprintf(buf, sizeof(buf), "%04d-%02d-%02dT%02d:%02d:%02d.%03dZ",
1900 + tm.tm_year, 1 + tm.tm_mon, tm.tm_mday,
tm.tm_hour, tm.tm_min, tm.tm_sec, milliseconds);
(rc);
#endif
return buf;
}
@ -550,15 +564,25 @@ namespace PAL_NS_BEGIN {
void unregisterSemanticContext(ISemanticContext* context)
{
UNREFERENCED_PARAMETER(context);
OACR_USE_PTR(this);
}
// FIXME: [MG] - This isn't the most elegant way of OS name detection
#undef OS_NAME
#ifdef __APPLE__
#define OS_NAME "MacOSX"
#else
#define OS_NAME "Linux"
#endif
// FIXME: [MG] - we'd be rolling out SKU without ECS for 3r parties
#define ECS_SUPP "ECS"
//---
// TODO: [MG] - make it portable...
std::string getSdkVersion()
{
// TODO: [MG] - move this code to common PAL code
return std::string(ARIASDK_VERSION_PREFIX "-Linux-C++-No-") + BUILD_VERSION_STR;
return std::string(ARIASDK_VERSION_PREFIX "-" OS_NAME "-C++-" ECS_SUPP "-") + BUILD_VERSION_STR;
}
//---

Просмотреть файл

@ -1,4 +1,4 @@
// Copyright (c) Microsoft. All rights reserved.
// Copyright (c) Microsoft Corporation. All rights reserved.
#ifndef PAL_CPP11_HPP
#define PAL_CPP11_HPP
@ -41,7 +41,7 @@
namespace ARIASDK_NS_BEGIN {
extern void print_backtrace();
}ARIASDK_NS_END
} ARIASDK_NS_END
#ifdef _WIN32
#define PATH_SEPARATOR_CHAR '\\'
@ -88,13 +88,13 @@ namespace PAL_NS_BEGIN {
if (millis == UINT_MAX)
{
std::unique_lock< std::mutex > lock(m_mutex);
m_condition.wait(lock, [&]()->bool {return m_bFlag;});
m_condition.wait(lock, [&]()->bool {return m_bFlag; });
return true;
}
auto crRelTime = std::chrono::milliseconds(millis);
std::unique_lock<std::mutex> ulock(m_mutex);
if (!m_condition.wait_for(ulock, crRelTime, [&]()->bool {return m_bFlag;}))
if (!m_condition.wait_for(ulock, crRelTime, [&]()->bool {return m_bFlag; }))
return false;
return true;
}
@ -120,7 +120,7 @@ namespace PAL_NS_BEGIN {
return bWasSignalled;
}
inline bool IsSet() const {return m_bFlag;}
inline bool IsSet() const { return m_bFlag; }
};
@ -133,7 +133,7 @@ namespace PAL_NS_BEGIN {
class WorkerThreadItem
{
public:
volatile enum {Shutdown, Call, TimedCall, Done}type;
volatile enum { Shutdown, Call, TimedCall, Done } type;
int64_t targetTime;
virtual ~WorkerThreadItem() {}
virtual void operator()() {}
@ -151,11 +151,11 @@ namespace PAL_NS_BEGIN {
WorkerThreadCall(TCall& call) :
WorkerThreadItem(),
m_call(call)
{
{
this->typeName = __typename(call);
this->type = WorkerThreadItem::Call;
this->targetTime = -1;
}
}
WorkerThreadCall(TCall& call, int64_t targetTime) :
WorkerThreadItem(),
@ -190,9 +190,9 @@ namespace PAL_NS_BEGIN {
public:
detail::WorkerThreadItemPtr m_item;
DeferredCallbackHandle(detail::WorkerThreadItemPtr item) : m_item(item) {};
DeferredCallbackHandle(detail::WorkerThreadItemPtr item) : m_item(item) { };
DeferredCallbackHandle() : m_item(nullptr) {};
DeferredCallbackHandle(const DeferredCallbackHandle& h) : m_item(h.m_item) {};
DeferredCallbackHandle(const DeferredCallbackHandle& h) : m_item(h.m_item) { };
void cancel()
{
if (m_item)
@ -259,8 +259,8 @@ namespace PAL_NS_BEGIN {
}
protected:
std::default_random_engine m_engine {std::random_device()()};
std::uniform_real_distribution<double> m_distribution {0.0, 1.0};
std::default_random_engine m_engine{ std::random_device()() };
std::uniform_real_distribution<double> m_distribution{ 0.0, 1.0 };
#else /* Unfortunately the functionality above fails memory checker on Linux with gcc-5 */
public:
double getRandomDouble()
@ -285,6 +285,8 @@ namespace PAL_NS_BEGIN {
void unregisterSemanticContext(ISemanticContext * context);
// Convert various numeric types and bool to string in an uniform manner.
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-value"
template<typename T>// , typename Check = std::enable_if<std::is_arithmetic<T>::value || std::is_same<T, bool>::value, void>::type>
std::string to_string(char const* format, T value)
{
@ -292,13 +294,13 @@ namespace PAL_NS_BEGIN {
// This function is private so it will only be called for numeric types.
static const int buf_size = 33;
char buf[buf_size] = {0};
int rc = snprintf(buf, buf_size, format, value);
(rc);
snprintf(buf, buf_size, format, value);
return std::string(buf);
}
// Return SDK version in Aria schema "<Prefix>-<Platform>-<SKU>-<Projection>-<BuildVersion>".
std::string getSdkVersion();
#pragma clang diagnostic pop
} PAL_NS_END

Просмотреть файл

@ -1,5 +1,4 @@
// Copyright (c) Microsoft. All rights reserved.
// Copyright (c) Microsoft Corporation. All rights reserved.
#include "PAL.hpp"
#include <rtnet/rtnet_interface.hpp>
#include <list>

Просмотреть файл

@ -1,5 +1,4 @@
// Copyright (c) Microsoft. All rights reserved.
// Copyright (c) Microsoft Corporation. All rights reserved.
#pragma once
#include <aria/ISemanticContext.hpp>
#include <aria/Utils.hpp>

Просмотреть файл

@ -1,5 +1,4 @@
// Copyright (c) Microsoft. All rights reserved.
// Copyright (c) Microsoft Corporation. All rights reserved.
#include "PAL.hpp"
#ifdef ARIASDK_PAL_WIN32
#include "ILogManager.hpp"

Просмотреть файл

@ -1,5 +1,4 @@
// Copyright (c) Microsoft. All rights reserved.
// Copyright (c) Microsoft Corporation. All rights reserved.
#pragma once
#include "SystemInformationImpl.hpp"
#include "NetworkInformationImpl.hpp"
@ -283,7 +282,7 @@ namespace PAL_NS_BEGIN {
void unregisterSemanticContext(ISemanticContext * context);
// Convert various numeric types and bool to string in an uniform manner.
template<typename T, typename Check = std::enable_if<std::is_arithmetic<T>::value || std::is_same<T, bool>::value, void>::type>
template<typename T>
std::string to_string(char const* format, T value)
{
// TODO: [MG] - sync with Linux implementation

Просмотреть файл

@ -1,6 +1,6 @@
#ifndef SYSTEMINFORMATIONIMPL_HPP
#define SYSTEMINFORMATIONIMPL_HPP
// Copyright (c) Microsoft Corporation. All rights reserved.
#include <pal/PAL.hpp>
#include "ISystemInformation.hpp"
@ -23,19 +23,19 @@ namespace PAL_NS_BEGIN {
virtual void UnRegisterInformationChangedCallback(int callbackToken) override;
// ISystemInformation API
virtual std::string const& GetAppId() const { return m_app_id; };
virtual std::string const& GetAppVersion() const { return m_app_version; }
virtual std::string const& GetAppLanguage() const { return m_app_language; }
virtual std::string const& GetAppId() const override { return m_app_id; };
virtual std::string const& GetAppVersion() const override { return m_app_version; }
virtual std::string const& GetAppLanguage() const override { return m_app_language; }
virtual std::string const& GetOsFullVersion() const { return m_os_full_version; };
virtual std::string const& GetOsMajorVersion() const { return m_os_major_version; };
virtual std::string const& GetOsName() const { return m_os_name; };
virtual std::string const& GetOsFullVersion() const override { return m_os_full_version; };
virtual std::string const& GetOsMajorVersion() const override { return m_os_major_version; };
virtual std::string const& GetOsName() const override { return m_os_name; };
virtual std::string const& GetUserLanguage() const { return m_user_language; };
virtual std::string const& GetUserTimeZone() const { return m_user_timezone; };
virtual std::string const& GetUserAdvertisingId() const { return m_user_advertising_id; };
virtual std::string const& GetUserLanguage() const override { return m_user_language; };
virtual std::string const& GetUserTimeZone() const override { return m_user_timezone; };
virtual std::string const& GetUserAdvertisingId() const override { return m_user_advertising_id; };
virtual std::string const& GetDeviceClass() const { return m_device_class; };
virtual std::string const& GetDeviceClass() const override { return m_device_class; };
private:
std::string m_app_id;

Просмотреть файл

@ -1,4 +1,5 @@
#ifdef _WIN32
// Copyright (c) Microsoft Corporation. All rights reserved.
#pragma once
#include "utils/Utils.hpp"

Просмотреть файл

@ -1,3 +1,4 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
#define LOG_MODULE DBG_API
#include "pal/PAL.hpp"
#include "pal/DeviceInformationImpl.hpp"
@ -46,7 +47,7 @@ namespace PAL_NS_BEGIN {
}
std::string DeviceInformationImpl::GetDeviceTicket()
std::string DeviceInformationImpl::GetDeviceTicket() const
{
return m_deviceTicket;
}

Просмотреть файл

@ -1,3 +1,4 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
#define LOG_MODULE DBG_PAL
#include "pal/PAL.hpp"
#include "pal/NetworkInformationImpl.hpp"
@ -8,7 +9,7 @@ namespace PAL_NS_BEGIN {
NetworkInformationImpl::~NetworkInformationImpl() {};
class LinuxNetworkInformation : public NetworkInformationImpl
class NetworkInformation : public NetworkInformationImpl
{
std::string m_network_provider;
@ -17,12 +18,12 @@ namespace PAL_NS_BEGIN {
///
/// </summary>
/// <param name="pal"></param>
LinuxNetworkInformation();
NetworkInformation();
/// <summary>
///
/// </summary>
virtual ~LinuxNetworkInformation();
virtual ~NetworkInformation();
/// <summary>
/// Gets the current network provider for the device
@ -58,20 +59,20 @@ namespace PAL_NS_BEGIN {
}
};
LinuxNetworkInformation::LinuxNetworkInformation() :
NetworkInformation::NetworkInformation() :
NetworkInformationImpl()
{
m_type = NetworkType_Wired;
m_cost = NetworkCost_Unmetered;
}
LinuxNetworkInformation::~LinuxNetworkInformation()
NetworkInformation::~NetworkInformation()
{
}
INetworkInformation* NetworkInformationImpl::Create()
{
return new LinuxNetworkInformation();
return new NetworkInformation();
}
} PAL_NS_END

Просмотреть файл

@ -1,3 +1,4 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
#include "pal/PAL.hpp"
#include "pal/SystemInformationImpl.hpp"

Просмотреть файл

@ -1,5 +1,4 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
/*
* sysinfo_sources.cpp
*
@ -30,9 +29,40 @@
#include <stdexcept>
#include <string>
#include <array>
#include <vector>
#include "EventProperty.hpp"
#ifdef __APPLE__
#include <IOKit/IOKitLib.h>
#include <mach-o/dyld.h>
#include <sys/syslimits.h>
#include <libgen.h>
// This would be better than int gethostuuid(uuid_t id, const struct timespec *wait);
void get_platform_uuid(char * buf, int bufSize)
{
io_registry_entry_t ioRegistryRoot = IORegistryEntryFromPath(kIOMasterPortDefault, "IOService:/");
CFStringRef uuidCf = (CFStringRef) IORegistryEntryCreateCFProperty(ioRegistryRoot, CFSTR(kIOPlatformUUIDKey), kCFAllocatorDefault, 0);
IOObjectRelease(ioRegistryRoot);
CFStringGetCString(uuidCf, buf, bufSize, kCFStringEncodingMacRoman);
CFRelease(uuidCf);
}
std::string get_app_name()
{
std::vector<char> appId(PATH_MAX+1, 0);
uint32_t length = 0;
if(_NSGetExecutablePath(&appId[0], &length))
{
appId.resize(length, 0);
_NSGetExecutablePath(&appId[0], &length);
}
std::string result = basename(appId.data());
return result;
}
#endif
/**
* Read file contents
*
@ -79,27 +109,30 @@ static std::string Exec(const char* cmd)
*/
bool sysinfo_sources::fetch(std::string key)
{
for(auto &kv : (*this))
{
if(kv.first == key)
{
std::string contents = ReadFile(kv.second.path);
if((kv.second.selector == "*") || (kv.second.selector == ""))
{
cache[key] = contents;
return true;
}
// Run regexp
std::regex selector_regex(kv.second.selector);
std::smatch match;
if(std::regex_search(contents, match, selector_regex))
{
cache[key] = match[1];
return true;
}
}
}
return false;
for(auto &kv : (*this))
{
if(kv.first == key)
{
const std::string star("*");
const std::string empty("");
std::string contents = ReadFile(kv.second.path);
if((kv.second.selector == star) || (kv.second.selector == empty))
{
cache[key] = contents;
return true;
}
// Run regexp
std::regex selector_regex(kv.second.selector);
std::smatch match;
if(std::regex_search(contents, match, selector_regex))
{
cache[key] = match[1];
return true;
}
}
}
return false;
}
/**
@ -164,6 +197,12 @@ public:
add("devModel", { "/proc/registry/HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Control/SystemInformation/SystemProductName", "*"});
#endif
#if defined(__APPLE__)
// FIXME: [MG] - This is not the most elegant way of obtaining it
cache["devMake"] = "Apple";
cache["devModel"] = Exec("sysctl hw.model | awk '{ print $2 }'");
#endif
// Fallback to uname if above methods failed
if (!get("osVer").compare(""))
{
@ -180,8 +219,20 @@ public:
cache["osRel"] = (const char *)(buf.release);
}
#ifndef __APPLE__
add("appId", {"/proc/self/cmdline", "(.*)[ ]*.*[\n]*"});
#else
cache["appId"] = get_app_name(); // TODO: [MG] - verify this path
#endif
if (!get("devId").compare(""))
{
#ifdef __APPLE__
// std::string contents = Exec("ioreg -d2 -c IOPlatformExpertDevice | awk -F\" '/IOPlatformUUID/{print $(NF-1)}'");
char deviceId[512] = { 0 };
get_platform_uuid(deviceId, sizeof(deviceId));
cache["devId"] = MAT::GUID_t(deviceId).to_string(); // TODO: [MG] - do we need to prepend i:{...} here?
#else
// We were unable to obtain Device Id using standard means.
// Try to use hash of blkid + hostname instead. Both blkid
// and hostname would rarely change, as well as guarantee
@ -196,9 +247,9 @@ public:
}
cache["devId"] = MAT::GUID_t(guid_bytes).to_string();
}
#endif
}
add("appId", {"/proc/self/cmdline", "(.*)[ ]*.*[\n]*"});
}
};

Просмотреть файл

@ -1,6 +1,5 @@
#ifndef LIB_PAL_LINUX_SYSINFO_SOURCES_HPP_
#define LIB_PAL_LINUX_SYSINFO_SOURCES_HPP_
#ifndef LIB_PAL_POSIX_SYSINFO_SOURCES_HPP_
#define LIB_PAL_POSIX_SYSINFO_SOURCES_HPP_
// Copyright (c) Microsoft Corporation. All rights reserved.
#include <map>
@ -59,4 +58,4 @@ public:
extern sysinfo_sources aria_hwinfo;
#endif /* LIB_PAL_LINUX_SYSINFO_SOURCES_HPP_ */
#endif /* LIB_PAL_POSIX_SYSINFO_SOURCES_HPP_ */

Просмотреть файл

@ -1,6 +1,6 @@
#ifndef TYPENAME_HPP
#define TYPENAME_HPP
// Copyright (c) Microsoft Corporation. All rights reserved.
#include <string>
#include <typeinfo>

Просмотреть файл

@ -98,7 +98,7 @@ namespace PAL_NS_BEGIN {
return converterX.to_bytes(wstr);
}
std::string DeviceInformationImpl::GetDeviceTicket()
std::string DeviceInformationImpl::GetDeviceTicket() const
{
return m_deviceTicket;
}

Просмотреть файл

@ -1,3 +1,4 @@
// Copyright (c) Microsoft. All rights reserved.
#include "Version.hpp"
#include "WindowsEnvironmentInfo.h"
#include <Windows.h>

Просмотреть файл

@ -1,3 +1,4 @@
// Copyright (c) Microsoft. All rights reserved.
#pragma once
#include "Enums.hpp"
#include <string>

Просмотреть файл

@ -106,7 +106,7 @@ namespace PAL_NS_BEGIN {
#endif
}
std::string DeviceInformationImpl::GetDeviceTicket()
std::string DeviceInformationImpl::GetDeviceTicket() const
{
return m_deviceTicket;
}

Просмотреть файл

@ -361,7 +361,7 @@ namespace ARIASDK_NS_BEGIN {
}
#ifdef ARIA_C_API
static inline void cppprop_to_cprop(EventProperty &rhs, aria_prop &lhs)
static inline void cppprop_to_cprop(EventProperty &rhs, evt_prop &lhs)
{
switch (rhs.type)
{
@ -381,7 +381,7 @@ namespace ARIASDK_NS_BEGIN {
lhs.value.as_bool = rhs.as_bool;
break;
case TYPE_GUID:
lhs.value.as_guid = new aria_guid_t();
lhs.value.as_guid = new evt_guid_t();
// TODO: copy from GUID_t to aria_guid_t
break;
#if 0
@ -403,10 +403,10 @@ namespace ARIASDK_NS_BEGIN {
}
}
aria_prop* EventProperties::pack()
evt_prop* EventProperties::pack()
{
size_t size = m_storage->Properties.size() + m_storage->PropertiesPartB.size() + 1;
aria_prop * result = (aria_prop *)calloc(sizeof(aria_prop), size);
evt_prop * result = static_cast<evt_prop *>(calloc(sizeof(evt_prop), size));
size_t i = 0;
for(auto &props : { m_storage->Properties, m_storage->PropertiesPartB })
for (auto &kv : props)
@ -414,7 +414,7 @@ namespace ARIASDK_NS_BEGIN {
auto k = kv.first;
auto v = kv.second;
result[i].name = (char *)k.c_str();
result[i].type = (aria_prop_type)v.type;
result[i].type = static_cast<evt_prop_t>(v.type);
result[i].piiKind = v.piiKind;
cppprop_to_cprop(v, result[i]);
};
@ -422,14 +422,14 @@ namespace ARIASDK_NS_BEGIN {
return result;
}
bool EventProperties::unpack(aria_prop *packed)
bool EventProperties::unpack(evt_prop *packed)
{
// List of attributes going into envelope section
static const std::string keyName = "name";
static const std::string keyTime = "time";
static const std::string keyPopSample = "popSample";
aria_prop *curr = packed;
evt_prop *curr = packed;
for (size_t i = 0; curr->type != TYPE_NULL; i++, curr++)
{
// Event name
@ -487,7 +487,6 @@ namespace ARIASDK_NS_BEGIN {
break;
}
}
(packed);
return true;
}
#endif /* end of ARIA_C_API */

Просмотреть файл

@ -278,6 +278,31 @@ namespace ARIASDK_NS_BEGIN {
as_stringArray = new std::vector<std::string>(*source->as_stringArray);
break;
}
case TYPE_GUID:
{
as_guid = source->as_guid;
break;
}
case TYPE_INT64:
{
as_int64 = source->as_int64;
break;
}
case TYPE_DOUBLE:
{
as_double = source->as_double;
break;
}
case TYPE_TIME:
{
as_time_ticks = source->as_time_ticks;
break;
}
case TYPE_BOOLEAN:
{
as_bool = source->as_bool;
break;
}
}
}
@ -289,6 +314,7 @@ namespace ARIASDK_NS_BEGIN {
EventProperty::EventProperty(const EventProperty& source) :
type(source.type)
{
// TODO: [MG] - memcpy is probably no longer needed here
memcpy((void*)this, (void*)&source, sizeof(EventProperty));
copydata(&source);
}
@ -300,6 +326,7 @@ namespace ARIASDK_NS_BEGIN {
EventProperty::EventProperty(EventProperty&& source) /* noexcept */ :
type(source.type)
{
// TODO: [MG] - memcpy is probably no longer needed here
memcpy((void*)this, (void*)&source, sizeof(EventProperty));
copydata(&source);
}

Просмотреть файл

@ -91,12 +91,14 @@ Example:
#include <evntprov.h>
#ifndef __clang__
// Enum declaration may be missing from older evntprov.h:
enum _EVENT_INFO_CLASS
#if !defined(__INTELLISENSE__) && defined(__cplusplus) && (_MSC_VER >= 1700)
: int // base type for enum forward declaration
#endif
;
#endif
/*
Macro MICROSOFTTELEMETRY_EVENT_SET_INFORMATION:

Просмотреть файл

@ -110,9 +110,8 @@ namespace ARIASDK_NS_BEGIN {
m_done.post();
};
virtual void handleIncomingEventPrepared(IncomingEventContextPtr const& event) override
virtual void handleIncomingEventPrepared(IncomingEventContextPtr const&) override
{
(event);
};
virtual void preparedIncomingEventAsync(IncomingEventContextPtr const& event) override
@ -129,7 +128,7 @@ namespace ARIASDK_NS_BEGIN {
/// Gets the log manager.
/// </summary>
/// <returns></returns>
ILogManager& getLogManager()
ILogManager& getLogManager() override
{
return m_logManager;
}
@ -138,12 +137,12 @@ namespace ARIASDK_NS_BEGIN {
/// Gets the configuration.
/// </summary>
/// <returns></returns>
IRuntimeConfig& getConfig()
IRuntimeConfig& getConfig() override
{
return m_config;
}
ISemanticContext& getContext()
ISemanticContext& getContext() override
{
return m_logManager.GetSemanticContext();
}
@ -177,4 +176,4 @@ namespace ARIASDK_NS_BEGIN {
} ARIASDK_NS_END
#endif
#endif

Просмотреть файл

@ -16,17 +16,21 @@ Environment:
--*/
// TODO: [MG] - verify this header against the latest version in //depot/*/publicint/onecoreuapbase/inc/traceloggingdynamic.h
#pragma once
#include <windows.h>
//#include <winapifamily.h>
#include <evntprov.h>
// Enum declaration may be missing from older evntprov.h:
// XXX: [MG] - workaround for clang compiler not liking enum redifinition here
#ifndef __clang__
enum _EVENT_INFO_CLASS
#if !defined(__INTELLISENSE__) && defined(__cplusplus) && (_MSC_VER >= 1700)
: int // base type for enum forward declaration
#endif
;
#endif
namespace tld
{
@ -300,9 +304,7 @@ namespace tld
It is ok to create an array of nested structures where fields in the
structure have TypeNone or TypeBinary.
*/
#pragma warning(push)
#pragma warning(disable:4471) //a forward declaration of an unscoped enumeration must have an underlying type. Not fixing Windows code.
enum Type;
enum Type : UINT16;
/*
Used for composing Type values.
@ -318,7 +320,7 @@ namespace tld
The comments for each InType value indicate the payload encoding rules and
the OutTypes that are most likely to be usable with this InType.
*/
enum InType;
enum InType : UINT8;
/*
Used for composing Type values.
@ -339,7 +341,7 @@ namespace tld
consumer. The most commonly-supported combinations are the combinations
with corresponding precomposed Type... values.
*/
enum OutType;
enum OutType : UINT8;
/*
enum ProviderTraitType (low-level API):
@ -347,7 +349,6 @@ namespace tld
The type of a provider trait. Used when building up provider metadata.
*/
enum ProviderTraitType;
#pragma warning(pop)
/*
class ProviderMetadataBuilder (low-level API):

Просмотреть файл

@ -1,520 +0,0 @@
//depot/rs_prerelease/publicint/minwin/priv_sdk/inc/telemetry/microsofttelemetry.h#3 - integrate change 8074616 (text)
/* ++
Copyright (c) Microsoft Corporation. All rights reserved.
Module Name:
MicrosoftTelemetry.h
Abstract:
Microsoft Telemetry-specific definitions and extensions to logging functions:
- Opt-in helpers to Microsoft Telemetry (TraceLoggingOptionMicrosoftTelemetry)
- Keywords for categories (applies to TraceLogging and manifested events)
- Event tags to influence persistence and latency
- Field tags to influence PII treatment
These should be used only by ETW providers in the Microsoft Telemetry provider group {4f50731a-89cf-4782-b3e0-dce8c90476ba}.
Please see the following link for the full specification text:
https://microsoft.sharepoint.com/teams/osg_threshold_specs/_layouts/15/WopiFrame.aspx?sourcedoc={8e8236cf-6b80-4e3c-9d7a-c35b52588946}&action=view
Environment:
User mode or kernel mode.
Note:
If you are seeing unexpected references to EtwSetInformation (kernel-mode)
or EventSetInformation (user-mode), you can use the
MICROSOFTTELEMETRY_HAVE_EVENT_SET_INFORMATION and
MICROSOFTTELEMETRY_EVENT_SET_INFORMATION macros to adjust how the
EnableManifestedProviderForMicrosoftTelemetry function accesses this API.
--*/
#ifndef _MICROSOFTTELEMETRY_
#define _MICROSOFTTELEMETRY_
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
#pragma once
#endif
/*
Macro TraceLoggingOptionMicrosoftTelemetry():
Wrapper macro for use in TRACELOGGING_DEFINE_PROVIDER that declares the
provider's membership in the Microsoft Telemetry provider group
{4f50731a-89cf-4782-b3e0-dce8c90476ba}. Membership in this group means that
events with keyword MICROSOFT_KEYWORD_TELEMETRY, MICROSOFT_KEYWORD_MEASURES,
or MICROSOFT_KEYWORD_CRITICAL_DATA will be recognized as "telemetry" events by
UTC.
TraceLoggingOptionMicrosoftTelemetry()
is equivalent to:
TraceLoggingOptionGroup(0x4f50731a, 0x89cf, 0x4782, 0xb3, 0xe0, 0xdc, 0xe8, 0xc9, 0x4, 0x76, 0xba).
Example:
TRACELOGGING_DEFINE_PROVIDER(g_hMyProvider, "MyProvider",
(0xb3864c38, 0x4273, 0x58c5, 0x54, 0x5b, 0x8b, 0x36, 0x08, 0x34, 0x34, 0x71),
TraceLoggingOptionMicrosoftTelemetry());
*/
#define TraceLoggingOptionMicrosoftTelemetry() \
TraceLoggingOptionGroup(0x4f50731a, 0x89cf, 0x4782, 0xb3, 0xe0, 0xdc, 0xe8, 0xc9, 0x4, 0x76, 0xba)
/*
Macro TraceLoggingOptionWindowsCoreTelemetry():
Wrapper macro for use in TRACELOGGING_DEFINE_PROVIDER that declares the
provider's membership in the Windows Core Telemetry provider group
{c7de053a-0c2e-4a44-91a2-5222ec2ecdf1}. Membership in this group means that
events with keyword MICROSOFT_KEYWORD_CRITICAL_DATA or event tag
MICROSOFT_EVENTTAG_CORE_DATA will be recognized as "telemetry" events by
UTC even at the Basic level.
TraceLoggingOptionWindowsCoreTelemetry()
is equivalent to:
TraceLoggingOptionGroup(0xc7de053a, 0x0c2e, 0x4a44, 0x91, 0xa2, 0x52, 0x22, 0xec, 0x2e, 0xcd, 0xf1).
Example:
TRACELOGGING_DEFINE_PROVIDER(g_hMyProvider, "MyProvider",
(0xb3864c38, 0x4273, 0x58c5, 0x54, 0x5b, 0x8b, 0x36, 0x08, 0x34, 0x34, 0x71),
TraceLoggingOptionWindowsCoreTelemetry());
*/
#define TraceLoggingOptionWindowsCoreTelemetry() \
TraceLoggingOptionGroup(0xc7de053a, 0x0c2e, 0x4a44, 0x91, 0xa2, 0x52, 0x22, 0xec, 0x2e, 0xcd, 0xf1)
#ifndef MICROSOFTTELEMETRY_NO_FUNCTIONS
#include <evntprov.h>
// Enum declaration may be missing from older evntprov.h:
enum _EVENT_INFO_CLASS
#if !defined(__INTELLISENSE__) && defined(__cplusplus) && (_MSC_VER >= 1700)
: int // base type for enum forward declaration
#endif
;
/*
Macro MICROSOFTTELEMETRY_EVENT_SET_INFORMATION:
Macro MICROSOFTTELEMETRY_HAVE_EVENT_SET_INFORMATION:
These macros affect the behavior of
EnableManifestedProviderForMicrosoftTelemetry.
The default behavior of EnableManifestedProviderForMicrosoftTelemetry depends
on the version of Windows being targeted. If the targeted version of Windows
supports the EventSetInformation/EtwSetInformation API, then
EnableManifestedProviderForMicrosoftTelemetry will call the API directly,
leading to a static dependency. If the targeted version of Windows does not
support the API, then EnableManifestedProviderForMicrosoftTelemetry will
attempt to dynamically load the appropriate API (via GetProcAddress or
MmGetSystemRoutineAddress), avoiding the static dependency.
Use MICROSOFTTELEMETRY_EVENT_SET_INFORMATION if you want a custom API to be
called instead of EventSetInformation or EtwSetInformation. If
MICROSOFTTELEMETRY_EVENT_SET_INFORMATION is defined, then
EnableManifestedProviderForMicrosoftTelemetry will invoke
MICROSOFTTELEMETRY_EVENT_SET_INFORMATION(...) instead of calling
EventSetInformation(...) or EtwSetInformation(...). Note that
MICROSOFTTELEMETRY_EVENT_SET_INFORMATION will only take effect if
MICROSOFTTELEMETRY_HAVE_EVENT_SET_INFORMATION is unset or is set to 1.
Use MICROSOFTTELEMETRY_HAVE_EVENT_SET_INFORMATION if you want to override the
Windows version detection of EnableManifestedProviderForMicrosoftTelemetry.
If MICROSOFTTELEMETRY_HAVE_EVENT_SET_INFORMATION is not defined,
EnableManifestedProviderForMicrosoftTelemetry will use windows version macros
to determine whether to static-link or runtime-link the EventSetInformation or
EtwSetInformation API. You can set
MICROSOFTTELEMETRY_HAVE_EVENT_SET_INFORMATION to 0, 1, or 2 to override this
versioning logic. Set it to 0 to completely disable the API (always return a
NOT_SUPPORTED error). Set it to 1 to force static-link with the API. Set it to
2 to force dynamic-load of the API.
*/
#ifdef _ETW_KM_
#ifndef MICROSOFTTELEMETRY_EVENT_SET_INFORMATION
#define MICROSOFTTELEMETRY_EVENT_SET_INFORMATION EtwSetInformation
#ifndef MICROSOFTTELEMETRY_HAVE_EVENT_SET_INFORMATION
#if NTDDI_VERSION < 0x06040000
#define MICROSOFTTELEMETRY_HAVE_EVENT_SET_INFORMATION 2 // Find "EtwSetInformation" via MmGetSystemRoutineAddress
#else
#define MICROSOFTTELEMETRY_HAVE_EVENT_SET_INFORMATION 1 // Directly invoke EtwSetInformation(...)
#endif
#endif
#elif !defined(MICROSOFTTELEMETRY_HAVE_EVENT_SET_INFORMATION)
#define MICROSOFTTELEMETRY_HAVE_EVENT_SET_INFORMATION 1 // Directly invoke MICROSOFTTELEMETRY_EVENT_SET_INFORMATION(...)
#endif
#else // _ETW_KM_
#ifndef MICROSOFTTELEMETRY_EVENT_SET_INFORMATION
#define MICROSOFTTELEMETRY_EVENT_SET_INFORMATION EventSetInformation
#ifndef MICROSOFTTELEMETRY_HAVE_EVENT_SET_INFORMATION
#if WINVER < 0x0602 || !defined(EVENT_FILTER_TYPE_SCHEMATIZED)
#define MICROSOFTTELEMETRY_HAVE_EVENT_SET_INFORMATION 2 // Find "EventSetInformation" via GetModuleHandleExW+GetProcAddress
#else
#define MICROSOFTTELEMETRY_HAVE_EVENT_SET_INFORMATION 1 // Directly invoke EventSetInformation(...)
#endif
#endif
#elif !defined(MICROSOFTTELEMETRY_HAVE_EVENT_SET_INFORMATION)
#define MICROSOFTTELEMETRY_HAVE_EVENT_SET_INFORMATION 1 // Directly invoke MICROSOFTTELEMETRY_EVENT_SET_INFORMATION(...)
#endif
#endif // _ETW_KM_
__inline
#ifdef _ETW_KM_
NTSTATUS
#else // _ETW_KM_
ULONG
#endif // _ETW_KM_
EventSetInformation_ProviderTraits(
_In_ REGHANDLE RegHandle,
_In_count_x_(*(UINT16*)Traits) UCHAR const* Traits
)
/*++
Routine Description:
This routine calls EventSetInformation(EventProviderSetTraits) to set the
provider traits for an ETW provider. For this to work, this must be
called immediately after the provider has been registered (i.e. immediately
after the call to EventRegister).
As a side-effect, this function also notifies ETW that this provider
properly initializes the EVENT_DATA_DESCRIPTOR::Reserved field in all
calls to EventWrite/EtwWrite.
Arguments:
RegHandle - The provider registration handle.
Traits - A pointer to the traits to register. This is assumed to be a valid
traits blob, starting with a 16-bit length field.
Return Value:
User mode: ERROR_SUCCESS on success, error code otherwise.
Kernel mode: STATUS_SUCCESS on success, error code otherwise.
The most common error code is ERROR_NOT_SUPPORTED/STATUS_NOT_SUPPORTED,
which occurs if running on a system that does not support Microsoft
Telemetry.
--*/
{
#ifdef _ETW_KM_
NTSTATUS Status = STATUS_NOT_SUPPORTED;
#else // _ETW_KM_
ULONG Status = ERROR_NOT_SUPPORTED;
#endif // _ETW_KM_
#if MICROSOFTTELEMETRY_HAVE_EVENT_SET_INFORMATION == 0 // Immediately return NOT_SUPPORTED.
(void)RegHandle; // Unreferenced parameter
(void)Traits; // Unreferenced parameter
#elif MICROSOFTTELEMETRY_HAVE_EVENT_SET_INFORMATION == 1
Status = MICROSOFTTELEMETRY_EVENT_SET_INFORMATION(
RegHandle,
(enum _EVENT_INFO_CLASS)2, // EventProviderSetTraits
(PVOID)Traits,
*(USHORT*)Traits);
#elif MICROSOFTTELEMETRY_HAVE_EVENT_SET_INFORMATION != 2
#error Invalid value for MICROSOFTTELEMETRY_HAVE_EVENT_SET_INFORMATION. Must be 0, 1, or 2.
#elif defined(_ETW_KM_)
typedef NTSTATUS(NTAPI* PFEtwSetInformation)(
_In_ REGHANDLE RegHandle,
_In_ enum _EVENT_INFO_CLASS InformationClass,
_In_reads_bytes_opt_(InformationLength) PVOID EventInformation,
_In_ ULONG InformationLength);
static UNICODE_STRING strEtwSetInformation = {
sizeof(L"EtwSetInformation") - 2,
sizeof(L"EtwSetInformation") - 2,
L"EtwSetInformation"
};
#pragma warning(push)
#pragma warning(disable: 4055) // Allow the cast from a PVOID to a PFN
PFEtwSetInformation pfEtwSetInformation =
(PFEtwSetInformation)MmGetSystemRoutineAddress(&strEtwSetInformation);
#pragma warning(pop)
if (pfEtwSetInformation)
{
Status = pfEtwSetInformation(
RegHandle,
(enum _EVENT_INFO_CLASS)2, // EventProviderSetTraits
(PVOID)Traits,
*(USHORT*)Traits);
}
#else
HMODULE hEventing = NULL;
if (GetModuleHandleExW(0, L"api-ms-win-eventing-provider-l1-1-0", &hEventing) ||
GetModuleHandleExW(0, L"advapi32", &hEventing))
{
typedef ULONG(WINAPI* PFEventSetInformation)(
_In_ REGHANDLE RegHandle,
_In_ enum _EVENT_INFO_CLASS InformationClass,
_In_reads_bytes_opt_(InformationLength) PVOID EventInformation,
_In_ ULONG InformationLength);
PFEventSetInformation pfEventSetInformation =
(PFEventSetInformation)GetProcAddress(hEventing, "EventSetInformation");
if (pfEventSetInformation) {
Status = pfEventSetInformation(
RegHandle,
(enum _EVENT_INFO_CLASS)2, // EventProviderSetTraits
(PVOID)Traits,
*(USHORT*)Traits);
}
FreeLibrary(hEventing);
}
#endif
return Status;
}
__inline
#ifdef _ETW_KM_
NTSTATUS
#else // _ETW_KM_
ULONG
#endif // _ETW_KM_
EnableManifestedProviderForMicrosoftTelemetry(
_In_ REGHANDLE RegHandle
)
/*++
Routine Description:
Manifested providers that want to write telemetry must call this function
immediately after registration. For example:
EventRegisterMy_Provider_Name();
EnableManifestedProviderForMicrosoftTelemetry(My_Provider_NameHandle);
This routine calls EventSetInformation(EventProviderSetTraits) to declare
the provider's membership in the Microsoft Telemetry provider group
{4f50731a-89cf-4782-b3e0-dce8c90476ba}. Membership in this group means
that events with the following keywords will be recognized as "telemetry"
events by UTC:
- MICROSOFT_KEYWORD_TELEMETRY (ms:Telemetry)
- MICROSOFT_KEYWORD_MEASURES (ms:Measures)
- MICROSOFT_KEYWORD_CRITICAL_DATA (ms:CriticalData)
In addition, MICROSOFT_KEYWORD_RESERVED_44 (ms:ReservedKeyword44) is
reserved for future use as a telemetry keyword and must not be used.
As a side-effect, this function also notifies ETW that this provider
properly initializes the EVENT_DATA_DESCRIPTOR::Reserved field in all
calls to EventWrite/EtwWrite.
Arguments:
RegHandle - The provider registration handle.
Return Value:
User mode: ERROR_SUCCESS on success, error code otherwise.
Kernel mode: STATUS_SUCCESS on success, error code otherwise.
The most common error code is ERROR_NOT_SUPPORTED/STATUS_NOT_SUPPORTED,
which occurs if running on a system that does not support Microsoft
Telemetry.
--*/
{
static UCHAR const Traits[] = {
0x16, 0x00, 0x00, 0x13, 0x00, 0x01,
// {4f50731a-89cf-4782-b3e0-dce8c90476ba}
0x1a, 0x73, 0x50, 0x4f, 0xcf, 0x89, 0x82, 0x47, 0xb3, 0xe0, 0xdc, 0xe8, 0xc9, 0x04, 0x76, 0xba
};
return EventSetInformation_ProviderTraits(RegHandle, Traits);
}
__inline
#ifdef _ETW_KM_
NTSTATUS
#else // _ETW_KM_
ULONG
#endif // _ETW_KM_
EnableManifestedProviderForMicrosoftWlanTelemetry(
_In_ REGHANDLE RegHandle
)
/*++
Routine Description:
Not for normal use! This function is only for use with providers that need
to use alternate keywords instead of the standard ms:Telemetry,
ms:Measures, and ms:CriticalData keywords. This function declares that the
associated provider will use alternate keyword values, not the standard
ones. Unless you've specifically worked with the UTC team on your manifest,
DO NOT USE THIS FUNCTION!
Manifested providers that use the alternate keywords and want to write
telemetry must call this function immediately after registration. For
example:
EventRegisterMy_WLAN_Provider_Name();
EnableManifestedProviderForMicrosoftWlanTelemetry(
My_WLAN_Provider_NameHandle);
This routine calls EventSetInformation(EventProviderSetTraits) to declare
the provider's membership in the Microsoft WLAN Telemetry provider group
{976a8310-986e-4640-8bfb-7736ee6d9b65}. Membership in this group means
that events the following keywords will be recognized as "telemetry"
events by UTC:
- 0x20000000 (Telemetry)
- 0x40000000 (Measures)
- 0x80000000 (CriticalData)
In addition, keyword 0x10000000 is reserved for future use as a telemetry
keyword and must not be used.
As a side-effect, this function also notifies ETW that this provider
properly initializes the EVENT_DATA_DESCRIPTOR::Reserved field in all
calls to EventWrite/EtwWrite.
Arguments:
RegHandle - The provider registration handle.
Return Value:
User mode: ERROR_SUCCESS on success, error code otherwise.
Kernel mode: STATUS_SUCCESS on success, error code otherwise.
The most common error code is ERROR_NOT_SUPPORTED/STATUS_NOT_SUPPORTED,
which occurs if running on a system that does not support Microsoft
Telemetry.
--*/
{
static UCHAR const Traits[] = {
0x16, 0x00, 0x00, 0x13, 0x00, 0x01,
// {976a8310-986e-4640-8bfb-7736ee6d9b65}
0x10, 0x83, 0x6a, 0x97, 0x6e, 0x98, 0x40, 0x46, 0x8b, 0xfb, 0x77, 0x36, 0xee, 0x6d, 0x9b, 0x65
};
return EventSetInformation_ProviderTraits(RegHandle, Traits);
}
#endif // !MICROSOFTTELEMETRY_NO_FUNCTIONS
/*
Telemetry categories that can be assigned as event keywords:
MICROSOFT_KEYWORD_CRITICAL_DATA: Events that power user experiences or are critical to business intelligence
MICROSOFT_KEYWORD_MEASURES: Events for understanding measures and reporting scenarios
MICROSOFT_KEYWORD_TELEMETRY: Events for general-purpose telemetry
Only one telemetry category should be assigned per event, though an event may also participate in other non-telemetry keywords.
Some categories (such as CRITICAL_DATA) require formal approval before they can be used. Refer to
https://osgwiki.com/wiki/Common_Schema_Event_Overrides
for details on the requirements and how to start the approval process.
*/
// c.f. WINEVENT_KEYWORD_RESERVED_63-56 0xFF00000000000000 // Bits 63-56 - channel keywords
// c.f. WINEVENT_KEYWORD_* 0x00FF000000000000 // Bits 55-48 - system-reserved keywords
#define MICROSOFT_KEYWORD_CRITICAL_DATA 0x0000800000000000 // Bit 47
#define MICROSOFT_KEYWORD_MEASURES 0x0000400000000000 // Bit 46
#define MICROSOFT_KEYWORD_TELEMETRY 0x0000200000000000 // Bit 45
#define MICROSOFT_KEYWORD_RESERVED_44 0x0000100000000000 // Bit 44 (reserved for future assignment)
/*
For manifested providers, add the following xmlns:ms declaration to the instrumentation
element in the manifest:
<instrumentation
...
xmlns:ms="http://manifests.microsoft.com/win/2004/08/windows/events"
...>
Then modify the EVENTS_* settings in your SOURCES file to include:
EVENTS_INCLUDE_MICROSOFT_TELEMETRY=1
Finally, make sure to call EnableManifestedProviderForMicrosoftTelemetry(Provider_NameHandle)
immediately after registering your provider:
EventRegisterProvider_Name();
EnableManifestedProviderForMicrosoftTelemetry(Provider_NameHandle);
Events may then be decorated with ms:CriticalData, ms:Measures, and ms:Telemetry; for example:
<event
keywords="ms:Telemetry"
symbol="HelloWorldEvent"
value="1"
/>
*/
/*
Event tags that can be assigned to influence how the telemetry client handles events (TraceLogging only):
MICROSOFT_EVENTTAG_CORE_DATA: This event contains high-priority "core data".
MICROSOFT_EVENTTAG_INJECT_XTOKEN: Inject an Xbox identity token into this event.
MICROSOFT_EVENTTAG_REALTIME_LATENCY: Send these events in real time.
MICROSOFT_EVENTTAG_COSTDEFERRED_LATENCY: Treat these events like NORMAL_LATENCY until they've been stuck on the device for too long,
then allow them to upload over costed networks.
MICROSOFT_EVENTTAG_NORMAL_LATENCY: Send these events via the preferred connection based on device policy.
MICROSOFT_EVENTTAG_CRITICAL_PERSISTENCE: Delete these events last when low on spool space.
MICROSOFT_EVENTTAG_NORMAL_PERSISTENCE: Delete these events first when low on spool space.
MICROSOFT_EVENTTAG_DROP_PII: The event's Part A will be reduced.
MICROSOFT_EVENTTAG_HASH_PII: The event's Part A will be obscured.
MICROSOFT_EVENTTAG_MARK_PII: The event's Part A will be kept as-is and routed to a private stream in the backend.
For example:
TraceLoggingWrite(..., TraceLoggingEventTag(MICROSOFT_EVENTTAG_REALTIME_LATENCY), ...)
Some tags require formal approval before they can be used. Refer to
https://osgwiki.com/wiki/Common_Schema_Event_Overrides
for details on the requirements and how to start the approval process.
*/
#define MICROSOFT_EVENTTAG_COSTDEFERRED_LATENCY 0x00040000
#define MICROSOFT_EVENTTAG_CORE_DATA 0x00080000
#define MICROSOFT_EVENTTAG_INJECT_XTOKEN 0x00100000
#define MICROSOFT_EVENTTAG_REALTIME_LATENCY 0x00200000
#define MICROSOFT_EVENTTAG_NORMAL_LATENCY 0x00400000
#define MICROSOFT_EVENTTAG_CRITICAL_PERSISTENCE 0x00800000
#define MICROSOFT_EVENTTAG_NORMAL_PERSISTENCE 0x01000000
#define MICROSOFT_EVENTTAG_DROP_PII 0x02000000
#define MICROSOFT_EVENTTAG_HASH_PII 0x04000000
#define MICROSOFT_EVENTTAG_MARK_PII 0x08000000
/*
Field tags that can be assigned to influence how the telemetry client handles fields and generates
Part A's for the containing event (TraceLogging only):
MICROSOFT_FIELDTAG_DROP_PII: The field contains PII and should be dropped by the telemetry client.
MICROSOFT_FIELDTAG_HASH_PII: The field contains PII and should be hashed (obfuscated) prior to uploading.
Note that in order to specify a field tag, a field description must be specified as well, e.g.:
..., TraceLoggingWideString(wszUser, "UserName", "User name", MICROSOFT_FIELDTAG_HASH_PII), ...
*/
#define MICROSOFT_FIELDTAG_DROP_PII 0x04000000
#define MICROSOFT_FIELDTAG_HASH_PII 0x08000000
#endif // _MICROSOFTTELEMETRY_

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -325,4 +325,9 @@ namespace ARIASDK_NS_BEGIN {
}
#endif
unsigned hashCode(const char* str, int h)
{
return (unsigned)(!str[h] ? 5381 : ((unsigned long long)hashCode(str, h + 1) * (unsigned)33) ^ str[h]);
}
} ARIASDK_NS_END

Просмотреть файл

@ -29,6 +29,14 @@
#define _WINRT
#endif
#ifndef EOK
#define EOK 0
#endif
#ifndef EFAIL
#define EFAIL -1
#endif
namespace ARIASDK_NS_BEGIN {
// TODO: [MG] - refactor this
@ -145,7 +153,7 @@ namespace ARIASDK_NS_BEGIN {
case EventLatency_RealTime:
return "RealTime";
case EventPriority_Immediate:
case EventLatency_Max:
return "Immediate";
default:
@ -178,6 +186,8 @@ namespace ARIASDK_NS_BEGIN {
#endif
unsigned hashCode(const char* str, int h = 0);
} ARIASDK_NS_END
#endif

24
tools/MakeTgz.cmake Normal file
Просмотреть файл

@ -0,0 +1,24 @@
set(CMAKE_PROJECT_NAME "aria-sdk")
set(CPACK_SYSTEM_NAME "${OS_RELEASE_ID}-${OS_RELEASE_VERSION_ID}")
#set(CPACK_SET_DESTDIR ${CPACK_SYSTEM_NAME})
set(CPACK_PACKAGING_INSTALL_PREFIX "/usr/local")
set(CPACK_GENERATOR "TGZ")
set(MAJOR_VERSION "3")
set(MINOR_VERSION "0")
string(TIMESTAMP DAYNUMBER "%j")
set(PATCH_VERSION "${DAYNUMBER}")
set(CPACK_PACKAGE_DESCRIPTION "Aria SDK for Unix")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Aria SDK for events ingestion from Unix hosts")
set(CPACK_PACKAGE_VENDOR "Microsoft")
set(CPACK_PACKAGE_CONTACT "ariaesdks@microsoft.com")
set(CPACK_PACKAGE_VERSION_MAJOR "${MAJOR_VERSION}")
set(CPACK_PACKAGE_VERSION_MINOR "${MINOR_VERSION}")
set(CPACK_PACKAGE_VERSION_PATCH "${PATCH_VERSION}")
# FIXME: add architecture name in file name
set(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}-${CPACK_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}")
message("-- Package name: ${CPACK_PACKAGE_FILE_NAME}.tgz")
include(CPack)

34
tools/build-deps.cmd Normal file
Просмотреть файл

@ -0,0 +1,34 @@
@echo off
echo Building 3rd party dependencies...
@setlocal ENABLEEXTENSIONS
set ROOT=%~dp0\..
echo Using Visual Studio 2017 tools...
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\Tools\VsDevCmd.bat"
set MAXCPUCOUNT=%NUMBER_OF_PROCESSORS%
set platform=
set SOLUTION=%ROOT%\Solutions\AriaSDK.sln
REM DLL and static /MD build
msbuild %SOLUTION% /target:sqlite,zlib,sqlite-uwp /p:BuildProjectReferences=true /maxcpucount:%MAXCPUCOUNT% /p:Configuration=Debug /p:Platform=Win32
msbuild %SOLUTION% /target:sqlite,zlib,sqlite-uwp /p:BuildProjectReferences=true /maxcpucount:%MAXCPUCOUNT% /p:Configuration=Release /p:Platform=Win32
msbuild %SOLUTION% /target:sqlite,zlib,sqlite-uwp /p:BuildProjectReferences=true /maxcpucount:%MAXCPUCOUNT% /p:Configuration=Debug /p:Platform=x64
msbuild %SOLUTION% /target:sqlite,zlib,sqlite-uwp /p:BuildProjectReferences=true /maxcpucount:%MAXCPUCOUNT% /p:Configuration=Release /p:Platform=x64
REM Static /MT build
msbuild %SOLUTION% /target:sqlite,zlib /p:BuildProjectReferences=true /maxcpucount:%MAXCPUCOUNT% /p:Configuration=Debug.vs2015.MT-sqlite /p:Platform=Win32
msbuild %SOLUTION% /target:sqlite,zlib /p:BuildProjectReferences=true /maxcpucount:%MAXCPUCOUNT% /p:Configuration=Release.vs2015.MT-sqlite /p:Platform=Win32
msbuild %SOLUTION% /target:sqlite,zlib /p:BuildProjectReferences=true /maxcpucount:%MAXCPUCOUNT% /p:Configuration=Debug.vs2015.MT-sqlite /p:Platform=x64
msbuild %SOLUTION% /target:sqlite,zlib /p:BuildProjectReferences=true /maxcpucount:%MAXCPUCOUNT% /p:Configuration=Release.vs2015.MT-sqlite /p:Platform=x64
REM ARM DLL build
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\Tools\vsdevcmd\ext\vcvars.bat" arm
msbuild %SOLUTION% /target:zlib /p:BuildProjectReferences=true /maxcpucount:%MAXCPUCOUNT% /p:Configuration=Debug /p:Platform=ARM
msbuild %SOLUTION% /target:zlib /p:BuildProjectReferences=true /maxcpucount:%MAXCPUCOUNT% /p:Configuration=Release /p:Platform=ARM
REM ARM64 DLL build
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\Tools\vsdevcmd\ext\vcvars.bat" arm64
msbuild %SOLUTION% /target:sqlite,zlib,sqlite-uwp /p:BuildProjectReferences=true /maxcpucount:%MAXCPUCOUNT% /p:Configuration=Debug /p:Platform=ARM64
msbuild %SOLUTION% /target:sqlite,zlib,sqlite-uwp /p:BuildProjectReferences=true /maxcpucount:%MAXCPUCOUNT% /p:Configuration=Release /p:Platform=ARM64

Просмотреть файл

@ -247,3 +247,12 @@ if(HAVE_OFF64_T)
target_link_libraries(minigzip64 zlib)
set_target_properties(minigzip64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64")
endif()
add_compile_definitions(WIN32)
add_compile_definitions(_CRT_NONSTDC_NO_DEPRECATE)
add_compile_definitions(_CRT_SECURE_NO_DEPRECATE)
add_compile_definitions(_CRT_NONSTDC_NO_WARNINGS)
add_compile_definitions(ZLIB_WINAPI)
# For x64 online
add_compile_definitions(WIN64)