Skip to content

Commit 7f68ee6

Browse files
committed
Remove all mentions of STLport
1 parent 95f8ec8 commit 7f68ee6

File tree

3 files changed

+5
-45
lines changed

3 files changed

+5
-45
lines changed

Firestore/core/include/firebase/firestore/timestamp.h

+2-10
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,10 @@
1919

2020
#include <cstdint>
2121
#include <ctime>
22-
#include <iosfwd>
23-
#include <string>
2422

25-
#if !defined(_STLPORT_VERSION)
2623
#include <chrono> // NOLINT(build/c++11)
27-
#endif // !defined(_STLPORT_VERSION)
24+
#include <iosfwd>
25+
#include <string>
2826

2927
namespace firebase {
3028

@@ -117,7 +115,6 @@ class Timestamp {
117115
*/
118116
static Timestamp FromTimeT(time_t seconds_since_unix_epoch);
119117

120-
#if !defined(_STLPORT_VERSION)
121118
/**
122119
* Converts `std::chrono::time_point` to a `Timestamp`.
123120
*
@@ -145,7 +142,6 @@ class Timestamp {
145142
template <typename Clock = std::chrono::system_clock,
146143
typename Duration = std::chrono::microseconds>
147144
std::chrono::time_point<Clock, Duration> ToTimePoint() const;
148-
#endif // !defined(_STLPORT_VERSION)
149145

150146
/**
151147
* Returns a string representation of this `Timestamp` for logging/debugging
@@ -205,8 +201,6 @@ inline bool operator==(const Timestamp& lhs, const Timestamp& rhs) {
205201
return !(lhs != rhs);
206202
}
207203

208-
#if !defined(_STLPORT_VERSION)
209-
210204
// Make sure the header compiles even when included after `<windows.h>` without
211205
// `NOMINMAX` defined. `push/pop_macro` pragmas are supported by Visual Studio
212206
// as well as Clang and GCC.
@@ -239,8 +233,6 @@ std::chrono::time_point<Clock, Duration> Timestamp::ToTimePoint() const {
239233
#pragma pop_macro("max")
240234
#pragma pop_macro("min")
241235

242-
#endif // !defined(_STLPORT_VERSION)
243-
244236
} // namespace firebase
245237

246238
#endif // FIRESTORE_CORE_INCLUDE_FIREBASE_FIRESTORE_TIMESTAMP_H_

Firestore/core/src/timestamp.cc

+3-20
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020

2121
#if defined(__APPLE__)
2222
#import <CoreFoundation/CoreFoundation.h>
23-
#elif defined(_STLPORT_VERSION)
24-
#include <ctime>
2523
#endif
2624

2725
#include "Firestore/core/src/util/hard_assert.h"
@@ -76,29 +74,16 @@ Timestamp Timestamp::Now() {
7674
auto nanos = static_cast<int32_t>(fraction * kNanosPerSecond);
7775
return MakeNormalizedTimestamp(seconds, nanos);
7876

79-
#elif !defined(_STLPORT_VERSION)
80-
// Use the standard <chrono> library from C++11 if possible.
81-
return FromTimePoint(std::chrono::system_clock::now());
8277
#else
83-
// If <chrono> is unavailable, use clock_gettime from POSIX, which supports
84-
// up to nanosecond resolution. Note that it's a non-standard function
85-
// contained in <time.h>.
86-
//
87-
// Note: it's possible to check for availability of POSIX clock_gettime using
88-
// macros (see "Availability" at https://linux.die.net/man/3/clock_gettime).
89-
// However, the only platform where <chrono> isn't available is Android with
90-
// STLPort standard library, where clock_gettime is known to be available.
91-
timespec now;
92-
clock_gettime(CLOCK_REALTIME, &now);
93-
return MakeNormalizedTimestamp(now.tv_sec, now.tv_nsec);
94-
#endif // !defined(_STLPORT_VERSION)
78+
// Use the standard <chrono> library from C++11.
79+
return FromTimePoint(std::chrono::system_clock::now());
80+
#endif
9581
}
9682

9783
Timestamp Timestamp::FromTimeT(const time_t seconds_since_unix_epoch) {
9884
return {seconds_since_unix_epoch, 0};
9985
}
10086

101-
#if !defined(_STLPORT_VERSION)
10287
Timestamp Timestamp::FromTimePoint(
10388
const std::chrono::time_point<std::chrono::system_clock> time_point) {
10489
namespace chr = std::chrono;
@@ -111,8 +96,6 @@ Timestamp Timestamp::FromTimePoint(
11196
return result;
11297
}
11398

114-
#endif // !defined(_STLPORT_VERSION)
115-
11699
std::string Timestamp::ToString() const {
117100
return absl::StrCat("Timestamp(seconds=", seconds_,
118101
", nanoseconds=", nanoseconds_, ")");

Firestore/core/src/util/firestore_exceptions.h

-15
Original file line numberDiff line numberDiff line change
@@ -27,26 +27,11 @@
2727

2828
#include "Firestore/core/include/firebase/firestore/firestore_errors.h"
2929

30-
#if defined(__ANDROID__)
31-
// Abseil does not support STLPort, so avoid their config.h here.
32-
//
33-
// TODO(b/163140650): Remove once the Firebase support floor moves to NDK R18.
34-
//
35-
// Meanwhile, NDK R16b (the current minimum) includes Clang 5.0.3 and GCC 4.9.
36-
// While Clang supports `__cpp_exceptions` at that version, GCC does not. Both
37-
// support `__EXCEPTIONS`.
38-
#if __EXCEPTIONS
39-
#define FIRESTORE_HAVE_EXCEPTIONS 1
40-
#endif
41-
42-
#else // !defined(__ANDROID__)
43-
// On any other supported platform, just take Abseil's word for it.
4430
#include "absl/base/config.h"
4531

4632
#if ABSL_HAVE_EXCEPTIONS
4733
#define FIRESTORE_HAVE_EXCEPTIONS 1
4834
#endif
49-
#endif // defined(__ANDROID__)
5035

5136
namespace firebase {
5237
namespace firestore {

0 commit comments

Comments
 (0)