Skip to content

Commit e02874f

Browse files
authored
Unity fixes (#47)
* truncate linux version to pass GA validation * correct check for clang * discard incompatible sdk state * update version num
1 parent e2fc813 commit e02874f

4 files changed

Lines changed: 15 additions & 4 deletions

File tree

sample_shared/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ set(CMAKE_CXX_STANDARD 17)
99
if(LINUX)
1010
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
1111

12-
if(CLANG)
12+
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
1313
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
1414
endif()
1515
endif()

source/gameanalytics/GACommon.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ namespace gameanalytics
8585
class GAState;
8686
}
8787

88-
constexpr const char* GA_VERSION_STR = "cpp 5.2.0";
88+
constexpr const char* GA_VERSION_STR = "cpp 5.3.1";
8989

9090
constexpr int MAX_CUSTOM_FIELDS_COUNT = 50;
9191
constexpr int MAX_CUSTOM_FIELDS_KEY_LENGTH = 64;

source/gameanalytics/GAState.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -638,6 +638,7 @@ namespace gameanalytics
638638
catch (json::exception& e)
639639
{
640640
logging::GALogger::e(e.what());
641+
store::GAStore::setState("sdk_config_cached", "");
641642
}
642643
}
643644

source/gameanalytics/Platform/GALinux.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,19 @@ std::string gameanalytics::GAPlatformLinux::getOSVersion()
8181
std::string version;
8282
int const strSize = strlen(info.release);
8383

84+
int dotCount = 0;
8485
for (size_t i = 0; i < strSize; ++i)
85-
{
86-
if (!isdigit(info.release[i]) && info.release[i] != '.')
86+
{
87+
if (info.release[i] == '.')
88+
{
89+
++dotCount;
90+
if (dotCount == 3)
91+
{
92+
version = std::string(info.release, info.release + i);
93+
break;
94+
}
95+
}
96+
else if (!isdigit(info.release[i]))
8797
{
8898
version = std::string(info.release, info.release + i);
8999
break;

0 commit comments

Comments
 (0)