Skip to content

Commit 5005e23

Browse files
authored
Prefix remaining OS defines with FML_ namespace (flutter#31172)
1 parent f9e6267 commit 5005e23

26 files changed

Lines changed: 73 additions & 73 deletions

flow/frame_timings_recorder_unittests.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ TEST(FrameTimingsRecorderTest, RecordRasterTimesWithCache) {
122122
}
123123

124124
// Windows and Fuchsia don't allow testing with killed by signal.
125-
#if !defined(OS_FUCHSIA) && !defined(OS_WIN) && \
125+
#if !defined(OS_FUCHSIA) && !defined(FML_OS_WIN) && \
126126
(FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_DEBUG)
127127

128128
TEST(FrameTimingsRecorderTest, ThrowWhenRecordBuildBeforeVsync) {

fml/backtrace.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#include <csignal>
1212
#include <sstream>
1313

14-
#if OS_WIN
14+
#if FML_OS_WIN
1515
#include <crtdbg.h>
1616
#include <debugapi.h>
1717
#endif
@@ -132,7 +132,7 @@ static void ToggleSignalHandlers(bool set) {
132132
}
133133

134134
void InstallCrashHandler() {
135-
#if OS_WIN
135+
#if FML_OS_WIN
136136
if (!IsDebuggerPresent()) {
137137
_CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG);
138138
_CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);

fml/build_config.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
// This file adds defines about the platform we're currently building on.
66
// Operating System:
7-
// OS_WIN / FML_OS_MACOSX / FML_OS_LINUX / FML_OS_POSIX (MACOSX or LINUX) /
8-
// FML_OS_NACL (NACL_SFI or NACL_NONSFI) / FML_OS_NACL_SFI /
7+
// FML_OS_WIN / FML_OS_MACOSX / FML_OS_LINUX / FML_OS_POSIX (MACOSX or LINUX)
8+
// / FML_OS_NACL (NACL_SFI or NACL_NONSFI) / FML_OS_NACL_SFI /
99
// FML_OS_NACL_NONSFI
1010
// Compiler:
1111
// COMPILER_MSVC / COMPILER_GCC
@@ -27,7 +27,7 @@
2727
#include <TargetConditionals.h>
2828
#define FML_OS_MACOSX 1
2929
#if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
30-
#define OS_IOS 1
30+
#define FML_OS_IOS 1
3131
#endif // defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
3232
#elif defined(__linux__)
3333
#define FML_OS_LINUX 1
@@ -38,7 +38,7 @@
3838
#define LIBC_GLIBC 1
3939
#endif
4040
#elif defined(_WIN32)
41-
#define OS_WIN 1
41+
#define FML_OS_WIN 1
4242
#elif defined(__FreeBSD__)
4343
#define FML_OS_FREEBSD 1
4444
#elif defined(__OpenBSD__)
@@ -51,10 +51,10 @@
5151
#error Please add support for your platform in flutter/fml/build_config.h
5252
#endif
5353

54-
// For access to standard BSD features, use OS_BSD instead of a
54+
// For access to standard BSD features, use FML_OS_BSD instead of a
5555
// more specific macro.
5656
#if defined(FML_OS_FREEBSD) || defined(FML_OS_OPENBSD)
57-
#define OS_BSD 1
57+
#define FML_OS_BSD 1
5858
#endif
5959

6060
// For access to standard POSIXish features, use FML_OS_POSIX instead of a

fml/eintr_wrapper.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
#include "flutter/fml/build_config.h"
1111

12-
#if defined(OS_WIN)
12+
#if defined(FML_OS_WIN)
1313

1414
// Windows has no concept of EINTR.
1515
#define FML_HANDLE_EINTR(x) (x)
@@ -38,6 +38,6 @@
3838
eintr_wrapper_result; \
3939
})
4040

41-
#endif // defined(OS_WIN)
41+
#endif // defined(FML_OS_WIN)
4242

4343
#endif // FLUTTER_FML_EINTR_WRAPPER_H_

fml/file_unittest.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ TEST(FileTest, CanStopVisitEarly) {
228228
ASSERT_TRUE(fml::UnlinkDirectory(dir.fd(), "a"));
229229
}
230230

231-
#if OS_WIN
231+
#if FML_OS_WIN
232232
#define AtomicWriteTest DISABLED_AtomicWriteTest
233233
#else
234234
#define AtomicWriteTest AtomicWriteTest

fml/logging.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
#if defined(FML_OS_ANDROID)
1313
#include <android/log.h>
14-
#elif defined(OS_IOS)
14+
#elif defined(FML_OS_IOS)
1515
#include <syslog.h>
1616
#elif defined(OS_FUCHSIA)
1717
#include <lib/syslog/global.h>
@@ -94,7 +94,7 @@ LogMessage::~LogMessage() {
9494
break;
9595
}
9696
__android_log_write(priority, "flutter", stream_.str().c_str());
97-
#elif defined(OS_IOS)
97+
#elif defined(FML_OS_IOS)
9898
syslog(LOG_ALERT, "%s", stream_.str().c_str());
9999
#elif defined(OS_FUCHSIA)
100100
fx_log_severity_t fx_severity;

fml/mapping.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class FileMapping final : public Mapping {
8282
uint8_t* mapping_ = nullptr;
8383
uint8_t* mutable_mapping_ = nullptr;
8484

85-
#if OS_WIN
85+
#if FML_OS_WIN
8686
fml::UniqueFD mapping_handle_;
8787
#endif
8888

fml/memory/thread_checker.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#include "flutter/fml/logging.h"
1313
#include "flutter/fml/macros.h"
1414

15-
#if defined(OS_WIN)
15+
#if defined(FML_OS_WIN)
1616
#include <windows.h>
1717
#else
1818
#include <pthread.h>
@@ -30,7 +30,7 @@ namespace fml {
3030
// there's a small space cost to having even an empty class. )
3131
class ThreadChecker final {
3232
public:
33-
#if defined(OS_WIN)
33+
#if defined(FML_OS_WIN)
3434
ThreadChecker() : self_(GetCurrentThreadId()) {}
3535
~ThreadChecker() {}
3636

fml/message_loop_impl.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#include "flutter/fml/platform/fuchsia/message_loop_fuchsia.h"
2222
#elif FML_OS_LINUX
2323
#include "flutter/fml/platform/linux/message_loop_linux.h"
24-
#elif OS_WIN
24+
#elif FML_OS_WIN
2525
#include "flutter/fml/platform/win/message_loop_win.h"
2626
#endif
2727

@@ -36,7 +36,7 @@ fml::RefPtr<MessageLoopImpl> MessageLoopImpl::Create() {
3636
return fml::MakeRefCounted<MessageLoopFuchsia>();
3737
#elif FML_OS_LINUX
3838
return fml::MakeRefCounted<MessageLoopLinux>();
39-
#elif OS_WIN
39+
#elif FML_OS_WIN
4040
return fml::MakeRefCounted<MessageLoopWin>();
4141
#else
4242
return nullptr;

fml/message_loop_unittests.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#include "gtest/gtest.h"
1919

2020
#define TIMESENSITIVE(x) TimeSensitiveTest_##x
21-
#if OS_WIN
21+
#if FML_OS_WIN
2222
#define PLATFORM_SPECIFIC_CAPTURE(...) [ __VA_ARGS__, count ]
2323
#else
2424
#define PLATFORM_SPECIFIC_CAPTURE(...) [__VA_ARGS__]

0 commit comments

Comments
 (0)