24
24
#include < utility> // Used to detect STL variant.
25
25
#include < vector>
26
26
27
- #ifdef __APPLE__
28
- #include " TargetConditionals.h"
29
- #endif // __APPLE__
30
-
31
27
#include " app/memory/unique_ptr.h"
32
28
#include " app/src/assert.h"
33
29
#include " app/src/callback.h"
34
30
#include " app/src/cleanup_notifier.h"
35
31
#include " app/src/include/firebase/app.h"
32
+ #include " app/src/include/firebase/internal/platform.h"
36
33
#include " app/src/include/firebase/version.h"
37
34
#include " app/src/mutex.h"
38
35
#include " app/src/util.h"
39
36
40
37
// strtok_r is strtok_s on Windows.
41
- #if defined(_WIN32)
38
+ #if FIREBASE_PLATFORM_WINDOWS
42
39
#define strtok_r strtok_s
43
- #endif // defined(_WIN32)
40
+ #endif // FIREBASE_PLATFORM_WINDOWS
44
41
45
42
#if !defined(FIREBASE_NAMESPACE)
46
43
#define FIREBASE_NAMESPACE firebase
@@ -55,7 +52,7 @@ namespace app_common {
55
52
56
53
// clang-format=off
57
54
// Detect operating system and architecture.
58
- #if defined(_MSVC_VER) || defined(_WIN32)
55
+ #if FIREBASE_PLATFORM_WINDOWS
59
56
60
57
const char * kOperatingSystem = " windows" ;
61
58
#if defined(_DLL) && _DLL == 1
@@ -79,9 +76,9 @@ const char* kCpuArchitecture = "arm32";
79
76
80
77
#elif defined(__APPLE__)
81
78
const char * kCppRuntimeOrStl = " libcpp" ;
82
- #if TARGET_OS_IOS
79
+ #if FIREBASE_PLATFORM_IOS
83
80
const char * kOperatingSystem = " ios" ;
84
- #elif TARGET_OS_OSX
81
+ #elif FIREBASE_PLATFORM_OSX
85
82
const char * kOperatingSystem = " darwin" ;
86
83
#else
87
84
#error Unknown Apple operating system.
@@ -99,7 +96,7 @@ const char* kCpuArchitecture = "arm32";
99
96
#error Unknown Apple architecture.
100
97
#endif // Architecture
101
98
102
- #elif __ANDROID__
99
+ #elif FIREBASE_PLATFORM_ANDROID
103
100
const char * kOperatingSystem = " android" ;
104
101
105
102
#if __i386__
@@ -132,7 +129,7 @@ const char* kCppRuntimeOrStl = "libcpp";
132
129
#error Unknown Android STL.
133
130
#endif // STL
134
131
135
- #elif __linux__
132
+ #elif FIREBASE_PLATFORM_LINUX
136
133
const char * kOperatingSystem = " linux" ;
137
134
const char * kCppRuntimeOrStl = " gnustl" ;
138
135
0 commit comments