2424#include < utility> // Used to detect STL variant.
2525#include < vector>
2626
27- #ifdef __APPLE__
28- #include " TargetConditionals.h"
29- #endif // __APPLE__
30-
3127#include " app/memory/unique_ptr.h"
3228#include " app/src/assert.h"
3329#include " app/src/callback.h"
3430#include " app/src/cleanup_notifier.h"
3531#include " app/src/include/firebase/app.h"
32+ #include " app/src/include/firebase/internal/platform.h"
3633#include " app/src/include/firebase/version.h"
3734#include " app/src/mutex.h"
3835#include " app/src/util.h"
3936
4037// strtok_r is strtok_s on Windows.
41- #if defined(_WIN32)
38+ #if FIREBASE_PLATFORM_WINDOWS
4239#define strtok_r strtok_s
43- #endif // defined(_WIN32)
40+ #endif // FIREBASE_PLATFORM_WINDOWS
4441
4542#if !defined(FIREBASE_NAMESPACE)
4643#define FIREBASE_NAMESPACE firebase
@@ -55,7 +52,7 @@ namespace app_common {
5552
5653// clang-format=off
5754// Detect operating system and architecture.
58- #if defined(_MSVC_VER) || defined(_WIN32)
55+ #if FIREBASE_PLATFORM_WINDOWS
5956
6057const char * kOperatingSystem = " windows" ;
6158#if defined(_DLL) && _DLL == 1
@@ -79,9 +76,9 @@ const char* kCpuArchitecture = "arm32";
7976
8077#elif defined(__APPLE__)
8178const char * kCppRuntimeOrStl = " libcpp" ;
82- #if TARGET_OS_IOS
79+ #if FIREBASE_PLATFORM_IOS
8380const char * kOperatingSystem = " ios" ;
84- #elif TARGET_OS_OSX
81+ #elif FIREBASE_PLATFORM_OSX
8582const char * kOperatingSystem = " darwin" ;
8683#else
8784#error Unknown Apple operating system.
@@ -99,7 +96,7 @@ const char* kCpuArchitecture = "arm32";
9996#error Unknown Apple architecture.
10097#endif // Architecture
10198
102- #elif __ANDROID__
99+ #elif FIREBASE_PLATFORM_ANDROID
103100const char * kOperatingSystem = " android" ;
104101
105102#if __i386__
@@ -132,7 +129,7 @@ const char* kCppRuntimeOrStl = "libcpp";
132129#error Unknown Android STL.
133130#endif // STL
134131
135- #elif __linux__
132+ #elif FIREBASE_PLATFORM_LINUX
136133const char * kOperatingSystem = " linux" ;
137134const char * kCppRuntimeOrStl = " gnustl" ;
138135
0 commit comments