|
1 | | -#pragma once |
2 | | - |
3 | | -#include "GAConstants.h" |
4 | | - |
5 | | -#if IS_MAC |
6 | | - #include <sys/sysctl.h> |
7 | | -#elif IS_WIN32 |
8 | | - #include <winsock2.h> |
9 | | - #include <windows.h> |
10 | | -#elif IS_UWP |
11 | | - #include <winsock2.h> |
12 | | - #include <windows.h> |
13 | | -#elif IS_LINUX |
14 | | - #include <sys/utsname.h> |
15 | | - #include <sys/types.h> |
16 | | - #include <sys/stat.h> |
17 | | -#endif |
18 | | - |
19 | | - |
20 | | -#include <string> |
21 | | -#include <vector> |
22 | | -#include <cinttypes> |
23 | | -#include <memory> |
24 | | -#include <thread> |
25 | | -#include <filesystem> |
26 | | -#include <iostream> |
27 | | -#include <cstdio> |
28 | | -#include <cstdlib> |
29 | | -#include <cerrno> |
30 | | -#include <cctype> |
31 | | -#include <future> |
32 | | -#include <ostream> |
33 | | -#include <mutex> |
34 | | -#include <fstream> |
35 | | -#include <csignal> |
36 | | -#include <utility> |
37 | | -#include <cstring> |
38 | | -#include <cstdio> |
39 | | -#include <array> |
40 | | - |
41 | | -#include "nlohmann/json.hpp" |
42 | | - |
43 | | -namespace gameanalytics |
44 | | -{ |
45 | | - using nlohmann::json; |
46 | | - using StringVector = std::vector<std::string>; |
47 | | - |
48 | | - using LogHandler = std::function<void(std::string const&, EGALoggerMessageType)>; |
49 | | - using FPSTracker = std::function<float()>; |
50 | | - |
51 | | - namespace state |
52 | | - { |
53 | | - class GAState; |
54 | | - } |
55 | | - |
56 | | - struct IRemoteConfigsListener |
57 | | - { |
58 | | - virtual void onRemoteConfigsUpdated(std::string const& remoteConfigs) = 0; |
59 | | - }; |
60 | | -} |
| 1 | +#pragma once |
| 2 | + |
| 3 | +#if defined(_WIN32) || defined(_WIN64) || defined(GA_UWP_BUILD) |
| 4 | + |
| 5 | + #ifndef GA_UWP_BUILD |
| 6 | + #define IS_WIN32 1 |
| 7 | + #define IS_UWP 0 |
| 8 | + #else |
| 9 | + #define IS_WIN32 0 |
| 10 | + #define IS_UWP 1 |
| 11 | + #endif |
| 12 | + |
| 13 | + #define _WIN32_DCOM |
| 14 | + |
| 15 | + #ifndef WIN32_LEAN_AND_MEAN |
| 16 | + #define WIN32_LEAN_AND_MEAN |
| 17 | + #endif |
| 18 | + |
| 19 | + #ifndef NOMINMAX |
| 20 | + #define NOMINMAX |
| 21 | + #endif |
| 22 | + |
| 23 | +#else |
| 24 | + #define IS_WIN32 0 |
| 25 | + #define IS_UWP 0 |
| 26 | +#endif |
| 27 | + |
| 28 | +#if IS_MAC |
| 29 | + #include <sys/sysctl.h> |
| 30 | +#elif IS_WIN32 |
| 31 | + #include <winsock2.h> |
| 32 | + #include <windows.h> |
| 33 | +#elif IS_UWP |
| 34 | + #include <winsock2.h> |
| 35 | + #include <windows.h> |
| 36 | +#elif IS_LINUX |
| 37 | + #include <sys/utsname.h> |
| 38 | + #include <sys/types.h> |
| 39 | + #include <sys/stat.h> |
| 40 | +#endif |
| 41 | + |
| 42 | +#include "GameAnalytics/GATypes.h" |
| 43 | + |
| 44 | +#include <string> |
| 45 | +#include <vector> |
| 46 | +#include <cinttypes> |
| 47 | +#include <memory> |
| 48 | +#include <thread> |
| 49 | +#include <filesystem> |
| 50 | +#include <iostream> |
| 51 | +#include <cstdio> |
| 52 | +#include <cstdlib> |
| 53 | +#include <cerrno> |
| 54 | +#include <cctype> |
| 55 | +#include <future> |
| 56 | +#include <ostream> |
| 57 | +#include <mutex> |
| 58 | +#include <fstream> |
| 59 | +#include <csignal> |
| 60 | +#include <utility> |
| 61 | +#include <cstring> |
| 62 | +#include <cstdio> |
| 63 | +#include <array> |
| 64 | + |
| 65 | +#include "nlohmann/json.hpp" |
| 66 | + |
| 67 | +#if defined(__linux__) || defined(__unix__) || defined(__unix) || defined(unix) |
| 68 | + #define IS_LINUX 1 |
| 69 | +#else |
| 70 | + #define IS_LINUX 0 |
| 71 | +#endif |
| 72 | + |
| 73 | +#if defined(__MACH__) || defined(__APPLE__) |
| 74 | + #define IS_MAC 1 |
| 75 | +#else |
| 76 | + #define IS_MAC 0 |
| 77 | +#endif |
| 78 | + |
| 79 | +namespace gameanalytics |
| 80 | +{ |
| 81 | + using nlohmann::json; |
| 82 | + |
| 83 | + namespace state |
| 84 | + { |
| 85 | + class GAState; |
| 86 | + } |
| 87 | + |
| 88 | + constexpr const char* GA_VERSION_STR = "cpp 4.0.0-alpha"; |
| 89 | + |
| 90 | + constexpr int MAX_CUSTOM_FIELDS_COUNT = 50; |
| 91 | + constexpr int MAX_CUSTOM_FIELDS_KEY_LENGTH = 64; |
| 92 | + constexpr int MAX_CUSTOM_FIELDS_VALUE_STRING_LENGTH = 256; |
| 93 | + |
| 94 | + constexpr int UUID_STR_LENGTH = 128; |
| 95 | + constexpr int TEXT_BUFFER_LENGTH = 256; |
| 96 | + |
| 97 | + constexpr const char* UNKNOWN_VALUE = "unknown"; |
| 98 | + |
| 99 | + constexpr int MAX_ERROR_TYPE_COUNT = 10; |
| 100 | + constexpr int MAX_ERROR_MSG_LEN = 8192; |
| 101 | + |
| 102 | + constexpr int JSON_PRINT_INDENT = 4; |
| 103 | + |
| 104 | + constexpr const char* CONNECTION_OFFLINE = "offline"; |
| 105 | + constexpr const char* CONNECTION_LAN = "lan"; |
| 106 | + constexpr const char* CONNECTION_WIFI = "wifi"; |
| 107 | + constexpr const char* CONNECTION_WWAN = "wwan"; |
| 108 | +} |
0 commit comments