diff --git a/DEPS b/DEPS index 32a48b1c53a..76095eb3ad9 100644 --- a/DEPS +++ b/DEPS @@ -144,7 +144,7 @@ vars = { "pub_rev": "3c14d86a67db7207bbc9f654ac49ee60e08e5240", "pub_semver_rev": "f50d80ef10c4b2fa5f4c8878036a4d9342c0cc82", "resource_rev": "6b79867d0becf5395e5819a75720963b8298e9a7", - "root_certificates_rev": "ef7b563890e219a93579b61584f9ffa64c7c8d9c", + "root_certificates_rev": "692f6d6488af68e0121317a9c2c9eb393eb0ee50", "rust_revision": "b7856f695d65a8ebc846754f97d15814bcb1c244", "shelf_static_rev": "fa30419055279a00c9e428439b1abe362d18f25d", "shelf_packages_handler_rev": "78302e67c035047e6348e692b0c1182131f0fe35", diff --git a/runtime/BUILD.gn b/runtime/BUILD.gn index bc878338a3f..30166786bc6 100644 --- a/runtime/BUILD.gn +++ b/runtime/BUILD.gn @@ -71,22 +71,22 @@ config("dart_os_config") { defines = [] if (target_os == "android") { - defines += [ "TARGET_OS_ANDROID" ] + defines += [ "DART_TARGET_OS_ANDROID" ] } else if (target_os == "fuchsia") { - defines += [ "TARGET_OS_FUCHSIA" ] + defines += [ "DART_TARGET_OS_FUCHSIA" ] } else if (target_os == "ios") { - defines += [ "TARGET_OS_MACOS" ] - defines += [ "TARGET_OS_MACOS_IOS" ] + defines += [ "DART_TARGET_OS_MACOS" ] + defines += [ "DART_TARGET_OS_MACOS_IOS" ] } else if (target_os == "linux") { - defines += [ "TARGET_OS_LINUX" ] + defines += [ "DART_TARGET_OS_LINUX" ] } else if (target_os == "mac") { - defines += [ "TARGET_OS_MACOS" ] + defines += [ "DART_TARGET_OS_MACOS" ] } else if (target_os == "win") { - defines += [ "TARGET_OS_WINDOWS" ] + defines += [ "DART_TARGET_OS_WINDOWS" ] } else if (target_os == "winuwp") { defines += [ - "TARGET_OS_WINDOWS", - "TARGET_OS_WINDOWS_UWP", + "DART_TARGET_OS_WINDOWS", + "DART_TARGET_OS_WINDOWS_UWP", ] } else { print("Unknown target_os: $target_os") @@ -98,7 +98,7 @@ config("dart_os_config") { # targeting Mac and Linux. This configuration is used to unconditionally target # Fuchsia. It should not be combined with dart_os_config. config("dart_os_fuchsia_config") { - defines = [ "TARGET_OS_FUCHSIA" ] + defines = [ "DART_TARGET_OS_FUCHSIA" ] } config("dart_arch_config") { diff --git a/runtime/bin/abstract_socket_test.cc b/runtime/bin/abstract_socket_test.cc index 7af06b61a20..fab2f26fe49 100644 --- a/runtime/bin/abstract_socket_test.cc +++ b/runtime/bin/abstract_socket_test.cc @@ -8,7 +8,7 @@ // closes the connection and UNIX socket. #include "platform/globals.h" -#if defined(HOST_OS_LINUX) || defined(HOST_OS_ANDROID) +#if defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_ANDROID) #include #include @@ -101,4 +101,4 @@ int main() { return -1; } -#endif // defined(HOST_OS_LINUX) || defined(HOST_OS_ANDROID) +#endif // defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_ANDROID) diff --git a/runtime/bin/address_sanitizer.cc b/runtime/bin/address_sanitizer.cc index 708e1690b14..a780894b7eb 100644 --- a/runtime/bin/address_sanitizer.cc +++ b/runtime/bin/address_sanitizer.cc @@ -4,7 +4,7 @@ #include "platform/globals.h" -#if defined(HOST_OS_LINUX) || defined(HOST_OS_MACOSX) +#if defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_MACOSX) #if defined(__has_feature) #if __has_feature(address_sanitizer) @@ -23,4 +23,4 @@ __asan_default_options() { #endif // __has_feature(address_sanitizer) #endif // defined(__has_feature) -#endif // defined(HOST_OS_LINUX) || defined(HOST_OS_MACOSX) +#endif // defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_MACOSX) diff --git a/runtime/bin/console_posix.cc b/runtime/bin/console_posix.cc index af28e153e6c..17116da2337 100644 --- a/runtime/bin/console_posix.cc +++ b/runtime/bin/console_posix.cc @@ -3,8 +3,8 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_LINUX) || defined(HOST_OS_MACOS) || \ - defined(HOST_OS_ANDROID) || defined(HOST_OS_FUCHSIA) +#if defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_MACOS) || \ + defined(DART_HOST_OS_ANDROID) || defined(DART_HOST_OS_FUCHSIA) #include "bin/console.h" @@ -88,5 +88,5 @@ void Console::RestoreConfig() { } // namespace bin } // namespace dart -#endif // defined(HOST_OS_LINUX) || defined(HOST_OS_MACOS) || - // defined(HOST_OS_ANDROID) || defined(HOST_OS_FUCHSIA) +#endif // defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_MACOS) || \ + // defined(DART_HOST_OS_ANDROID) || defined(DART_HOST_OS_FUCHSIA) diff --git a/runtime/bin/console_win.cc b/runtime/bin/console_win.cc index 6d7511abaad..59e6603f32c 100644 --- a/runtime/bin/console_win.cc +++ b/runtime/bin/console_win.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_WINDOWS) +#if defined(DART_HOST_OS_WINDOWS) #include "bin/console.h" #include "bin/file.h" @@ -152,4 +152,4 @@ void Console::RestoreConfig() { } // namespace bin } // namespace dart -#endif // defined(HOST_OS_WINDOWS) +#endif // defined(DART_HOST_OS_WINDOWS) diff --git a/runtime/bin/crashpad.cc b/runtime/bin/crashpad.cc index 18ed3f53895..d6d900cc7b3 100644 --- a/runtime/bin/crashpad.cc +++ b/runtime/bin/crashpad.cc @@ -21,7 +21,7 @@ namespace dart { namespace bin { #if defined(DART_USE_CRASHPAD) -#if !defined(HOST_OS_WINDOWS) +#if !defined(DART_HOST_OS_WINDOWS) #error "Currently we only support Crashpad on Windows" #endif diff --git a/runtime/bin/crypto_android.cc b/runtime/bin/crypto_android.cc index 6db66ebdff2..f8b1a9f7366 100644 --- a/runtime/bin/crypto_android.cc +++ b/runtime/bin/crypto_android.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_ANDROID) +#if defined(DART_HOST_OS_ANDROID) #include // NOLINT #include // NOLINT @@ -41,4 +41,4 @@ bool Crypto::GetRandomBytes(intptr_t count, uint8_t* buffer) { } // namespace bin } // namespace dart -#endif // defined(HOST_OS_ANDROID) +#endif // defined(DART_HOST_OS_ANDROID) diff --git a/runtime/bin/crypto_fuchsia.cc b/runtime/bin/crypto_fuchsia.cc index c2fe425aa2f..a4623fea50c 100644 --- a/runtime/bin/crypto_fuchsia.cc +++ b/runtime/bin/crypto_fuchsia.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_FUCHSIA) +#if defined(DART_HOST_OS_FUCHSIA) #include "bin/crypto.h" @@ -20,4 +20,4 @@ bool Crypto::GetRandomBytes(intptr_t count, uint8_t* buffer) { } // namespace bin } // namespace dart -#endif // defined(HOST_OS_FUCHSIA) +#endif // defined(DART_HOST_OS_FUCHSIA) diff --git a/runtime/bin/crypto_linux.cc b/runtime/bin/crypto_linux.cc index d3af9e0e895..957578e08f7 100644 --- a/runtime/bin/crypto_linux.cc +++ b/runtime/bin/crypto_linux.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_LINUX) +#if defined(DART_HOST_OS_LINUX) #include // NOLINT #include // NOLINT @@ -41,4 +41,4 @@ bool Crypto::GetRandomBytes(intptr_t count, uint8_t* buffer) { } // namespace bin } // namespace dart -#endif // defined(HOST_OS_LINUX) +#endif // defined(DART_HOST_OS_LINUX) diff --git a/runtime/bin/crypto_macos.cc b/runtime/bin/crypto_macos.cc index b3afc6fe63c..24dfe9bd896 100644 --- a/runtime/bin/crypto_macos.cc +++ b/runtime/bin/crypto_macos.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_MACOS) +#if defined(DART_HOST_OS_MACOS) #include // NOLINT #include // NOLINT @@ -39,4 +39,4 @@ bool Crypto::GetRandomBytes(intptr_t count, uint8_t* buffer) { } // namespace bin } // namespace dart -#endif // defined(HOST_OS_MACOS) +#endif // defined(DART_HOST_OS_MACOS) diff --git a/runtime/bin/crypto_win.cc b/runtime/bin/crypto_win.cc index 4233e980132..fe72659f49f 100644 --- a/runtime/bin/crypto_win.cc +++ b/runtime/bin/crypto_win.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_WINDOWS) +#if defined(DART_HOST_OS_WINDOWS) #include #include "bin/crypto.h" @@ -28,4 +28,4 @@ bool Crypto::GetRandomBytes(intptr_t count, uint8_t* buffer) { } // namespace bin } // namespace dart -#endif // defined(HOST_OS_WINDOWS) +#endif // defined(DART_HOST_OS_WINDOWS) diff --git a/runtime/bin/dartutils.cc b/runtime/bin/dartutils.cc index 72893415d3d..9f60f2a4b6c 100644 --- a/runtime/bin/dartutils.cc +++ b/runtime/bin/dartutils.cc @@ -59,11 +59,11 @@ MagicNumberData kernel_list_magic_number = { MagicNumberData gzip_magic_number = {2, {0x1f, 0x8b, 0, 0}}; static bool IsWindowsHost() { -#if defined(HOST_OS_WINDOWS) +#if defined(DART_HOST_OS_WINDOWS) return true; -#else // defined(HOST_OS_WINDOWS) +#else // defined(DART_HOST_OS_WINDOWS) return false; -#endif // defined(HOST_OS_WINDOWS) +#endif // defined(DART_HOST_OS_WINDOWS) } Dart_Handle CommandLineOptions::CreateRuntimeOptions() { diff --git a/runtime/bin/dfe.cc b/runtime/bin/dfe.cc index be5c2494118..a5710f148f2 100644 --- a/runtime/bin/dfe.cc +++ b/runtime/bin/dfe.cc @@ -140,7 +140,7 @@ bool DFE::CanUseDartFrontend() const { } PathSanitizer::PathSanitizer(const char* path) { -#if defined(HOST_OS_WINDOWS) +#if defined(DART_HOST_OS_WINDOWS) // For Windows we need to massage the paths a bit according to // http://blogs.msdn.com/b/ie/archive/2006/12/06/file-uris-in-windows.aspx // @@ -169,15 +169,15 @@ PathSanitizer::PathSanitizer(const char* path) { sanitized_uri_ = std::unique_ptr(uri); #else sanitized_uri_ = path; -#endif // defined(HOST_OS_WINDOWS) +#endif // defined(DART_HOST_OS_WINDOWS) } const char* PathSanitizer::sanitized_uri() const { -#if defined(HOST_OS_WINDOWS) +#if defined(DART_HOST_OS_WINDOWS) return sanitized_uri_.get(); #else return sanitized_uri_; -#endif // defined(HOST_OS_WINDOWS) +#endif // defined(DART_HOST_OS_WINDOWS) } Dart_KernelCompilationResult DFE::CompileScript(const char* script_uri, diff --git a/runtime/bin/dfe.h b/runtime/bin/dfe.h index b381f9c5819..649cc321b11 100644 --- a/runtime/bin/dfe.h +++ b/runtime/bin/dfe.h @@ -138,11 +138,11 @@ class PathSanitizer { const char* sanitized_uri() const; private: -#if defined(HOST_OS_WINDOWS) +#if defined(DART_HOST_OS_WINDOWS) std::unique_ptr sanitized_uri_; #else const char* sanitized_uri_; -#endif // defined(HOST_OS_WINDOWS) +#endif // defined(DART_HOST_OS_WINDOWS) DISALLOW_COPY_AND_ASSIGN(PathSanitizer); }; diff --git a/runtime/bin/directory_android.cc b/runtime/bin/directory_android.cc index 67e47dfb5a8..27e0f0156d3 100644 --- a/runtime/bin/directory_android.cc +++ b/runtime/bin/directory_android.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_ANDROID) +#if defined(DART_HOST_OS_ANDROID) #include "bin/directory.h" @@ -508,4 +508,4 @@ bool Directory::Rename(Namespace* namespc, } // namespace bin } // namespace dart -#endif // defined(HOST_OS_ANDROID) +#endif // defined(DART_HOST_OS_ANDROID) diff --git a/runtime/bin/directory_fuchsia.cc b/runtime/bin/directory_fuchsia.cc index 4cbffbe2ae7..d37394a70b2 100644 --- a/runtime/bin/directory_fuchsia.cc +++ b/runtime/bin/directory_fuchsia.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_FUCHSIA) +#if defined(DART_HOST_OS_FUCHSIA) #include "bin/directory.h" @@ -512,4 +512,4 @@ bool Directory::Rename(Namespace* namespc, } // namespace bin } // namespace dart -#endif // defined(HOST_OS_FUCHSIA) +#endif // defined(DART_HOST_OS_FUCHSIA) diff --git a/runtime/bin/directory_linux.cc b/runtime/bin/directory_linux.cc index 5321a9a4afe..a1065e3b7a6 100644 --- a/runtime/bin/directory_linux.cc +++ b/runtime/bin/directory_linux.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_LINUX) +#if defined(DART_HOST_OS_LINUX) #include "bin/directory.h" @@ -506,4 +506,4 @@ bool Directory::Rename(Namespace* namespc, } // namespace bin } // namespace dart -#endif // defined(HOST_OS_LINUX) +#endif // defined(DART_HOST_OS_LINUX) diff --git a/runtime/bin/directory_macos.cc b/runtime/bin/directory_macos.cc index 7a884e92e0f..cce21549053 100644 --- a/runtime/bin/directory_macos.cc +++ b/runtime/bin/directory_macos.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_MACOS) +#if defined(DART_HOST_OS_MACOS) #include "bin/directory.h" @@ -446,4 +446,4 @@ bool Directory::Rename(Namespace* namespc, } // namespace bin } // namespace dart -#endif // defined(HOST_OS_MACOS) +#endif // defined(DART_HOST_OS_MACOS) diff --git a/runtime/bin/directory_win.cc b/runtime/bin/directory_win.cc index 16b09846da3..804bfff7309 100644 --- a/runtime/bin/directory_win.cc +++ b/runtime/bin/directory_win.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_WINDOWS) +#if defined(DART_HOST_OS_WINDOWS) #include "bin/directory.h" @@ -531,4 +531,4 @@ bool Directory::Rename(Namespace* namespc, } // namespace bin } // namespace dart -#endif // defined(HOST_OS_WINDOWS) +#endif // defined(DART_HOST_OS_WINDOWS) diff --git a/runtime/bin/elf_loader.cc b/runtime/bin/elf_loader.cc index 22c2cbc8d3a..92d66857a2d 100644 --- a/runtime/bin/elf_loader.cc +++ b/runtime/bin/elf_loader.cc @@ -10,7 +10,7 @@ #include #include -#if defined(HOST_OS_FUCHSIA) +#if defined(DART_HOST_OS_FUCHSIA) #include #endif @@ -25,7 +25,7 @@ namespace elf { class Mappable { public: static Mappable* FromPath(const char* path); -#if defined(HOST_OS_FUCHSIA) || defined(HOST_OS_LINUX) +#if defined(DART_HOST_OS_FUCHSIA) || defined(DART_HOST_OS_LINUX) static Mappable* FromFD(int fd); #endif static Mappable* FromMemory(const uint8_t* memory, size_t size); @@ -151,7 +151,7 @@ Mappable* Mappable::FromPath(const char* path) { return new FileMappable(File::Open(/*namespc=*/nullptr, path, File::kRead)); } -#if defined(HOST_OS_FUCHSIA) || defined(HOST_OS_LINUX) +#if defined(DART_HOST_OS_FUCHSIA) || defined(DART_HOST_OS_LINUX) Mappable* Mappable::FromFD(int fd) { return new FileMappable(File::OpenFD(fd)); } @@ -424,7 +424,7 @@ bool LoadedElf::LoadSegments() { ERROR("Unsupported segment flag set."); } -#if defined(HOST_OS_FUCHSIA) +#if defined(DART_HOST_OS_FUCHSIA) // mmap is less flexible on Fuchsia than on Linux and Darwin, in (at least) // two important ways: // @@ -546,7 +546,7 @@ MappedMemory* LoadedElf::MapFilePiece(uword file_start, using namespace dart::bin::elf; // NOLINT -#if defined(HOST_OS_FUCHSIA) || defined(HOST_OS_LINUX) +#if defined(DART_HOST_OS_FUCHSIA) || defined(DART_HOST_OS_LINUX) DART_EXPORT Dart_LoadedElf* Dart_LoadELF_Fd(int fd, uint64_t file_offset, const char** error, @@ -569,7 +569,7 @@ DART_EXPORT Dart_LoadedElf* Dart_LoadELF_Fd(int fd, } #endif -#if !defined(HOST_OS_FUCHSIA) +#if !defined(DART_HOST_OS_FUCHSIA) DART_EXPORT Dart_LoadedElf* Dart_LoadELF(const char* filename, uint64_t file_offset, const char** error, diff --git a/runtime/bin/entrypoints_verification_test_extension_dllmain_win.cc b/runtime/bin/entrypoints_verification_test_extension_dllmain_win.cc index cbf42d53bee..8ff69eef67e 100644 --- a/runtime/bin/entrypoints_verification_test_extension_dllmain_win.cc +++ b/runtime/bin/entrypoints_verification_test_extension_dllmain_win.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_WINDOWS) +#if defined(DART_HOST_OS_WINDOWS) #define WIN32_LEAN_AND_MEAN #include // NOLINT @@ -12,4 +12,4 @@ BOOL APIENTRY DllMain(HMODULE module, DWORD reason, LPVOID reserved) { return true; } -#endif // defined(HOST_OS_WINDOWS) +#endif // defined(DART_HOST_OS_WINDOWS) diff --git a/runtime/bin/eventhandler.h b/runtime/bin/eventhandler.h index b45deac7ea2..c6c86861015 100644 --- a/runtime/bin/eventhandler.h +++ b/runtime/bin/eventhandler.h @@ -582,15 +582,15 @@ class DescriptorInfoMultipleMixin : public DI { } // namespace dart // The event handler delegation class is OS specific. -#if defined(HOST_OS_ANDROID) +#if defined(DART_HOST_OS_ANDROID) #include "bin/eventhandler_android.h" -#elif defined(HOST_OS_FUCHSIA) +#elif defined(DART_HOST_OS_FUCHSIA) #include "bin/eventhandler_fuchsia.h" -#elif defined(HOST_OS_LINUX) +#elif defined(DART_HOST_OS_LINUX) #include "bin/eventhandler_linux.h" -#elif defined(HOST_OS_MACOS) +#elif defined(DART_HOST_OS_MACOS) #include "bin/eventhandler_macos.h" -#elif defined(HOST_OS_WINDOWS) +#elif defined(DART_HOST_OS_WINDOWS) #include "bin/eventhandler_win.h" #else #error Unknown target os. diff --git a/runtime/bin/eventhandler_android.cc b/runtime/bin/eventhandler_android.cc index 958e5c3766f..b6dfc170f25 100644 --- a/runtime/bin/eventhandler_android.cc +++ b/runtime/bin/eventhandler_android.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_ANDROID) +#if defined(DART_HOST_OS_ANDROID) #include "bin/eventhandler.h" #include "bin/eventhandler_android.h" @@ -432,4 +432,4 @@ uint32_t EventHandlerImplementation::GetHashmapHashFromFd(intptr_t fd) { } // namespace bin } // namespace dart -#endif // defined(HOST_OS_ANDROID) +#endif // defined(DART_HOST_OS_ANDROID) diff --git a/runtime/bin/eventhandler_fuchsia.cc b/runtime/bin/eventhandler_fuchsia.cc index f15bc3befa6..1f14ffbc5d1 100644 --- a/runtime/bin/eventhandler_fuchsia.cc +++ b/runtime/bin/eventhandler_fuchsia.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_FUCHSIA) +#if defined(DART_HOST_OS_FUCHSIA) #include "bin/eventhandler.h" #include "bin/eventhandler_fuchsia.h" @@ -659,4 +659,4 @@ uint32_t EventHandlerImplementation::GetHashmapHashFromFd(intptr_t fd) { } // namespace bin } // namespace dart -#endif // defined(HOST_OS_FUCHSIA) +#endif // defined(DART_HOST_OS_FUCHSIA) diff --git a/runtime/bin/eventhandler_linux.cc b/runtime/bin/eventhandler_linux.cc index 48ef4ef3e00..ac9deb53bcd 100644 --- a/runtime/bin/eventhandler_linux.cc +++ b/runtime/bin/eventhandler_linux.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_LINUX) +#if defined(DART_HOST_OS_LINUX) #include "bin/eventhandler.h" #include "bin/eventhandler_linux.h" @@ -436,4 +436,4 @@ uint32_t EventHandlerImplementation::GetHashmapHashFromFd(intptr_t fd) { } // namespace bin } // namespace dart -#endif // defined(HOST_OS_LINUX) +#endif // defined(DART_HOST_OS_LINUX) diff --git a/runtime/bin/eventhandler_macos.cc b/runtime/bin/eventhandler_macos.cc index 904ae0afc8d..ee8f0fb1394 100644 --- a/runtime/bin/eventhandler_macos.cc +++ b/runtime/bin/eventhandler_macos.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_MACOS) +#if defined(DART_HOST_OS_MACOS) #include "bin/eventhandler.h" #include "bin/eventhandler_macos.h" @@ -496,4 +496,4 @@ uint32_t EventHandlerImplementation::GetHashmapHashFromFd(intptr_t fd) { } // namespace bin } // namespace dart -#endif // defined(HOST_OS_MACOS) +#endif // defined(DART_HOST_OS_MACOS) diff --git a/runtime/bin/eventhandler_win.cc b/runtime/bin/eventhandler_win.cc index 0de689a3c37..abdba9a6ad0 100644 --- a/runtime/bin/eventhandler_win.cc +++ b/runtime/bin/eventhandler_win.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_WINDOWS) +#if defined(DART_HOST_OS_WINDOWS) #include "bin/eventhandler.h" #include "bin/eventhandler_win.h" @@ -1499,4 +1499,4 @@ void EventHandlerImplementation::Shutdown() { } // namespace bin } // namespace dart -#endif // defined(HOST_OS_WINDOWS) +#endif // defined(DART_HOST_OS_WINDOWS) diff --git a/runtime/bin/exe_utils.cc b/runtime/bin/exe_utils.cc index 22f79864c3c..606646574c5 100644 --- a/runtime/bin/exe_utils.cc +++ b/runtime/bin/exe_utils.cc @@ -16,11 +16,11 @@ static bool StartsWithPathSeparator(const char* path, const char* sep, intptr_t sep_length) { return (strncmp(path, sep, sep_length) == 0 -#if defined(HOST_OS_WINDOWS) +#if defined(DART_HOST_OS_WINDOWS) // TODO(aam): GetExecutableName doesn't work reliably on Windows, || *path == '/' #endif - ); + ); // NOLINT } // Returns the directory portion of a given path. diff --git a/runtime/bin/extensions_android.cc b/runtime/bin/extensions_android.cc index 32c32a7d026..f8f153b4c55 100644 --- a/runtime/bin/extensions_android.cc +++ b/runtime/bin/extensions_android.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_ANDROID) +#if defined(DART_HOST_OS_ANDROID) #include // NOLINT #include "bin/extensions.h" @@ -39,4 +39,4 @@ Dart_Handle Extensions::GetError() { } // namespace bin } // namespace dart -#endif // defined(HOST_OS_ANDROID) +#endif // defined(DART_HOST_OS_ANDROID) diff --git a/runtime/bin/extensions_fuchsia.cc b/runtime/bin/extensions_fuchsia.cc index de71763bc11..637533a4dbe 100644 --- a/runtime/bin/extensions_fuchsia.cc +++ b/runtime/bin/extensions_fuchsia.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_FUCHSIA) +#if defined(DART_HOST_OS_FUCHSIA) #include "bin/extensions.h" @@ -43,4 +43,4 @@ Dart_Handle Extensions::GetError() { } // namespace bin } // namespace dart -#endif // defined(HOST_OS_FUCHSIA) +#endif // defined(DART_HOST_OS_FUCHSIA) diff --git a/runtime/bin/extensions_linux.cc b/runtime/bin/extensions_linux.cc index e2359d02dbc..d0f3d0f1418 100644 --- a/runtime/bin/extensions_linux.cc +++ b/runtime/bin/extensions_linux.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_LINUX) +#if defined(DART_HOST_OS_LINUX) #include // NOLINT #include "bin/extensions.h" @@ -39,4 +39,4 @@ Dart_Handle Extensions::GetError() { } // namespace bin } // namespace dart -#endif // defined(HOST_OS_LINUX) +#endif // defined(DART_HOST_OS_LINUX) diff --git a/runtime/bin/extensions_macos.cc b/runtime/bin/extensions_macos.cc index f5436a0c2df..b5be6778608 100644 --- a/runtime/bin/extensions_macos.cc +++ b/runtime/bin/extensions_macos.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_MACOS) +#if defined(DART_HOST_OS_MACOS) #include // NOLINT #include "bin/extensions.h" @@ -39,4 +39,4 @@ Dart_Handle Extensions::GetError() { } // namespace bin } // namespace dart -#endif // defined(HOST_OS_MACOS) +#endif // defined(DART_HOST_OS_MACOS) diff --git a/runtime/bin/extensions_win.cc b/runtime/bin/extensions_win.cc index 23b4349cd3b..d17d84382e3 100644 --- a/runtime/bin/extensions_win.cc +++ b/runtime/bin/extensions_win.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_WINDOWS) +#if defined(DART_HOST_OS_WINDOWS) #include "bin/extensions.h" #include "bin/utils.h" @@ -51,4 +51,4 @@ Dart_Handle Extensions::GetError() { } // namespace bin } // namespace dart -#endif // defined(HOST_OS_WINDOWS) +#endif // defined(DART_HOST_OS_WINDOWS) diff --git a/runtime/bin/fdutils_android.cc b/runtime/bin/fdutils_android.cc index de1fb6b6711..ad30d28ff99 100644 --- a/runtime/bin/fdutils_android.cc +++ b/runtime/bin/fdutils_android.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_ANDROID) +#if defined(DART_HOST_OS_ANDROID) #include "bin/fdutils.h" @@ -139,4 +139,4 @@ void FDUtils::SaveErrorAndClose(intptr_t fd) { } // namespace bin } // namespace dart -#endif // defined(HOST_OS_ANDROID) +#endif // defined(DART_HOST_OS_ANDROID) diff --git a/runtime/bin/fdutils_fuchsia.cc b/runtime/bin/fdutils_fuchsia.cc index eb40c73a75d..f62e66c135c 100644 --- a/runtime/bin/fdutils_fuchsia.cc +++ b/runtime/bin/fdutils_fuchsia.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_FUCHSIA) +#if defined(DART_HOST_OS_FUCHSIA) #include "bin/fdutils.h" @@ -138,4 +138,4 @@ void FDUtils::SaveErrorAndClose(intptr_t fd) { } // namespace bin } // namespace dart -#endif // defined(HOST_OS_FUCHSIA) +#endif // defined(DART_HOST_OS_FUCHSIA) diff --git a/runtime/bin/fdutils_linux.cc b/runtime/bin/fdutils_linux.cc index 1caa7863466..f730ea6c595 100644 --- a/runtime/bin/fdutils_linux.cc +++ b/runtime/bin/fdutils_linux.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_LINUX) +#if defined(DART_HOST_OS_LINUX) #include "bin/fdutils.h" @@ -139,4 +139,4 @@ void FDUtils::SaveErrorAndClose(intptr_t fd) { } // namespace bin } // namespace dart -#endif // defined(HOST_OS_LINUX) +#endif // defined(DART_HOST_OS_LINUX) diff --git a/runtime/bin/fdutils_macos.cc b/runtime/bin/fdutils_macos.cc index 341e85fc9bc..a7b90e3e025 100644 --- a/runtime/bin/fdutils_macos.cc +++ b/runtime/bin/fdutils_macos.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_MACOS) +#if defined(DART_HOST_OS_MACOS) #include "bin/fdutils.h" @@ -139,4 +139,4 @@ void FDUtils::SaveErrorAndClose(intptr_t fd) { } // namespace bin } // namespace dart -#endif // defined(HOST_OS_MACOS) +#endif // defined(DART_HOST_OS_MACOS) diff --git a/runtime/bin/ffi_test/ffi_test_functions_vmspecific.cc b/runtime/bin/ffi_test/ffi_test_functions_vmspecific.cc index 8564aa69235..a4ad2d55e75 100644 --- a/runtime/bin/ffi_test/ffi_test_functions_vmspecific.cc +++ b/runtime/bin/ffi_test/ffi_test_functions_vmspecific.cc @@ -11,7 +11,7 @@ #include "platform/globals.h" #include "platform/memory_sanitizer.h" -#if defined(HOST_OS_WINDOWS) +#if defined(DART_HOST_OS_WINDOWS) #include #include #else @@ -116,7 +116,7 @@ DART_EXPORT uint8_t IsThreadInGenerated() { : 0; } -#if !defined(HOST_OS_WINDOWS) +#if !defined(DART_HOST_OS_WINDOWS) DART_EXPORT void* UnprotectCodeOtherThread(void* isolate, std::condition_variable* var, std::mutex* mut) { @@ -185,7 +185,7 @@ DART_EXPORT void* TestUnprotectCode(void (*fn)(void)) { // Clobbers some registers with special meaning in Dart before re-entry, for // stress-testing. Not used on 32-bit Windows due to complications with Windows // "safeseh". -#if defined(TARGET_OS_WINDOWS) && defined(HOST_ARCH_IA32) +#if defined(DART_TARGET_OS_WINDOWS) && defined(HOST_ARCH_IA32) void ClobberAndCall(void (*fn)()) { fn(); } @@ -203,7 +203,7 @@ struct CallbackTestData { void (*callback)(); }; -#if defined(TARGET_OS_LINUX) +#if defined(DART_TARGET_OS_LINUX) thread_local sigjmp_buf buf; void CallbackTestSignalHandler(int) { @@ -312,13 +312,13 @@ DART_EXPORT intptr_t TestLeafCallApi(void (*fn)()) { #endif } -#endif // defined(TARGET_OS_LINUX) +#endif // defined(DART_TARGET_OS_LINUX) // Restore default SIGPIPE handler, which is only needed on mac // since that is the only platform we explicitly ignore it. // See Platform::Initialize() in platform_macos.cc. DART_EXPORT void RestoreSIGPIPEHandler() { -#if defined(HOST_OS_MACOS) +#if defined(DART_HOST_OS_MACOS) signal(SIGPIPE, SIG_DFL); #endif } @@ -428,7 +428,7 @@ void Fatal(char const* file, int line, char const* error) { #define FATAL(error) Fatal(__FILE__, __LINE__, error) DART_EXPORT void SleepOnAnyOS(intptr_t seconds) { -#if defined(HOST_OS_WINDOWS) +#if defined(DART_HOST_OS_WINDOWS) Sleep(1000 * seconds); #else sleep(seconds); diff --git a/runtime/bin/ffi_unit_test/BUILD.gn b/runtime/bin/ffi_unit_test/BUILD.gn index 2a7b371c387..99396af56e9 100644 --- a/runtime/bin/ffi_unit_test/BUILD.gn +++ b/runtime/bin/ffi_unit_test/BUILD.gn @@ -50,25 +50,23 @@ config("define_target_arch_x64") { } config("define_target_os_android") { - defines = [ "TARGET_OS_ANDROID" ] + defines = [ "DART_TARGET_OS_ANDROID" ] } config("define_target_os_ios") { - # This is TARGET_OS_MACOS_IOS instead of TARGET_OS_IOS because the latter is - # defined by Xcode already. See https://dartbug.com/24453. - defines = [ "TARGET_OS_MACOS_IOS" ] + defines = [ "DART_TARGET_OS_MACOS_IOS" ] } config("define_target_os_linux") { - defines = [ "TARGET_OS_LINUX" ] + defines = [ "DART_TARGET_OS_LINUX" ] } config("define_target_os_macos") { - defines = [ "TARGET_OS_MACOS" ] + defines = [ "DART_TARGET_OS_MACOS" ] } config("define_target_os_windows") { - defines = [ "TARGET_OS_WINDOWS" ] + defines = [ "DART_TARGET_OS_WINDOWS" ] } build_run_ffi_unit_tests("run_ffi_unit_tests_arm_android") { diff --git a/runtime/bin/file.h b/runtime/bin/file.h index 98d374840a2..edeb38873c9 100644 --- a/runtime/bin/file.h +++ b/runtime/bin/file.h @@ -221,7 +221,7 @@ class File : public ReferenceCounted { // (stdin, stout or stderr). static File* OpenStdio(int fd); -#if defined(HOST_OS_FUCHSIA) || defined(HOST_OS_LINUX) +#if defined(DART_HOST_OS_FUCHSIA) || defined(DART_HOST_OS_LINUX) static File* OpenFD(int fd); #endif diff --git a/runtime/bin/file_android.cc b/runtime/bin/file_android.cc index 09902279d7c..b1e9bb04aea 100644 --- a/runtime/bin/file_android.cc +++ b/runtime/bin/file_android.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_ANDROID) +#if defined(DART_HOST_OS_ANDROID) #include "bin/file.h" @@ -748,4 +748,4 @@ File::Identical File::AreIdentical(Namespace* namespc_1, } // namespace bin } // namespace dart -#endif // defined(HOST_OS_ANDROID) +#endif // defined(DART_HOST_OS_ANDROID) diff --git a/runtime/bin/file_fuchsia.cc b/runtime/bin/file_fuchsia.cc index b466119b8ba..aa7f8821c98 100644 --- a/runtime/bin/file_fuchsia.cc +++ b/runtime/bin/file_fuchsia.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_FUCHSIA) +#if defined(DART_HOST_OS_FUCHSIA) #include "bin/file.h" @@ -704,4 +704,4 @@ File::Identical File::AreIdentical(Namespace* namespc_1, } // namespace bin } // namespace dart -#endif // defined(HOST_OS_FUCHSIA) +#endif // defined(DART_HOST_OS_FUCHSIA) diff --git a/runtime/bin/file_linux.cc b/runtime/bin/file_linux.cc index 79c084c91d6..625f05447d1 100644 --- a/runtime/bin/file_linux.cc +++ b/runtime/bin/file_linux.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_LINUX) +#if defined(DART_HOST_OS_LINUX) #include "bin/file.h" @@ -745,4 +745,4 @@ File::Identical File::AreIdentical(Namespace* namespc_1, } // namespace bin } // namespace dart -#endif // defined(HOST_OS_LINUX) +#endif // defined(DART_HOST_OS_LINUX) diff --git a/runtime/bin/file_macos.cc b/runtime/bin/file_macos.cc index fc546c3d976..8fa3cd7c9d3 100644 --- a/runtime/bin/file_macos.cc +++ b/runtime/bin/file_macos.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_MACOS) +#if defined(DART_HOST_OS_MACOS) #include "bin/file.h" @@ -650,4 +650,4 @@ File::Identical File::AreIdentical(Namespace* namespc_1, } // namespace bin } // namespace dart -#endif // defined(HOST_OS_MACOS) +#endif // defined(DART_HOST_OS_MACOS) diff --git a/runtime/bin/file_system_watcher_android.cc b/runtime/bin/file_system_watcher_android.cc index 0ff4c4229e3..e1634414336 100644 --- a/runtime/bin/file_system_watcher_android.cc +++ b/runtime/bin/file_system_watcher_android.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_ANDROID) +#if defined(DART_HOST_OS_ANDROID) #include "bin/file_system_watcher.h" @@ -152,4 +152,4 @@ Dart_Handle FileSystemWatcher::ReadEvents(intptr_t id, intptr_t path_id) { } // namespace bin } // namespace dart -#endif // defined(HOST_OS_ANDROID) +#endif // defined(DART_HOST_OS_ANDROID) diff --git a/runtime/bin/file_system_watcher_fuchsia.cc b/runtime/bin/file_system_watcher_fuchsia.cc index d898542b607..f6defa22e62 100644 --- a/runtime/bin/file_system_watcher_fuchsia.cc +++ b/runtime/bin/file_system_watcher_fuchsia.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_FUCHSIA) +#if defined(DART_HOST_OS_FUCHSIA) #include "bin/file_system_watcher.h" @@ -48,4 +48,4 @@ intptr_t FileSystemWatcher::WatchPath(intptr_t id, } // namespace bin } // namespace dart -#endif // defined(HOST_OS_FUCHSIA) +#endif // defined(DART_HOST_OS_FUCHSIA) diff --git a/runtime/bin/file_system_watcher_linux.cc b/runtime/bin/file_system_watcher_linux.cc index fa482906c52..14c18d29165 100644 --- a/runtime/bin/file_system_watcher_linux.cc +++ b/runtime/bin/file_system_watcher_linux.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_LINUX) +#if defined(DART_HOST_OS_LINUX) #include "bin/file_system_watcher.h" @@ -146,4 +146,4 @@ Dart_Handle FileSystemWatcher::ReadEvents(intptr_t id, intptr_t path_id) { } // namespace bin } // namespace dart -#endif // defined(HOST_OS_LINUX) +#endif // defined(DART_HOST_OS_LINUX) diff --git a/runtime/bin/file_system_watcher_macos.cc b/runtime/bin/file_system_watcher_macos.cc index 2cde121b019..1ccf75355e0 100644 --- a/runtime/bin/file_system_watcher_macos.cc +++ b/runtime/bin/file_system_watcher_macos.cc @@ -3,11 +3,11 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_MACOS) +#if defined(DART_HOST_OS_MACOS) #include "bin/file_system_watcher.h" -#if !HOST_OS_IOS +#if !DART_HOST_OS_IOS #include // NOLINT #include // NOLINT @@ -350,7 +350,7 @@ Dart_Handle FileSystemWatcher::ReadEvents(intptr_t id, intptr_t path_id) { } // namespace bin } // namespace dart -#else // !HOST_OS_IOS +#else // !DART_HOST_OS_IOS namespace dart { namespace bin { @@ -387,5 +387,5 @@ intptr_t FileSystemWatcher::WatchPath(intptr_t id, } // namespace bin } // namespace dart -#endif // !HOST_OS_IOS -#endif // defined(HOST_OS_MACOS) +#endif // !DART_HOST_OS_IOS +#endif // defined(DART_HOST_OS_MACOS) diff --git a/runtime/bin/file_system_watcher_win.cc b/runtime/bin/file_system_watcher_win.cc index b37136337e9..3598f51284d 100644 --- a/runtime/bin/file_system_watcher_win.cc +++ b/runtime/bin/file_system_watcher_win.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_WINDOWS) +#if defined(DART_HOST_OS_WINDOWS) #include "bin/file_system_watcher.h" @@ -132,4 +132,4 @@ Dart_Handle FileSystemWatcher::ReadEvents(intptr_t id, intptr_t path_id) { } // namespace bin } // namespace dart -#endif // defined(HOST_OS_WINDOWS) +#endif // defined(DART_HOST_OS_WINDOWS) diff --git a/runtime/bin/file_win.cc b/runtime/bin/file_win.cc index 6e11076beec..b7f5dbee115 100644 --- a/runtime/bin/file_win.cc +++ b/runtime/bin/file_win.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_WINDOWS) +#if defined(DART_HOST_OS_WINDOWS) #include #include @@ -1128,4 +1128,4 @@ File::Identical File::AreIdentical(Namespace* namespc_1, } // namespace bin } // namespace dart -#endif // defined(HOST_OS_WINDOWS) +#endif // defined(DART_HOST_OS_WINDOWS) diff --git a/runtime/bin/io_buffer.cc b/runtime/bin/io_buffer.cc index 1d5300530e8..f10e55c37b6 100644 --- a/runtime/bin/io_buffer.cc +++ b/runtime/bin/io_buffer.cc @@ -44,7 +44,7 @@ uint8_t* IOBuffer::Reallocate(uint8_t* buffer, intptr_t new_size) { } return buffer; } -#if defined(TARGET_OS_WINDOWS) +#if defined(DART_TARGET_OS_WINDOWS) // It seems windows realloc() doesn't free memory when shrinking, so we'll // manually allocate a new buffer, copy the data and free the old buffer. auto new_buffer = IOBuffer::Allocate(new_size); diff --git a/runtime/bin/main_options.cc b/runtime/bin/main_options.cc index faf1d5c0d21..108fc9131b4 100644 --- a/runtime/bin/main_options.cc +++ b/runtime/bin/main_options.cc @@ -225,13 +225,13 @@ void Options::PrintUsage() { "--root-certs-cache=\n" " The path to a cache directory containing the trusted root certificates to\n" " use for secure socket connections.\n" -#if defined(HOST_OS_LINUX) || \ - defined(HOST_OS_ANDROID) || \ - defined(HOST_OS_FUCHSIA) +#if defined(DART_HOST_OS_LINUX) || \ + defined(DART_HOST_OS_ANDROID) || \ + defined(DART_HOST_OS_FUCHSIA) "--namespace=\n" " The path to a directory that dart:io calls will treat as the root of the\n" " filesystem.\n" -#endif // defined(HOST_OS_LINUX) || defined(HOST_OS_ANDROID) +#endif // defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_ANDROID) "\n" "The following options are only used for VM development and may\n" "be changed in any future version:\n"); diff --git a/runtime/bin/namespace_android.cc b/runtime/bin/namespace_android.cc index f5a2a9fe9a4..26fe976f2f5 100644 --- a/runtime/bin/namespace_android.cc +++ b/runtime/bin/namespace_android.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_ANDROID) +#if defined(DART_HOST_OS_ANDROID) #include "bin/namespace.h" @@ -156,4 +156,4 @@ NamespaceScope::~NamespaceScope() {} } // namespace bin } // namespace dart -#endif // defined(HOST_OS_ANDROID) +#endif // defined(DART_HOST_OS_ANDROID) diff --git a/runtime/bin/namespace_fuchsia.cc b/runtime/bin/namespace_fuchsia.cc index c8cfbcb32d3..87a50aaab0a 100644 --- a/runtime/bin/namespace_fuchsia.cc +++ b/runtime/bin/namespace_fuchsia.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_FUCHSIA) +#if defined(DART_HOST_OS_FUCHSIA) #include "bin/namespace.h" #include "bin/namespace_fuchsia.h" @@ -167,4 +167,4 @@ NamespaceScope::~NamespaceScope() {} } // namespace bin } // namespace dart -#endif // defined(HOST_OS_FUCHSIA) +#endif // defined(DART_HOST_OS_FUCHSIA) diff --git a/runtime/bin/namespace_fuchsia.h b/runtime/bin/namespace_fuchsia.h index ef1fff2f3ab..49d2a7c8e99 100644 --- a/runtime/bin/namespace_fuchsia.h +++ b/runtime/bin/namespace_fuchsia.h @@ -6,7 +6,7 @@ #define RUNTIME_BIN_NAMESPACE_FUCHSIA_H_ #include "platform/globals.h" -#if !defined(HOST_OS_FUCHSIA) +#if !defined(DART_HOST_OS_FUCHSIA) #error "This header file should only be included when targeting Fuchsia." #endif diff --git a/runtime/bin/namespace_linux.cc b/runtime/bin/namespace_linux.cc index 416ea3dee0e..c3d6d7f8ffa 100644 --- a/runtime/bin/namespace_linux.cc +++ b/runtime/bin/namespace_linux.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_LINUX) +#if defined(DART_HOST_OS_LINUX) #include "bin/namespace.h" @@ -156,4 +156,4 @@ NamespaceScope::~NamespaceScope() {} } // namespace bin } // namespace dart -#endif // defined(HOST_OS_LINUX) +#endif // defined(DART_HOST_OS_LINUX) diff --git a/runtime/bin/namespace_macos.cc b/runtime/bin/namespace_macos.cc index f6e55c1b72c..32b8eed0018 100644 --- a/runtime/bin/namespace_macos.cc +++ b/runtime/bin/namespace_macos.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_MACOS) +#if defined(DART_HOST_OS_MACOS) #include "bin/namespace.h" @@ -64,4 +64,4 @@ NamespaceScope::~NamespaceScope() { } // namespace bin } // namespace dart -#endif // defined(HOST_OS_MACOS) +#endif // defined(DART_HOST_OS_MACOS) diff --git a/runtime/bin/namespace_win.cc b/runtime/bin/namespace_win.cc index 09a05f5db34..c654d41c7a7 100644 --- a/runtime/bin/namespace_win.cc +++ b/runtime/bin/namespace_win.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_WINDOWS) +#if defined(DART_HOST_OS_WINDOWS) #include "bin/namespace.h" @@ -74,4 +74,4 @@ NamespaceScope::~NamespaceScope() { } // namespace bin } // namespace dart -#endif // defined(HOST_OS_WINDOWS) +#endif // defined(DART_HOST_OS_WINDOWS) diff --git a/runtime/bin/platform.h b/runtime/bin/platform.h index 0a7db281103..bf2d6b1bde3 100644 --- a/runtime/bin/platform.h +++ b/runtime/bin/platform.h @@ -9,9 +9,9 @@ #include "platform/globals.h" #include "platform/utils.h" -#if defined(HOST_OS_MACOS) +#if defined(DART_HOST_OS_MACOS) #include "bin/platform_macos.h" -#endif // defined(HOST_OS_MACOS) +#endif // defined(DART_HOST_OS_MACOS) namespace dart { namespace bin { diff --git a/runtime/bin/platform_android.cc b/runtime/bin/platform_android.cc index 65559657129..6e5a34a0905 100644 --- a/runtime/bin/platform_android.cc +++ b/runtime/bin/platform_android.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_ANDROID) +#if defined(DART_HOST_OS_ANDROID) #include "bin/platform.h" @@ -173,4 +173,4 @@ void Platform::SetCoreDumpResourceLimit(int value) { } // namespace bin } // namespace dart -#endif // defined(HOST_OS_ANDROID) +#endif // defined(DART_HOST_OS_ANDROID) diff --git a/runtime/bin/platform_fuchsia.cc b/runtime/bin/platform_fuchsia.cc index 3fa55be9c33..5c23480fcee 100644 --- a/runtime/bin/platform_fuchsia.cc +++ b/runtime/bin/platform_fuchsia.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_FUCHSIA) +#if defined(DART_HOST_OS_FUCHSIA) #include "bin/platform.h" @@ -164,4 +164,4 @@ void Platform::SetCoreDumpResourceLimit(int value) { } // namespace bin } // namespace dart -#endif // defined(HOST_OS_FUCHSIA) +#endif // defined(DART_HOST_OS_FUCHSIA) diff --git a/runtime/bin/platform_linux.cc b/runtime/bin/platform_linux.cc index e6571aff5c6..d9443bb1e2c 100644 --- a/runtime/bin/platform_linux.cc +++ b/runtime/bin/platform_linux.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_LINUX) +#if defined(DART_HOST_OS_LINUX) #include "bin/platform.h" @@ -180,4 +180,4 @@ void Platform::SetCoreDumpResourceLimit(int value) { } // namespace bin } // namespace dart -#endif // defined(HOST_OS_LINUX) +#endif // defined(DART_HOST_OS_LINUX) diff --git a/runtime/bin/platform_macos.cc b/runtime/bin/platform_macos.cc index f7c4c8cc4b2..0479776b531 100644 --- a/runtime/bin/platform_macos.cc +++ b/runtime/bin/platform_macos.cc @@ -3,16 +3,16 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_MACOS) +#if defined(DART_HOST_OS_MACOS) #include "bin/platform.h" #include "bin/platform_macos.h" #include -#if !HOST_OS_IOS +#if !DART_HOST_OS_IOS #include // NOLINT -#endif // !HOST_OS_IOS +#endif // !DART_HOST_OS_IOS #include // NOLINT #include #include // NOLINT @@ -107,7 +107,7 @@ int Platform::NumberOfProcessors() { } const char* Platform::OperatingSystem() { -#if HOST_OS_IOS +#if DART_HOST_OS_IOS return "ios"; #else return "macos"; @@ -262,7 +262,7 @@ bool Platform::LocalHostname(char* buffer, intptr_t buffer_length) { } char** Platform::Environment(intptr_t* count) { -#if HOST_OS_IOS +#if DART_HOST_OS_IOS // TODO(zra,chinmaygarde): On iOS, environment variables are seldom used. Wire // this up if someone needs it. In the meantime, we return an empty array. char** result; @@ -343,4 +343,4 @@ void Platform::SetCoreDumpResourceLimit(int value) { } // namespace bin } // namespace dart -#endif // defined(HOST_OS_MACOS) +#endif // defined(DART_HOST_OS_MACOS) diff --git a/runtime/bin/platform_macos_test.cc b/runtime/bin/platform_macos_test.cc index 052d5411f4e..3c37901d596 100644 --- a/runtime/bin/platform_macos_test.cc +++ b/runtime/bin/platform_macos_test.cc @@ -2,7 +2,7 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -#if defined(HOST_OS_MACOS) +#if defined(DART_HOST_OS_MACOS) #include "bin/platform.h" #include "vm/unit_test.h" @@ -50,4 +50,4 @@ TEST_CASE(Platform_ExtractsOSVersionFromString) { } } // namespace dart -#endif // defined(HOST_OS_MACOS) +#endif // defined(DART_HOST_OS_MACOS) diff --git a/runtime/bin/platform_win.cc b/runtime/bin/platform_win.cc index 552e3c2acfb..59e1b74ccd4 100644 --- a/runtime/bin/platform_win.cc +++ b/runtime/bin/platform_win.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_WINDOWS) +#if defined(DART_HOST_OS_WINDOWS) #include "bin/platform.h" @@ -319,4 +319,4 @@ void Platform::SetCoreDumpResourceLimit(int value) { } // namespace bin } // namespace dart -#endif // defined(HOST_OS_WINDOWS) +#endif // defined(DART_HOST_OS_WINDOWS) diff --git a/runtime/bin/process.h b/runtime/bin/process.h index cf141b20f82..5a6adfdc6fc 100644 --- a/runtime/bin/process.h +++ b/runtime/bin/process.h @@ -13,7 +13,7 @@ #include "bin/namespace.h" #include "bin/thread.h" #include "platform/globals.h" -#if !defined(HOST_OS_WINDOWS) +#if !defined(DART_HOST_OS_WINDOWS) #include "platform/signal_blocker.h" #endif #include "platform/utils.h" @@ -348,8 +348,8 @@ class BufferListBase { DISALLOW_COPY_AND_ASSIGN(BufferListBase); }; -#if defined(HOST_OS_ANDROID) || defined(HOST_OS_FUCHSIA) || \ - defined(HOST_OS_LINUX) || defined(HOST_OS_MACOS) +#if defined(DART_HOST_OS_ANDROID) || defined(DART_HOST_OS_FUCHSIA) || \ + defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_MACOS) class BufferList : public BufferListBase { public: BufferList() {} @@ -366,13 +366,13 @@ class BufferList : public BufferListBase { ASSERT(free_size() > 0); ASSERT(free_size() <= kBufferSize); intptr_t block_size = dart::Utils::Minimum(free_size(), available); -#if defined(HOST_OS_FUCHSIA) +#if defined(DART_HOST_OS_FUCHSIA) intptr_t bytes = NO_RETRY_EXPECTED( read(fd, reinterpret_cast(FreeSpaceAddress()), block_size)); #else intptr_t bytes = TEMP_FAILURE_RETRY( read(fd, reinterpret_cast(FreeSpaceAddress()), block_size)); -#endif // defined(HOST_OS_FUCHSIA) +#endif // defined(DART_HOST_OS_FUCHSIA) if (bytes < 0) { return false; } @@ -386,7 +386,7 @@ class BufferList : public BufferListBase { private: DISALLOW_COPY_AND_ASSIGN(BufferList); }; -#endif // defined(HOST_OS_ANDROID) ... +#endif // defined(DART_HOST_OS_ANDROID) ... } // namespace bin } // namespace dart diff --git a/runtime/bin/process_android.cc b/runtime/bin/process_android.cc index 700de02151d..874d99a88c8 100644 --- a/runtime/bin/process_android.cc +++ b/runtime/bin/process_android.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_ANDROID) +#if defined(DART_HOST_OS_ANDROID) #include "bin/process.h" @@ -1159,4 +1159,4 @@ void Process::Cleanup() { } // namespace bin } // namespace dart -#endif // defined(HOST_OS_ANDROID) +#endif // defined(DART_HOST_OS_ANDROID) diff --git a/runtime/bin/process_fuchsia.cc b/runtime/bin/process_fuchsia.cc index f5495d8988b..f87c28c19b3 100644 --- a/runtime/bin/process_fuchsia.cc +++ b/runtime/bin/process_fuchsia.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_FUCHSIA) +#if defined(DART_HOST_OS_FUCHSIA) #include "bin/process.h" @@ -867,4 +867,4 @@ void Process::Cleanup() { } // namespace bin } // namespace dart -#endif // defined(HOST_OS_FUCHSIA) +#endif // defined(DART_HOST_OS_FUCHSIA) diff --git a/runtime/bin/process_linux.cc b/runtime/bin/process_linux.cc index d1897fa530c..c20649e313f 100644 --- a/runtime/bin/process_linux.cc +++ b/runtime/bin/process_linux.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_LINUX) +#if defined(DART_HOST_OS_LINUX) #include "bin/process.h" @@ -1155,4 +1155,4 @@ void Process::Cleanup() { } // namespace bin } // namespace dart -#endif // defined(HOST_OS_LINUX) +#endif // defined(DART_HOST_OS_LINUX) diff --git a/runtime/bin/process_macos.cc b/runtime/bin/process_macos.cc index 78a84ba5f5c..f20c589435b 100644 --- a/runtime/bin/process_macos.cc +++ b/runtime/bin/process_macos.cc @@ -3,11 +3,11 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_MACOS) +#if defined(DART_HOST_OS_MACOS) #include "bin/process.h" -#if !HOST_OS_IOS +#if !DART_HOST_OS_IOS #include // NOLINT #endif #include // NOLINT @@ -468,7 +468,7 @@ class ProcessStarter { ReportChildError(); } -#if !HOST_OS_IOS +#if !DART_HOST_OS_IOS if (program_environment_ != NULL) { // On MacOS you have to do a bit of magic to get to the // environment strings. @@ -521,7 +521,7 @@ class ProcessStarter { (TEMP_FAILURE_RETRY(chdir(working_directory_)) == -1)) { ReportChildError(); } -#if !HOST_OS_IOS +#if !DART_HOST_OS_IOS if (program_environment_ != NULL) { // On MacOS you have to do a bit of magic to get to the // environment strings. @@ -1191,4 +1191,4 @@ void Process::Cleanup() { } // namespace bin } // namespace dart -#endif // defined(HOST_OS_MACOS) +#endif // defined(DART_HOST_OS_MACOS) diff --git a/runtime/bin/process_win.cc b/runtime/bin/process_win.cc index 3567d214ba8..1e3a02cade0 100644 --- a/runtime/bin/process_win.cc +++ b/runtime/bin/process_win.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_WINDOWS) +#if defined(DART_HOST_OS_WINDOWS) #include "bin/process.h" @@ -935,7 +935,7 @@ int64_t Process::CurrentRSS() { // https://docs.microsoft.com/en-us/windows/win32/api/psapi/nf-psapi-getprocessmemoryinfo // claims that GetProcessMemoryInfo is UWP compatible, it is actually not // hence this function cannot work when compiled in UWP mode. -#ifdef TARGET_OS_WINDOWS_UWP +#ifdef DART_TARGET_OS_WINDOWS_UWP return -1; #else PROCESS_MEMORY_COUNTERS pmc; @@ -947,7 +947,7 @@ int64_t Process::CurrentRSS() { } int64_t Process::MaxRSS() { -#ifdef TARGET_OS_WINDOWS_UWP +#ifdef DART_TARGET_OS_WINDOWS_UWP return -1; #else PROCESS_MEMORY_COUNTERS pmc; @@ -1140,4 +1140,4 @@ void Process::Cleanup() { } // namespace bin } // namespace dart -#endif // defined(HOST_OS_WINDOWS) +#endif // defined(DART_HOST_OS_WINDOWS) diff --git a/runtime/bin/root_certificates_unsupported.cc b/runtime/bin/root_certificates_unsupported.cc index e644665ee4d..400877c9787 100644 --- a/runtime/bin/root_certificates_unsupported.cc +++ b/runtime/bin/root_certificates_unsupported.cc @@ -5,7 +5,7 @@ #if !defined(DART_IO_SECURE_SOCKET_DISABLED) #include "platform/globals.h" -#if defined(HOST_OS_MACOS) || defined(HOST_OS_ANDROID) || \ +#if defined(DART_HOST_OS_MACOS) || defined(DART_HOST_OS_ANDROID) || \ defined(DART_IO_ROOT_CERTS_DISABLED) namespace dart { @@ -17,6 +17,6 @@ unsigned int root_certificates_pem_length = 0; } // namespace bin } // namespace dart -#endif // defined(HOST_OS_MACOS) || defined(HOST_OS_ANDROID) || ... +#endif // defined(DART_HOST_OS_MACOS) || defined(DART_HOST_OS_ANDROID) || ... #endif // !defined(DART_IO_SECURE_SOCKET_DISABLED) diff --git a/runtime/bin/secure_socket_filter.cc b/runtime/bin/secure_socket_filter.cc index f515b924b99..efaa4175fb1 100644 --- a/runtime/bin/secure_socket_filter.cc +++ b/runtime/bin/secure_socket_filter.cc @@ -161,7 +161,7 @@ void FUNCTION_NAME(SecureSocket_NewX509CertificateWrapper)( Dart_NativeArguments args) { // This is to be used only in conjunction with certificate trust evaluator // running asynchronously, which is only used on mac/ios at the moment. -#if !defined(HOST_OS_MACOS) +#if !defined(DART_HOST_OS_MACOS) FATAL("This is to be used only on mac/ios platforms"); #endif intptr_t x509_pointer = DartUtils::GetNativeIntptrArgument(args, 0); diff --git a/runtime/bin/security_context_android.cc b/runtime/bin/security_context_android.cc index e0e9378305e..9f39a18aed2 100644 --- a/runtime/bin/security_context_android.cc +++ b/runtime/bin/security_context_android.cc @@ -5,7 +5,7 @@ #if !defined(DART_IO_SECURE_SOCKET_DISABLED) #include "platform/globals.h" -#if defined(HOST_OS_ANDROID) +#if defined(DART_HOST_OS_ANDROID) #include "bin/security_context.h" @@ -64,6 +64,6 @@ TrustEvaluateHandlerFunc SSLCertContext::GetTrustEvaluateHandler() const { } // namespace bin } // namespace dart -#endif // defined(HOST_OS_ANDROID) +#endif // defined(DART_HOST_OS_ANDROID) #endif // !defined(DART_IO_SECURE_SOCKET_DISABLED) diff --git a/runtime/bin/security_context_fuchsia.cc b/runtime/bin/security_context_fuchsia.cc index e8f2f7acdbb..35eba7989b8 100644 --- a/runtime/bin/security_context_fuchsia.cc +++ b/runtime/bin/security_context_fuchsia.cc @@ -5,7 +5,7 @@ #if !defined(DART_IO_SECURE_SOCKET_DISABLED) #include "platform/globals.h" -#if defined(HOST_OS_FUCHSIA) +#if defined(DART_HOST_OS_FUCHSIA) #include "bin/security_context.h" @@ -57,6 +57,6 @@ TrustEvaluateHandlerFunc SSLCertContext::GetTrustEvaluateHandler() const { } // namespace bin } // namespace dart -#endif // defined(HOST_OS_FUCHSIA) +#endif // defined(DART_HOST_OS_FUCHSIA) #endif // !defined(DART_IO_SECURE_SOCKET_DISABLED) diff --git a/runtime/bin/security_context_linux.cc b/runtime/bin/security_context_linux.cc index b251a0a3861..b940c758797 100644 --- a/runtime/bin/security_context_linux.cc +++ b/runtime/bin/security_context_linux.cc @@ -5,7 +5,7 @@ #if !defined(DART_IO_SECURE_SOCKET_DISABLED) #include "platform/globals.h" -#if defined(HOST_OS_LINUX) +#if defined(DART_HOST_OS_LINUX) #include "bin/security_context.h" @@ -83,6 +83,6 @@ TrustEvaluateHandlerFunc SSLCertContext::GetTrustEvaluateHandler() const { } // namespace bin } // namespace dart -#endif // defined(HOST_OS_LINUX) +#endif // defined(DART_HOST_OS_LINUX) #endif // !defined(DART_IO_SECURE_SOCKET_DISABLED) diff --git a/runtime/bin/security_context_macos.cc b/runtime/bin/security_context_macos.cc index 1cba22d2ecb..410a33b11b3 100644 --- a/runtime/bin/security_context_macos.cc +++ b/runtime/bin/security_context_macos.cc @@ -5,7 +5,7 @@ #if !defined(DART_IO_SECURE_SOCKET_DISABLED) #include "platform/globals.h" -#if defined(HOST_OS_MACOS) +#if defined(DART_HOST_OS_MACOS) #include "bin/security_context.h" @@ -347,6 +347,6 @@ void SSLCertContext::TrustBuiltinRoots() { } // namespace bin } // namespace dart -#endif // defined(HOST_OS_MACOS) +#endif // defined(DART_HOST_OS_MACOS) #endif // !defined(DART_IO_SECURE_SOCKET_DISABLED) diff --git a/runtime/bin/security_context_win.cc b/runtime/bin/security_context_win.cc index 6b19a89e15e..f61ae55433c 100644 --- a/runtime/bin/security_context_win.cc +++ b/runtime/bin/security_context_win.cc @@ -5,7 +5,7 @@ #if !defined(DART_IO_SECURE_SOCKET_DISABLED) #include "platform/globals.h" -#if defined(HOST_OS_WINDOWS) +#if defined(DART_HOST_OS_WINDOWS) #include "bin/security_context.h" @@ -20,7 +20,7 @@ #include "bin/secure_socket_utils.h" #include "platform/syslog.h" -#ifndef TARGET_OS_WINDOWS_UWP +#ifndef DART_TARGET_OS_WINDOWS_UWP #pragma comment(lib, "crypt32.lib") #endif @@ -42,7 +42,7 @@ static void PrintSSLErr(const char* str) { Syslog::PrintErr("%s %s\n", str, error_string); } -#ifndef TARGET_OS_WINDOWS_UWP +#ifndef DART_TARGET_OS_WINDOWS_UWP static bool AddCertificatesFromNamedSystemStore(const wchar_t* name, DWORD store_type, X509_STORE* store) { @@ -158,13 +158,13 @@ static bool AddCertificatesFromSystemStore(DWORD store_type, } return true; } -#endif // ifdef TARGET_OS_WINDOWS_UWP +#endif // ifdef DART_TARGET_OS_WINDOWS_UWP // Add certificates from Windows trusted root store. static bool AddCertificatesFromRootStore(X509_STORE* store) { // The UWP platform doesn't support CertEnumCertificatesInStore hence // this function cannot work when compiled in UWP mode. -#ifdef TARGET_OS_WINDOWS_UWP +#ifdef DART_TARGET_OS_WINDOWS_UWP return false; #else if (!AddCertificatesFromSystemStore(CERT_SYSTEM_STORE_CURRENT_USER, store)) { @@ -176,7 +176,7 @@ static bool AddCertificatesFromRootStore(X509_STORE* store) { } return true; -#endif // ifdef TARGET_OS_WINDOWS_UWP +#endif // ifdef DART_TARGET_OS_WINDOWS_UWP } void SSLCertContext::TrustBuiltinRoots() { @@ -226,6 +226,6 @@ TrustEvaluateHandlerFunc SSLCertContext::GetTrustEvaluateHandler() const { } // namespace bin } // namespace dart -#endif // defined(HOST_OS_WINDOWS) +#endif // defined(DART_HOST_OS_WINDOWS) #endif // !defined(DART_IO_SECURE_SOCKET_DISABLED) diff --git a/runtime/bin/snapshot_utils.cc b/runtime/bin/snapshot_utils.cc index 5168ac57f8c..7361612b322 100644 --- a/runtime/bin/snapshot_utils.cc +++ b/runtime/bin/snapshot_utils.cc @@ -201,7 +201,7 @@ static AppSnapshot* TryReadAppSnapshotElf( *isolate_data_buffer = nullptr, *isolate_instructions_buffer = nullptr; Dart_LoadedElf* handle = nullptr; -#if !defined(HOST_OS_FUCHSIA) +#if !defined(DART_HOST_OS_FUCHSIA) if (force_load_elf_from_memory) { #endif File* const file = @@ -218,7 +218,7 @@ static AppSnapshot* TryReadAppSnapshotElf( &isolate_data_buffer, &isolate_instructions_buffer); delete memory; file->Release(); -#if !defined(HOST_OS_FUCHSIA) +#if !defined(DART_HOST_OS_FUCHSIA) } else { handle = Dart_LoadELF(script_name, file_offset, &error, &vm_data_buffer, &vm_instructions_buffer, &isolate_data_buffer, @@ -349,7 +349,7 @@ AppSnapshot* Snapshot::TryReadAppSnapshot(const char* script_uri, // For testing AOT with the standalone embedder, we also support loading // from a dynamic library to simulate what happens on iOS. -#if defined(TARGET_OS_LINUX) || defined(TARGET_OS_MACOS) +#if defined(DART_TARGET_OS_LINUX) || defined(DART_TARGET_OS_MACOS) // On Linux and OSX, resolve the script path before passing into dlopen() // since dlopen will not search the filesystem for paths like 'libtest.so'. std::unique_ptr absolute_path{ diff --git a/runtime/bin/socket.cc b/runtime/bin/socket.cc index 1e137dbdbcb..ec52dad47d1 100644 --- a/runtime/bin/socket.cc +++ b/runtime/bin/socket.cc @@ -208,12 +208,12 @@ Dart_Handle ListeningSocketRegistry::CreateUnixDomainBindListen( return result; } -#if defined(HOST_OS_LINUX) || defined(HOST_OS_ANDROID) +#if defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_ANDROID) // Abstract unix domain socket doesn't exist in file system. if (File::Exists(namespc, addr.un.sun_path) && path[0] != '@') { #else if (File::Exists(namespc, addr.un.sun_path)) { -#endif // defined(HOST_OS_LINUX) || defined(HOST_OS_ANDROID) +#endif // defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_ANDROID) if (unix_domain_sockets_ != nullptr) { // If there is a socket listening on this file. Ensure // that it was created with `shared` mode and current `shared` @@ -285,7 +285,7 @@ bool ListeningSocketRegistry::CloseOneSafe(OSSocket* os_socket, } // Unlink the socket file, if os_socket contains unix domain sockets. if (os_socket->address.addr.sa_family == AF_UNIX) { -#if defined(HOST_OS_LINUX) || defined(HOST_OS_ANDROID) +#if defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_ANDROID) // If the socket is abstract, which has a path starting with a null byte, // unlink() is not necessary because the file doesn't exist. if (os_socket->address.un.sun_path[0] != '\0') { @@ -293,7 +293,7 @@ bool ListeningSocketRegistry::CloseOneSafe(OSSocket* os_socket, } #else Utils::Unlink(os_socket->address.un.sun_path); -#endif // defined(HOST_OS_LINUX) || defined(HOST_OS_ANDROID) +#endif // defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_ANDROID) // Remove os_socket from unix_domain_sockets_ list. OSSocket* prev = nullptr; OSSocket* current = unix_domain_sockets_; @@ -409,7 +409,7 @@ void FUNCTION_NAME(Socket_CreateBindConnect)(Dart_NativeArguments args) { void FUNCTION_NAME(Socket_CreateUnixDomainBindConnect)( Dart_NativeArguments args) { -#if defined(HOST_OS_WINDOWS) || defined(HOST_OS_FUCHSIA) +#if defined(DART_HOST_OS_WINDOWS) || defined(DART_HOST_OS_FUCHSIA) OSError os_error( -1, "Unix domain sockets are not available on this operating system.", OSError::kUnknown); @@ -450,11 +450,11 @@ void FUNCTION_NAME(Socket_CreateUnixDomainBindConnect)( } else { Dart_SetReturnValue(args, DartUtils::NewDartOSError()); } -#endif // defined(HOST_OS_WINDOWS) || defined(HOST_OS_FUCHSIA) +#endif // defined(DART_HOST_OS_WINDOWS) || defined(DART_HOST_OS_FUCHSIA) } void FUNCTION_NAME(Socket_CreateUnixDomainConnect)(Dart_NativeArguments args) { -#if defined(HOST_OS_WINDOWS) || defined(HOST_OS_FUCHSIA) +#if defined(DART_HOST_OS_WINDOWS) || defined(DART_HOST_OS_FUCHSIA) OSError os_error( -1, "Unix domain sockets are not available on this operating system.", OSError::kUnknown); @@ -481,7 +481,7 @@ void FUNCTION_NAME(Socket_CreateUnixDomainConnect)(Dart_NativeArguments args) { } else { Dart_SetReturnValue(args, DartUtils::NewDartOSError()); } -#endif // defined(HOST_OS_WINDOWS) || defined(HOST_OS_FUCHSIA) +#endif // defined(DART_HOST_OS_WINDOWS) || defined(DART_HOST_OS_FUCHSIA) } void FUNCTION_NAME(Socket_CreateBindDatagram)(Dart_NativeArguments args) { @@ -855,7 +855,7 @@ void FUNCTION_NAME(ServerSocket_CreateBindListen)(Dart_NativeArguments args) { void FUNCTION_NAME(ServerSocket_CreateUnixDomainBindListen)( Dart_NativeArguments args) { -#if defined(HOST_OS_WINDOWS) +#if defined(DART_HOST_OS_WINDOWS) OSError os_error( -1, "Unix domain sockets are not available on this operating system.", OSError::kUnknown); @@ -876,7 +876,7 @@ void FUNCTION_NAME(ServerSocket_CreateUnixDomainBindListen)( ListeningSocketRegistry::Instance()->CreateUnixDomainBindListen( socket_object, namespc, path, backlog, shared); Dart_SetReturnValue(args, result); -#endif // defined(HOST_OS_WINDOWS) +#endif // defined(DART_HOST_OS_WINDOWS) } void FUNCTION_NAME(ServerSocket_Accept)(Dart_NativeArguments args) { diff --git a/runtime/bin/socket.h b/runtime/bin/socket.h index d7fc972c0f7..b0efe349a4a 100644 --- a/runtime/bin/socket.h +++ b/runtime/bin/socket.h @@ -262,7 +262,7 @@ class ListeningSocketRegistry { const char* path) { while (current != NULL) { ASSERT(current->address.addr.sa_family == AF_UNIX); -#if defined(HOST_OS_LINUX) || defined(HOST_OS_ANDROID) +#if defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_ANDROID) bool condition; if (path[0] == '\0') { condition = current->address.un.sun_path[0] == '\0' && @@ -280,7 +280,7 @@ class ListeningSocketRegistry { namespc, path) == File::kIdentical) { return current; } -#endif // defined(HOST_OS_LINUX) || defined(HOST_OS_ANDROID) +#endif // defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_ANDROID) current = current->next; } return NULL; diff --git a/runtime/bin/socket_android.cc b/runtime/bin/socket_android.cc index 196cb360612..deddbd2e22a 100644 --- a/runtime/bin/socket_android.cc +++ b/runtime/bin/socket_android.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_ANDROID) +#if defined(DART_HOST_OS_ANDROID) #include "bin/socket.h" @@ -280,4 +280,4 @@ intptr_t ServerSocket::Accept(intptr_t fd) { } // namespace bin } // namespace dart -#endif // defined(HOST_OS_ANDROID) +#endif // defined(DART_HOST_OS_ANDROID) diff --git a/runtime/bin/socket_base.cc b/runtime/bin/socket_base.cc index d97ced4cba8..482163e0fab 100644 --- a/runtime/bin/socket_base.cc +++ b/runtime/bin/socket_base.cc @@ -128,7 +128,7 @@ void SocketAddress::GetSockAddr(Dart_Handle obj, RawAddr* addr) { Dart_Handle SocketAddress::GetUnixDomainSockAddr(const char* path, Namespace* namespc, RawAddr* addr) { -#if defined(HOST_OS_LINUX) || defined(HOST_OS_ANDROID) +#if defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_ANDROID) NamespaceScope ns(namespc, path); path = ns.path(); bool is_abstract = (path[0] == '@'); @@ -139,7 +139,7 @@ Dart_Handle SocketAddress::GetUnixDomainSockAddr(const char* path, // connection will be rejected. bzero(addr->un.sun_path, sizeof(addr->un.sun_path)); } -#endif // defined(HOST_OS_LINUX) || defined(HOST_OS_ANDROID) +#endif // defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_ANDROID) if (sizeof(path) > sizeof(addr->un.sun_path)) { OSError os_error(-1, "The length of path exceeds the limit. " @@ -149,12 +149,12 @@ Dart_Handle SocketAddress::GetUnixDomainSockAddr(const char* path, } addr->un.sun_family = AF_UNIX; Utils::SNPrint(addr->un.sun_path, sizeof(addr->un.sun_path), "%s", path); -#if defined(HOST_OS_LINUX) || defined(HOST_OS_ANDROID) +#if defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_ANDROID) // In case of abstract namespace, transfer the leading '@' into a null byte. if (is_abstract) { addr->un.sun_path[0] = '\0'; } -#endif // defined(HOST_OS_LINUX) || defined(HOST_OS_ANDROID) +#endif // defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_ANDROID) return Dart_Null(); } diff --git a/runtime/bin/socket_base.h b/runtime/bin/socket_base.h index 07ee42efa60..0442e5bd416 100644 --- a/runtime/bin/socket_base.h +++ b/runtime/bin/socket_base.h @@ -7,15 +7,15 @@ #include "platform/globals.h" // Declare the OS-specific types ahead of defining the generic class. -#if defined(HOST_OS_ANDROID) +#if defined(DART_HOST_OS_ANDROID) #include "bin/socket_base_android.h" -#elif defined(HOST_OS_FUCHSIA) +#elif defined(DART_HOST_OS_FUCHSIA) #include "bin/socket_base_fuchsia.h" -#elif defined(HOST_OS_LINUX) +#elif defined(DART_HOST_OS_LINUX) #include "bin/socket_base_linux.h" -#elif defined(HOST_OS_MACOS) +#elif defined(DART_HOST_OS_MACOS) #include "bin/socket_base_macos.h" -#elif defined(HOST_OS_WINDOWS) +#elif defined(DART_HOST_OS_WINDOWS) #include "bin/socket_base_win.h" #else #error Unknown target os. @@ -86,7 +86,8 @@ class SocketAddress { static intptr_t GetAddrScope(const RawAddr& addr); private: -#if defined(HOST_OS_LINUX) || defined(HOST_OS_MACOS) || defined(HOST_OS_ANDROID) +#if defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_MACOS) || \ + defined(DART_HOST_OS_ANDROID) // Unix domain address is only on Linux, Mac OS and Android now. // unix(7) require sun_path to be 108 bytes on Linux and Android, 104 bytes on // Mac OS. @@ -95,8 +96,8 @@ class SocketAddress { char as_string_[kMaxUnixPathLength]; #else char as_string_[INET6_ADDRSTRLEN]; -#endif // defined(HOST_OS_LINUX) || defined(HOST_OS_MACOS) || \ - // defined(HOST_OS_ANDROID) +#endif // defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_MACOS) || \ + // defined(DART_HOST_OS_ANDROID) RawAddr addr_; DISALLOW_COPY_AND_ASSIGN(SocketAddress); diff --git a/runtime/bin/socket_base_android.cc b/runtime/bin/socket_base_android.cc index 68163c6f61a..f916aee694d 100644 --- a/runtime/bin/socket_base_android.cc +++ b/runtime/bin/socket_base_android.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_ANDROID) +#if defined(DART_HOST_OS_ANDROID) #include "bin/socket_base.h" @@ -470,4 +470,4 @@ bool SocketBase::LeaveMulticast(intptr_t fd, } // namespace bin } // namespace dart -#endif // defined(HOST_OS_ANDROID) +#endif // defined(DART_HOST_OS_ANDROID) diff --git a/runtime/bin/socket_base_fuchsia.cc b/runtime/bin/socket_base_fuchsia.cc index be1eb256a49..5f36731080d 100644 --- a/runtime/bin/socket_base_fuchsia.cc +++ b/runtime/bin/socket_base_fuchsia.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_FUCHSIA) +#if defined(DART_HOST_OS_FUCHSIA) #include "bin/socket_base.h" @@ -429,4 +429,4 @@ bool SocketBase::LeaveMulticast(intptr_t fd, } // namespace bin } // namespace dart -#endif // defined(HOST_OS_FUCHSIA) +#endif // defined(DART_HOST_OS_FUCHSIA) diff --git a/runtime/bin/socket_base_linux.cc b/runtime/bin/socket_base_linux.cc index 89e579f50d4..01d9d22655d 100644 --- a/runtime/bin/socket_base_linux.cc +++ b/runtime/bin/socket_base_linux.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_LINUX) +#if defined(DART_HOST_OS_LINUX) #include "bin/socket_base.h" @@ -472,4 +472,4 @@ bool SocketBase::LeaveMulticast(intptr_t fd, } // namespace bin } // namespace dart -#endif // defined(HOST_OS_LINUX) +#endif // defined(DART_HOST_OS_LINUX) diff --git a/runtime/bin/socket_base_macos.cc b/runtime/bin/socket_base_macos.cc index 0b259eef8e6..cb26ed42d5b 100644 --- a/runtime/bin/socket_base_macos.cc +++ b/runtime/bin/socket_base_macos.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_MACOS) +#if defined(DART_HOST_OS_MACOS) #include "bin/socket_base.h" @@ -484,4 +484,4 @@ bool SocketBase::LeaveMulticast(intptr_t fd, } // namespace bin } // namespace dart -#endif // defined(HOST_OS_MACOS) +#endif // defined(DART_HOST_OS_MACOS) diff --git a/runtime/bin/socket_base_win.cc b/runtime/bin/socket_base_win.cc index d762ad9d33d..120d42f5ca0 100644 --- a/runtime/bin/socket_base_win.cc +++ b/runtime/bin/socket_base_win.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_WINDOWS) +#if defined(DART_HOST_OS_WINDOWS) #include "bin/socket_base.h" @@ -489,4 +489,4 @@ bool SocketBase::LeaveMulticast(intptr_t fd, } // namespace bin } // namespace dart -#endif // defined(HOST_OS_WINDOWS) +#endif // defined(DART_HOST_OS_WINDOWS) diff --git a/runtime/bin/socket_fuchsia.cc b/runtime/bin/socket_fuchsia.cc index fa8a95837f5..9408ced941d 100644 --- a/runtime/bin/socket_fuchsia.cc +++ b/runtime/bin/socket_fuchsia.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_FUCHSIA) +#if defined(DART_HOST_OS_FUCHSIA) #include "bin/socket.h" @@ -266,4 +266,4 @@ intptr_t ServerSocket::Accept(intptr_t fd) { } // namespace bin } // namespace dart -#endif // defined(HOST_OS_FUCHSIA) +#endif // defined(DART_HOST_OS_FUCHSIA) diff --git a/runtime/bin/socket_linux.cc b/runtime/bin/socket_linux.cc index 686852f2b85..166979c7d3d 100644 --- a/runtime/bin/socket_linux.cc +++ b/runtime/bin/socket_linux.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_LINUX) +#if defined(DART_HOST_OS_LINUX) #include "bin/socket.h" @@ -277,4 +277,4 @@ intptr_t ServerSocket::Accept(intptr_t fd) { } // namespace bin } // namespace dart -#endif // defined(HOST_OS_LINUX) +#endif // defined(DART_HOST_OS_LINUX) diff --git a/runtime/bin/socket_macos.cc b/runtime/bin/socket_macos.cc index f9e00c2c0ff..0e2767b06f3 100644 --- a/runtime/bin/socket_macos.cc +++ b/runtime/bin/socket_macos.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_MACOS) +#if defined(DART_HOST_OS_MACOS) #include "bin/socket.h" @@ -294,4 +294,4 @@ intptr_t ServerSocket::Accept(intptr_t fd) { } // namespace bin } // namespace dart -#endif // defined(HOST_OS_MACOS) +#endif // defined(DART_HOST_OS_MACOS) diff --git a/runtime/bin/socket_win.cc b/runtime/bin/socket_win.cc index 4e393dcb99a..ac93b317ae3 100644 --- a/runtime/bin/socket_win.cc +++ b/runtime/bin/socket_win.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_WINDOWS) +#if defined(DART_HOST_OS_WINDOWS) #include "bin/builtin.h" #include "bin/eventhandler.h" @@ -315,4 +315,4 @@ bool ServerSocket::StartAccept(intptr_t fd) { } // namespace bin } // namespace dart -#endif // defined(HOST_OS_WINDOWS) +#endif // defined(DART_HOST_OS_WINDOWS) diff --git a/runtime/bin/stdio_android.cc b/runtime/bin/stdio_android.cc index f019f25fbff..1afb34fecd7 100644 --- a/runtime/bin/stdio_android.cc +++ b/runtime/bin/stdio_android.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_ANDROID) +#if defined(DART_HOST_OS_ANDROID) #include "bin/stdio.h" @@ -111,4 +111,4 @@ bool Stdout::AnsiSupported(intptr_t fd, bool* supported) { } // namespace bin } // namespace dart -#endif // defined(HOST_OS_ANDROID) +#endif // defined(DART_HOST_OS_ANDROID) diff --git a/runtime/bin/stdio_fuchsia.cc b/runtime/bin/stdio_fuchsia.cc index a626fee31e4..2f91a9c5440 100644 --- a/runtime/bin/stdio_fuchsia.cc +++ b/runtime/bin/stdio_fuchsia.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_FUCHSIA) +#if defined(DART_HOST_OS_FUCHSIA) #include "bin/stdio.h" @@ -62,4 +62,4 @@ bool Stdout::AnsiSupported(intptr_t fd, bool* supported) { } // namespace bin } // namespace dart -#endif // defined(HOST_OS_FUCHSIA) +#endif // defined(DART_HOST_OS_FUCHSIA) diff --git a/runtime/bin/stdio_linux.cc b/runtime/bin/stdio_linux.cc index 50e25f3eae0..17db9bd8e95 100644 --- a/runtime/bin/stdio_linux.cc +++ b/runtime/bin/stdio_linux.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_LINUX) +#if defined(DART_HOST_OS_LINUX) #include "bin/stdio.h" @@ -111,4 +111,4 @@ bool Stdout::AnsiSupported(intptr_t fd, bool* supported) { } // namespace bin } // namespace dart -#endif // defined(HOST_OS_LINUX) +#endif // defined(DART_HOST_OS_LINUX) diff --git a/runtime/bin/stdio_macos.cc b/runtime/bin/stdio_macos.cc index 3b1aa5e9e46..969b75dc049 100644 --- a/runtime/bin/stdio_macos.cc +++ b/runtime/bin/stdio_macos.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_MACOS) +#if defined(DART_HOST_OS_MACOS) #include "bin/stdio.h" @@ -111,4 +111,4 @@ bool Stdout::AnsiSupported(intptr_t fd, bool* supported) { } // namespace bin } // namespace dart -#endif // defined(HOST_OS_MACOS) +#endif // defined(DART_HOST_OS_MACOS) diff --git a/runtime/bin/stdio_win.cc b/runtime/bin/stdio_win.cc index cbfc2d89519..dc65cbaa3b8 100644 --- a/runtime/bin/stdio_win.cc +++ b/runtime/bin/stdio_win.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_WINDOWS) +#if defined(DART_HOST_OS_WINDOWS) #include "bin/stdio.h" @@ -136,4 +136,4 @@ bool Stdout::AnsiSupported(intptr_t fd, bool* supported) { } // namespace bin } // namespace dart -#endif // defined(HOST_OS_WINDOWS) +#endif // defined(DART_HOST_OS_WINDOWS) diff --git a/runtime/bin/sync_socket_android.cc b/runtime/bin/sync_socket_android.cc index 80094f728e6..b38f8090eb9 100644 --- a/runtime/bin/sync_socket_android.cc +++ b/runtime/bin/sync_socket_android.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_ANDROID) +#if defined(DART_HOST_OS_ANDROID) #include "bin/sync_socket.h" @@ -89,4 +89,4 @@ void SynchronousSocket::Close(intptr_t fd) { } // namespace bin } // namespace dart -#endif // defined(HOST_OS_ANDROID) +#endif // defined(DART_HOST_OS_ANDROID) diff --git a/runtime/bin/sync_socket_fuchsia.cc b/runtime/bin/sync_socket_fuchsia.cc index 23461f4ff4d..2775e5bce72 100644 --- a/runtime/bin/sync_socket_fuchsia.cc +++ b/runtime/bin/sync_socket_fuchsia.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_FUCHSIA) +#if defined(DART_HOST_OS_FUCHSIA) #include "bin/sync_socket.h" @@ -89,4 +89,4 @@ void SynchronousSocket::Close(intptr_t fd) { } // namespace bin } // namespace dart -#endif // defined(HOST_OS_FUCHSIA) +#endif // defined(DART_HOST_OS_FUCHSIA) diff --git a/runtime/bin/sync_socket_linux.cc b/runtime/bin/sync_socket_linux.cc index 963787bf7b9..5c72f32d656 100644 --- a/runtime/bin/sync_socket_linux.cc +++ b/runtime/bin/sync_socket_linux.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_LINUX) +#if defined(DART_HOST_OS_LINUX) #include "bin/sync_socket.h" @@ -89,4 +89,4 @@ void SynchronousSocket::Close(intptr_t fd) { } // namespace bin } // namespace dart -#endif // defined(HOST_OS_LINUX) +#endif // defined(DART_HOST_OS_LINUX) diff --git a/runtime/bin/sync_socket_macos.cc b/runtime/bin/sync_socket_macos.cc index e266341be87..83535b85d2e 100644 --- a/runtime/bin/sync_socket_macos.cc +++ b/runtime/bin/sync_socket_macos.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_MACOS) +#if defined(DART_HOST_OS_MACOS) #include "bin/sync_socket.h" @@ -92,4 +92,4 @@ void SynchronousSocket::Close(intptr_t fd) { } // namespace bin } // namespace dart -#endif // defined(HOST_OS_MACOS) +#endif // defined(DART_HOST_OS_MACOS) diff --git a/runtime/bin/sync_socket_win.cc b/runtime/bin/sync_socket_win.cc index d4e72fee4b7..d690e293315 100644 --- a/runtime/bin/sync_socket_win.cc +++ b/runtime/bin/sync_socket_win.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_WINDOWS) +#if defined(DART_HOST_OS_WINDOWS) #include "bin/socket_base.h" #include "bin/sync_socket.h" @@ -96,4 +96,4 @@ void SynchronousSocket::Close(intptr_t fd) { } // namespace bin } // namespace dart -#endif // defined(HOST_OS_WINDOWS) +#endif // defined(DART_HOST_OS_WINDOWS) diff --git a/runtime/bin/test_extension_dllmain_win.cc b/runtime/bin/test_extension_dllmain_win.cc index 2cee3110197..161913ba120 100644 --- a/runtime/bin/test_extension_dllmain_win.cc +++ b/runtime/bin/test_extension_dllmain_win.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_WINDOWS) +#if defined(DART_HOST_OS_WINDOWS) #define WIN32_LEAN_AND_MEAN #include // NOLINT @@ -12,4 +12,4 @@ BOOL APIENTRY DllMain(HMODULE module, DWORD reason, LPVOID reserved) { return true; } -#endif // defined(HOST_OS_WINDOWS) +#endif // defined(DART_HOST_OS_WINDOWS) diff --git a/runtime/bin/thread.h b/runtime/bin/thread.h index 09c9743e601..d6716c9c02a 100644 --- a/runtime/bin/thread.h +++ b/runtime/bin/thread.h @@ -16,15 +16,15 @@ class Monitor; } // namespace dart // Declare the OS-specific types ahead of defining the generic classes. -#if defined(HOST_OS_ANDROID) +#if defined(DART_HOST_OS_ANDROID) #include "bin/thread_android.h" -#elif defined(HOST_OS_FUCHSIA) +#elif defined(DART_HOST_OS_FUCHSIA) #include "bin/thread_fuchsia.h" -#elif defined(HOST_OS_LINUX) +#elif defined(DART_HOST_OS_LINUX) #include "bin/thread_linux.h" -#elif defined(HOST_OS_MACOS) +#elif defined(DART_HOST_OS_MACOS) #include "bin/thread_macos.h" -#elif defined(HOST_OS_WINDOWS) +#elif defined(DART_HOST_OS_WINDOWS) #include "bin/thread_win.h" #else #error Unknown target os. diff --git a/runtime/bin/thread_android.cc b/runtime/bin/thread_android.cc index 28b47adf648..d386ceb9d3d 100644 --- a/runtime/bin/thread_android.cc +++ b/runtime/bin/thread_android.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_ANDROID) +#if defined(DART_HOST_OS_ANDROID) #include "bin/thread.h" #include "bin/thread_android.h" @@ -298,4 +298,4 @@ void Monitor::NotifyAll() { } // namespace bin } // namespace dart -#endif // defined(HOST_OS_ANDROID) +#endif // defined(DART_HOST_OS_ANDROID) diff --git a/runtime/bin/thread_fuchsia.cc b/runtime/bin/thread_fuchsia.cc index d71a1dfa435..66b847d1551 100644 --- a/runtime/bin/thread_fuchsia.cc +++ b/runtime/bin/thread_fuchsia.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_FUCHSIA) +#if defined(DART_HOST_OS_FUCHSIA) #include "bin/thread.h" #include "bin/thread_fuchsia.h" @@ -305,4 +305,4 @@ void Monitor::NotifyAll() { } // namespace bin } // namespace dart -#endif // defined(HOST_OS_FUCHSIA) +#endif // defined(DART_HOST_OS_FUCHSIA) diff --git a/runtime/bin/thread_linux.cc b/runtime/bin/thread_linux.cc index 2b3a7e6f32a..b671d0c890a 100644 --- a/runtime/bin/thread_linux.cc +++ b/runtime/bin/thread_linux.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_LINUX) +#if defined(DART_HOST_OS_LINUX) #include "bin/thread.h" #include "bin/thread_linux.h" @@ -301,4 +301,4 @@ void Monitor::NotifyAll() { } // namespace bin } // namespace dart -#endif // defined(HOST_OS_LINUX) +#endif // defined(DART_HOST_OS_LINUX) diff --git a/runtime/bin/thread_macos.cc b/runtime/bin/thread_macos.cc index af636f0094a..a38c44129a8 100644 --- a/runtime/bin/thread_macos.cc +++ b/runtime/bin/thread_macos.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_MACOS) +#if defined(DART_HOST_OS_MACOS) #include "bin/thread.h" #include "bin/thread_macos.h" @@ -294,4 +294,4 @@ void Monitor::NotifyAll() { } // namespace bin } // namespace dart -#endif // defined(HOST_OS_MACOS) +#endif // defined(DART_HOST_OS_MACOS) diff --git a/runtime/bin/thread_win.cc b/runtime/bin/thread_win.cc index ef6b6320b03..53809f364e7 100644 --- a/runtime/bin/thread_win.cc +++ b/runtime/bin/thread_win.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_WINDOWS) +#if defined(DART_HOST_OS_WINDOWS) #include "bin/thread.h" #include "bin/thread_win.h" @@ -192,4 +192,4 @@ void Monitor::NotifyAll() { } // namespace bin } // namespace dart -#endif // defined(HOST_OS_WINDOWS) +#endif // defined(DART_HOST_OS_WINDOWS) diff --git a/runtime/bin/utils_android.cc b/runtime/bin/utils_android.cc index ed6b5de8af3..53a4cec4d0a 100644 --- a/runtime/bin/utils_android.cc +++ b/runtime/bin/utils_android.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_ANDROID) +#if defined(DART_HOST_OS_ANDROID) #include // NOLINT #include // NOLINT @@ -115,4 +115,4 @@ void TimerUtils::Sleep(int64_t millis) { } // namespace bin } // namespace dart -#endif // defined(HOST_OS_ANDROID) +#endif // defined(DART_HOST_OS_ANDROID) diff --git a/runtime/bin/utils_fuchsia.cc b/runtime/bin/utils_fuchsia.cc index c7bbe081c9f..f034e87bc07 100644 --- a/runtime/bin/utils_fuchsia.cc +++ b/runtime/bin/utils_fuchsia.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_FUCHSIA) +#if defined(DART_HOST_OS_FUCHSIA) #include #include @@ -89,4 +89,4 @@ void TimerUtils::Sleep(int64_t millis) { } // namespace bin } // namespace dart -#endif // defined(HOST_OS_FUCHSIA) +#endif // defined(DART_HOST_OS_FUCHSIA) diff --git a/runtime/bin/utils_linux.cc b/runtime/bin/utils_linux.cc index b87778aa0ae..9c9ad3a5077 100644 --- a/runtime/bin/utils_linux.cc +++ b/runtime/bin/utils_linux.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_LINUX) +#if defined(DART_HOST_OS_LINUX) #include // NOLINT #include // NOLINT @@ -114,4 +114,4 @@ void TimerUtils::Sleep(int64_t millis) { } // namespace bin } // namespace dart -#endif // defined(HOST_OS_LINUX) +#endif // defined(DART_HOST_OS_LINUX) diff --git a/runtime/bin/utils_macos.cc b/runtime/bin/utils_macos.cc index 52066bc2f79..219d643f087 100644 --- a/runtime/bin/utils_macos.cc +++ b/runtime/bin/utils_macos.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_MACOS) +#if defined(DART_HOST_OS_MACOS) #include // NOLINT #include // NOLINT @@ -120,4 +120,4 @@ void TimerUtils::Sleep(int64_t millis) { } // namespace bin } // namespace dart -#endif // defined(HOST_OS_MACOS) +#endif // defined(DART_HOST_OS_MACOS) diff --git a/runtime/bin/utils_win.cc b/runtime/bin/utils_win.cc index f73bd20eb6d..fcbbcbbe3c6 100644 --- a/runtime/bin/utils_win.cc +++ b/runtime/bin/utils_win.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_WINDOWS) +#if defined(DART_HOST_OS_WINDOWS) #include // NOLINT #include // NOLINT @@ -224,4 +224,4 @@ void TimerUtils::Sleep(int64_t millis) { } // namespace bin } // namespace dart -#endif // defined(HOST_OS_WINDOWS) +#endif // defined(DART_HOST_OS_WINDOWS) diff --git a/runtime/bin/vmservice_impl.cc b/runtime/bin/vmservice_impl.cc index 47b799233d8..4f82645a60f 100644 --- a/runtime/bin/vmservice_impl.cc +++ b/runtime/bin/vmservice_impl.cc @@ -197,7 +197,7 @@ bool VmService::Setup(const char* server_ip, SHUTDOWN_ON_ERROR(result); // Are we running on Windows? -#if defined(HOST_OS_WINDOWS) +#if defined(DART_HOST_OS_WINDOWS) Dart_Handle is_windows = Dart_True(); #else Dart_Handle is_windows = Dart_False(); @@ -207,7 +207,7 @@ bool VmService::Setup(const char* server_ip, SHUTDOWN_ON_ERROR(result); // Are we running on Fuchsia? -#if defined(HOST_OS_FUCHSIA) +#if defined(DART_HOST_OS_FUCHSIA) Dart_Handle is_fuchsia = Dart_True(); #else Dart_Handle is_fuchsia = Dart_False(); diff --git a/runtime/lib/double.cc b/runtime/lib/double.cc index 09136b739eb..bc7c33bc19d 100644 --- a/runtime/lib/double.cc +++ b/runtime/lib/double.cc @@ -4,7 +4,7 @@ #include "vm/bootstrap_natives.h" -#include +#include // NOLINT #include "vm/dart_entry.h" #include "vm/double_conversion.h" @@ -180,7 +180,7 @@ DEFINE_NATIVE_ENTRY(Double_truncate, 0, 1) { return Double::New(trunc(arg.value())); } -#if defined(HOST_OS_MACOS) +#if defined(DART_HOST_OS_MACOS) // MAC OSX math library produces old style cast warning. #pragma GCC diagnostic ignored "-Wold-style-cast" #endif diff --git a/runtime/lib/ffi_dynamic_library.cc b/runtime/lib/ffi_dynamic_library.cc index eb8e74b5c18..b2f8c3749ff 100644 --- a/runtime/lib/ffi_dynamic_library.cc +++ b/runtime/lib/ffi_dynamic_library.cc @@ -8,8 +8,8 @@ #include "vm/globals.h" #include "vm/native_entry.h" -#if !defined(HOST_OS_LINUX) && !defined(HOST_OS_MACOS) && \ - !defined(HOST_OS_ANDROID) && !defined(HOST_OS_FUCHSIA) +#if !defined(DART_HOST_OS_LINUX) && !defined(DART_HOST_OS_MACOS) && \ + !defined(DART_HOST_OS_ANDROID) && !defined(DART_HOST_OS_FUCHSIA) // TODO(dacoharkes): Implement dynamic libraries for other targets & merge the // implementation with: // - runtime/bin/extensions.h @@ -23,8 +23,8 @@ namespace dart { static void* LoadExtensionLibrary(const char* library_file) { -#if defined(HOST_OS_LINUX) || defined(HOST_OS_MACOS) || \ - defined(HOST_OS_ANDROID) || defined(HOST_OS_FUCHSIA) +#if defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_MACOS) || \ + defined(DART_HOST_OS_ANDROID) || defined(DART_HOST_OS_FUCHSIA) void* handle = dlopen(library_file, RTLD_LAZY); if (handle == nullptr) { char* error = dlerror(); @@ -34,7 +34,7 @@ static void* LoadExtensionLibrary(const char* library_file) { } return handle; -#elif defined(HOST_OS_WINDOWS) +#elif defined(DART_HOST_OS_WINDOWS) SetLastError(0); // Clear any errors. void* ext; @@ -78,8 +78,8 @@ DEFINE_NATIVE_ENTRY(Ffi_dl_open, 0, 1) { } DEFINE_NATIVE_ENTRY(Ffi_dl_processLibrary, 0, 0) { -#if defined(HOST_OS_LINUX) || defined(HOST_OS_MACOS) || \ - defined(HOST_OS_ANDROID) || defined(HOST_OS_FUCHSIA) +#if defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_MACOS) || \ + defined(DART_HOST_OS_ANDROID) || defined(DART_HOST_OS_FUCHSIA) return DynamicLibrary::New(RTLD_DEFAULT); #else const Array& args = Array::Handle(Array::New(1)); @@ -95,8 +95,8 @@ DEFINE_NATIVE_ENTRY(Ffi_dl_executableLibrary, 0, 0) { } static void* ResolveSymbol(void* handle, const char* symbol) { -#if defined(HOST_OS_LINUX) || defined(HOST_OS_MACOS) || \ - defined(HOST_OS_ANDROID) || defined(HOST_OS_FUCHSIA) +#if defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_MACOS) || \ + defined(DART_HOST_OS_ANDROID) || defined(DART_HOST_OS_FUCHSIA) dlerror(); // Clear any errors. void* pointer = dlsym(handle, symbol); char* error = dlerror(); @@ -106,7 +106,7 @@ static void* ResolveSymbol(void* handle, const char* symbol) { Exceptions::ThrowArgumentError(msg); } return pointer; -#elif defined(HOST_OS_WINDOWS) +#elif defined(DART_HOST_OS_WINDOWS) SetLastError(0); void* pointer = reinterpret_cast( GetProcAddress(reinterpret_cast(handle), symbol)); @@ -148,14 +148,14 @@ DEFINE_NATIVE_ENTRY(Ffi_dl_getHandle, 0, 1) { } static bool SymbolExists(void* handle, const char* symbol) { -#if defined(HOST_OS_LINUX) || defined(HOST_OS_MACOS) || \ - defined(HOST_OS_ANDROID) || defined(HOST_OS_FUCHSIA) +#if defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_MACOS) || \ + defined(DART_HOST_OS_ANDROID) || defined(DART_HOST_OS_FUCHSIA) dlerror(); // Clear previous error, if any. dlsym(handle, symbol); // Checking whether dlsym returns a nullptr is not enough, as the value of // the symbol could actually be NULL. Check the error condition instead. return dlerror() == nullptr; -#elif defined(HOST_OS_WINDOWS) +#elif defined(DART_HOST_OS_WINDOWS) return GetProcAddress(reinterpret_cast(handle), symbol) != nullptr; #else const Array& args = Array::Handle(Array::New(1)); diff --git a/runtime/lib/uri.cc b/runtime/lib/uri.cc index af4c65df9ae..06df6d73dfd 100644 --- a/runtime/lib/uri.cc +++ b/runtime/lib/uri.cc @@ -9,7 +9,7 @@ namespace dart { DEFINE_NATIVE_ENTRY(Uri_isWindowsPlatform, 0, 0) { -#if defined(HOST_OS_WINDOWS) +#if defined(DART_HOST_OS_WINDOWS) return Bool::True().ptr(); #else return Bool::False().ptr(); diff --git a/runtime/platform/assert.cc b/runtime/platform/assert.cc index 85e4ea2dcb9..5c7bf0b3c04 100644 --- a/runtime/platform/assert.cc +++ b/runtime/platform/assert.cc @@ -8,9 +8,9 @@ #include "platform/globals.h" #include "platform/syslog.h" -#if defined(HOST_OS_ANDROID) +#if defined(DART_HOST_OS_ANDROID) extern "C" __attribute__((weak)) void android_set_abort_message(const char*); -#endif // defined(HOST_OS_ANDROID) +#endif // defined(DART_HOST_OS_ANDROID) namespace dart { @@ -36,11 +36,11 @@ void DynamicAssertionHelper::Print(const char* format, // Print the buffer on stderr and/or syslog. Syslog::PrintErr("%s\n", buffer); -#if defined(HOST_OS_ANDROID) +#if defined(DART_HOST_OS_ANDROID) if (will_abort && (&android_set_abort_message != nullptr)) { android_set_abort_message(buffer); } -#endif // defined(HOST_OS_ANDROID) +#endif // defined(DART_HOST_OS_ANDROID) } void Assert::Fail(const char* format, ...) { diff --git a/runtime/platform/floating_point_win.cc b/runtime/platform/floating_point_win.cc index 7fffe7aa2cc..6e853d6dfcd 100644 --- a/runtime/platform/floating_point_win.cc +++ b/runtime/platform/floating_point_win.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_WINDOWS) +#if defined(DART_HOST_OS_WINDOWS) #include "platform/floating_point_win.h" @@ -46,4 +46,4 @@ double atan2_ieee(double x, double y) { } } -#endif // defined(HOST_OS_WINDOWS) +#endif // defined(DART_HOST_OS_WINDOWS) diff --git a/runtime/platform/globals.h b/runtime/platform/globals.h index cc8eec102be..42edc706c1b 100644 --- a/runtime/platform/globals.h +++ b/runtime/platform/globals.h @@ -106,33 +106,31 @@ #if defined(__ANDROID__) // Check for Android first, to determine its difference from Linux. -#define HOST_OS_ANDROID 1 +#define DART_HOST_OS_ANDROID 1 #elif defined(__linux__) || defined(__FreeBSD__) // Generic Linux. -#define HOST_OS_LINUX 1 +#define DART_HOST_OS_LINUX 1 #elif defined(__APPLE__) // Define the flavor of Mac OS we are running on. #include -// TODO(iposva): Rename HOST_OS_MACOS to HOST_OS_MAC to inherit -// the value defined in TargetConditionals.h -#define HOST_OS_MACOS 1 +#define DART_HOST_OS_MACOS 1 #if TARGET_OS_IPHONE -#define HOST_OS_IOS 1 +#define DART_HOST_OS_IOS 1 #endif #elif defined(_WIN32) // Windows, both 32- and 64-bit, regardless of the check for _WIN32. -#define HOST_OS_WINDOWS 1 +#define DART_HOST_OS_WINDOWS 1 #elif defined(__Fuchsia__) -#define HOST_OS_FUCHSIA +#define DART_HOST_OS_FUCHSIA -#elif !defined(HOST_OS_FUCHSIA) +#elif !defined(DART_HOST_OS_FUCHSIA) #error Automatic target os detection failed. #endif @@ -374,23 +372,23 @@ typedef simd128_value_t fpu_register_t; #error Unknown architecture. #endif -#if !defined(TARGET_OS_ANDROID) && !defined(TARGET_OS_FUCHSIA) && \ - !defined(TARGET_OS_MACOS_IOS) && !defined(TARGET_OS_LINUX) && \ - !defined(TARGET_OS_MACOS) && !defined(TARGET_OS_WINDOWS) +#if !defined(DART_TARGET_OS_ANDROID) && !defined(DART_TARGET_OS_FUCHSIA) && \ + !defined(DART_TARGET_OS_MACOS_IOS) && !defined(DART_TARGET_OS_LINUX) && \ + !defined(DART_TARGET_OS_MACOS) && !defined(DART_TARGET_OS_WINDOWS) // No target OS specified; pick the one matching the host OS. -#if defined(HOST_OS_ANDROID) -#define TARGET_OS_ANDROID 1 -#elif defined(HOST_OS_FUCHSIA) -#define TARGET_OS_FUCHSIA 1 -#elif defined(HOST_OS_IOS) -#define TARGET_OS_MACOS 1 -#define TARGET_OS_MACOS_IOS 1 -#elif defined(HOST_OS_LINUX) -#define TARGET_OS_LINUX 1 -#elif defined(HOST_OS_MACOS) -#define TARGET_OS_MACOS 1 -#elif defined(HOST_OS_WINDOWS) -#define TARGET_OS_WINDOWS 1 +#if defined(DART_HOST_OS_ANDROID) +#define DART_TARGET_OS_ANDROID 1 +#elif defined(DART_HOST_OS_FUCHSIA) +#define DART_TARGET_OS_FUCHSIA 1 +#elif defined(DART_HOST_OS_IOS) +#define DART_TARGET_OS_MACOS 1 +#define DART_TARGET_OS_MACOS_IOS 1 +#elif defined(DART_HOST_OS_LINUX) +#define DART_TARGET_OS_LINUX 1 +#elif defined(DART_HOST_OS_MACOS) +#define DART_TARGET_OS_MACOS 1 +#elif defined(DART_HOST_OS_WINDOWS) +#define DART_TARGET_OS_WINDOWS 1 #else #error Automatic target OS detection failed. #endif @@ -399,8 +397,8 @@ typedef simd128_value_t fpu_register_t; // Determine whether dual mapping of code pages is supported. // We test dual mapping on linux x64 and deploy it on fuchsia. #if !defined(DART_PRECOMPILED_RUNTIME) && \ - (defined(TARGET_OS_LINUX) && defined(TARGET_ARCH_X64) || \ - defined(TARGET_OS_FUCHSIA)) + (defined(DART_TARGET_OS_LINUX) && defined(TARGET_ARCH_X64) || \ + defined(DART_TARGET_OS_FUCHSIA)) #define DUAL_MAPPING_SUPPORTED 1 #endif @@ -670,19 +668,19 @@ inline D bit_copy(const S& source) { // On Windows the reentrent version of strtok is called // strtok_s. Unify on the posix name strtok_r. -#if defined(HOST_OS_WINDOWS) +#if defined(DART_HOST_OS_WINDOWS) #define snprintf _sprintf_p #define strtok_r strtok_s #endif -#if !defined(HOST_OS_WINDOWS) +#if !defined(DART_HOST_OS_WINDOWS) #if defined(TEMP_FAILURE_RETRY) // TEMP_FAILURE_RETRY is defined in unistd.h on some platforms. We should // not use that version, but instead the one in signal_blocker.h, to ensure // we disable signal interrupts. #undef TEMP_FAILURE_RETRY #endif // defined(TEMP_FAILURE_RETRY) -#endif // !defined(HOST_OS_WINDOWS) +#endif // !defined(DART_HOST_OS_WINDOWS) #if __GNUC__ // Tell the compiler to do printf format string checking if the diff --git a/runtime/platform/signal_blocker.h b/runtime/platform/signal_blocker.h index c56c1da99c0..e47ac60f940 100644 --- a/runtime/platform/signal_blocker.h +++ b/runtime/platform/signal_blocker.h @@ -8,7 +8,7 @@ #include "platform/assert.h" #include "platform/globals.h" -#if defined(HOST_OS_WINDOWS) +#if defined(DART_HOST_OS_WINDOWS) #error Do not include this file on Windows. #endif diff --git a/runtime/platform/syslog_android.cc b/runtime/platform/syslog_android.cc index 9aa77c02083..46930e99e58 100644 --- a/runtime/platform/syslog_android.cc +++ b/runtime/platform/syslog_android.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_ANDROID) +#if defined(DART_HOST_OS_ANDROID) #include "platform/syslog.h" @@ -35,4 +35,4 @@ void Syslog::VPrintErr(const char* format, va_list args) { } // namespace dart -#endif // defined(HOST_OS_ANDROID) +#endif // defined(DART_HOST_OS_ANDROID) diff --git a/runtime/platform/syslog_fuchsia.cc b/runtime/platform/syslog_fuchsia.cc index 85e4c80ff25..f9b0d65e7bc 100644 --- a/runtime/platform/syslog_fuchsia.cc +++ b/runtime/platform/syslog_fuchsia.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_FUCHSIA) +#if defined(DART_HOST_OS_FUCHSIA) #include "platform/syslog.h" @@ -23,4 +23,4 @@ void Syslog::VPrintErr(const char* format, va_list args) { } // namespace dart -#endif // defined(HOST_OS_FUCHSIA) +#endif // defined(DART_HOST_OS_FUCHSIA) diff --git a/runtime/platform/syslog_linux.cc b/runtime/platform/syslog_linux.cc index 269bc9f28eb..ea73f2b6ff6 100644 --- a/runtime/platform/syslog_linux.cc +++ b/runtime/platform/syslog_linux.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_LINUX) +#if defined(DART_HOST_OS_LINUX) #include "platform/syslog.h" @@ -23,4 +23,4 @@ void Syslog::VPrintErr(const char* format, va_list args) { } // namespace dart -#endif // defined(HOST_OS_LINUX) +#endif // defined(DART_HOST_OS_LINUX) diff --git a/runtime/platform/syslog_macos.cc b/runtime/platform/syslog_macos.cc index f01bfbf19f7..bfb3a7e8ad7 100644 --- a/runtime/platform/syslog_macos.cc +++ b/runtime/platform/syslog_macos.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_MACOS) +#if defined(DART_HOST_OS_MACOS) #include "platform/syslog.h" @@ -23,4 +23,4 @@ void Syslog::VPrintErr(const char* format, va_list args) { } // namespace dart -#endif // defined(HOST_OS_MACOS) +#endif // defined(DART_HOST_OS_MACOS) diff --git a/runtime/platform/syslog_win.cc b/runtime/platform/syslog_win.cc index 07ab8156807..20833b7ce2f 100644 --- a/runtime/platform/syslog_win.cc +++ b/runtime/platform/syslog_win.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_WINDOWS) +#if defined(DART_HOST_OS_WINDOWS) #include "platform/syslog.h" @@ -23,4 +23,4 @@ void Syslog::VPrintErr(const char* format, va_list args) { } // namespace dart -#endif // defined(HOST_OS_WINDOWS) +#endif // defined(DART_HOST_OS_WINDOWS) diff --git a/runtime/platform/utils.cc b/runtime/platform/utils.cc index 1ba74f7df40..d04c3a81413 100644 --- a/runtime/platform/utils.cc +++ b/runtime/platform/utils.cc @@ -57,7 +57,7 @@ int Utils::CountLeadingZeros64(uint64_t x) { return CountLeadingZeros32(x_hi); } return 32 + CountLeadingZeros32(static_cast(x)); -#elif defined(HOST_OS_WINDOWS) +#elif defined(DART_HOST_OS_WINDOWS) unsigned long position; // NOLINT return (_BitScanReverse64(&position, x) == 0) ? 64 @@ -68,7 +68,7 @@ int Utils::CountLeadingZeros64(uint64_t x) { } int Utils::CountLeadingZeros32(uint32_t x) { -#if defined(HOST_OS_WINDOWS) +#if defined(DART_HOST_OS_WINDOWS) unsigned long position; // NOLINT return (_BitScanReverse(&position, x) == 0) ? 32 : 31 - static_cast(position); @@ -84,7 +84,7 @@ int Utils::CountTrailingZeros64(uint64_t x) { return CountTrailingZeros32(x_lo); } return 32 + CountTrailingZeros32(static_cast(x >> 32)); -#elif defined(HOST_OS_WINDOWS) +#elif defined(DART_HOST_OS_WINDOWS) unsigned long position; // NOLINT return (_BitScanForward64(&position, x) == 0) ? 64 : static_cast(position); @@ -94,7 +94,7 @@ int Utils::CountTrailingZeros64(uint64_t x) { } int Utils::CountTrailingZeros32(uint32_t x) { -#if defined(HOST_OS_WINDOWS) +#if defined(DART_HOST_OS_WINDOWS) unsigned long position; // NOLINT return (_BitScanForward(&position, x) == 0) ? 32 : static_cast(position); #else diff --git a/runtime/platform/utils.h b/runtime/platform/utils.h index 41054c4362f..98f1a1c5237 100644 --- a/runtime/platform/utils.h +++ b/runtime/platform/utils.h @@ -481,15 +481,15 @@ class Utils { } // namespace dart -#if defined(HOST_OS_ANDROID) +#if defined(DART_HOST_OS_ANDROID) #include "platform/utils_android.h" -#elif defined(HOST_OS_FUCHSIA) +#elif defined(DART_HOST_OS_FUCHSIA) #include "platform/utils_fuchsia.h" -#elif defined(HOST_OS_LINUX) +#elif defined(DART_HOST_OS_LINUX) #include "platform/utils_linux.h" -#elif defined(HOST_OS_MACOS) +#elif defined(DART_HOST_OS_MACOS) #include "platform/utils_macos.h" -#elif defined(HOST_OS_WINDOWS) +#elif defined(DART_HOST_OS_WINDOWS) #include "platform/utils_win.h" #else #error Unknown target os. diff --git a/runtime/platform/utils_android.cc b/runtime/platform/utils_android.cc index 72618eb9ad1..6e14851c756 100644 --- a/runtime/platform/utils_android.cc +++ b/runtime/platform/utils_android.cc @@ -3,9 +3,10 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_ANDROID) +#if defined(DART_HOST_OS_ANDROID) #include "platform/utils.h" +#include "platform/utils_android.h" namespace dart { @@ -49,4 +50,4 @@ int Utils::Unlink(const char* path) { } // namespace dart -#endif // defined(HOST_OS_ANDROID) +#endif // defined(DART_HOST_OS_ANDROID) diff --git a/runtime/platform/utils_fuchsia.cc b/runtime/platform/utils_fuchsia.cc index a6d9f37292a..8f6c7acf219 100644 --- a/runtime/platform/utils_fuchsia.cc +++ b/runtime/platform/utils_fuchsia.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_FUCHSIA) +#if defined(DART_HOST_OS_FUCHSIA) #include #include @@ -78,4 +78,4 @@ std::unique_ptr TakeDartVmNode() { } // namespace dart -#endif // defined(HOST_OS_FUCHSIA) +#endif // defined(DART_HOST_OS_FUCHSIA) diff --git a/runtime/platform/utils_linux.cc b/runtime/platform/utils_linux.cc index c430bcac374..ec4aead20f6 100644 --- a/runtime/platform/utils_linux.cc +++ b/runtime/platform/utils_linux.cc @@ -3,9 +3,10 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_LINUX) +#if defined(DART_HOST_OS_LINUX) #include "platform/utils.h" +#include "platform/utils_linux.h" namespace dart { @@ -50,4 +51,4 @@ int Utils::Unlink(const char* path) { } // namespace dart -#endif // defined(HOST_OS_LINUX) +#endif // defined(DART_HOST_OS_LINUX) diff --git a/runtime/platform/utils_macos.cc b/runtime/platform/utils_macos.cc index a801746931e..9de2e431218 100644 --- a/runtime/platform/utils_macos.cc +++ b/runtime/platform/utils_macos.cc @@ -3,9 +3,10 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_MACOS) +#if defined(DART_HOST_OS_MACOS) #include "platform/utils.h" +#include "platform/utils_macos.h" #include // NOLINT #include // NOLINT @@ -150,4 +151,4 @@ int32_t MacOSXMinorVersion() { } // namespace dart -#endif // defined(HOST_OS_MACOS) +#endif // defined(DART_HOST_OS_MACOS) diff --git a/runtime/platform/utils_win.cc b/runtime/platform/utils_win.cc index 7ba2ec83215..25d2f1d573f 100644 --- a/runtime/platform/utils_win.cc +++ b/runtime/platform/utils_win.cc @@ -3,11 +3,13 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_WINDOWS) +#if defined(DART_HOST_OS_WINDOWS) #include // NOLINT + #include "platform/allocation.h" #include "platform/utils.h" +#include "platform/utils_win.h" namespace dart { @@ -86,4 +88,4 @@ int Utils::Unlink(const char* path) { } // namespace dart -#endif // defined(HOST_OS_WINDOWS) +#endif // defined(DART_HOST_OS_WINDOWS) diff --git a/runtime/tools/run_clang_tidy.dart b/runtime/tools/run_clang_tidy.dart index 6e35ebac828..aa32b3bc505 100644 --- a/runtime/tools/run_clang_tidy.dart +++ b/runtime/tools/run_clang_tidy.dart @@ -20,7 +20,7 @@ List compilerFlagsForFile(String filepath) { '-Ithird_party/zlib', '-DTARGET_ARCH_X64', '-DDEBUG', - '-DTARGET_OS_LINUX', + '-DDART_TARGET_OS_LINUX', '-DTESTING', '-std=c++17', '-x', diff --git a/runtime/vm/compiler/assembler/assembler_arm.cc b/runtime/vm/compiler/assembler/assembler_arm.cc index 63cba26df39..7cf827213bf 100644 --- a/runtime/vm/compiler/assembler/assembler_arm.cc +++ b/runtime/vm/compiler/assembler/assembler_arm.cc @@ -15,7 +15,7 @@ // An extra check since we are assuming the existence of /proc/cpuinfo below. #if !defined(USING_SIMULATOR) && !defined(__linux__) && !defined(ANDROID) && \ - !defined(HOST_OS_IOS) && !defined(HOST_OS_MACOS) + !defined(DART_HOST_OS_IOS) && !defined(DART_HOST_OS_MACOS) #error ARM cross-compile only supported on Linux, Android, iOS, and Mac #endif diff --git a/runtime/vm/compiler/assembler/assembler_x64_test.cc b/runtime/vm/compiler/assembler/assembler_x64_test.cc index 9704c220166..00eeead8119 100644 --- a/runtime/vm/compiler/assembler/assembler_x64_test.cc +++ b/runtime/vm/compiler/assembler/assembler_x64_test.cc @@ -32,7 +32,7 @@ namespace compiler { intptr_t exp_len = strlen(expected); \ EXPECT_GT(dis_len, exp_len); \ EXPECT_STREQ(expected, disassembly + dis_len - exp_len); -#if defined(TARGET_OS_WINDOWS) +#if defined(DART_TARGET_OS_WINDOWS) // Windows has different calling conventions on x64, which means the // disassembly looks different on some tests. We skip testing the // disassembly output for those tests on Windows. @@ -5435,7 +5435,7 @@ ASSEMBLER_TEST_RUN(DoubleToDoubleTrunc, test) { ASSEMBLER_TEST_GENERATE(DoubleAbs, assembler) { EnterTestFrame(assembler); -#if defined(HOST_OS_WINDOWS) +#if defined(DART_HOST_OS_WINDOWS) // First argument is code object, second argument is thread. MSVC passes // third argument in XMM2. __ DoubleAbs(XMM0, XMM2); diff --git a/runtime/vm/compiler/backend/il_arm.cc b/runtime/vm/compiler/backend/il_arm.cc index 0ac5dfd1eda..80aaa4759f3 100644 --- a/runtime/vm/compiler/backend/il_arm.cc +++ b/runtime/vm/compiler/backend/il_arm.cc @@ -1544,7 +1544,7 @@ void NativeReturnInstr::EmitNativeCode(FlowGraphCompiler* compiler) { __ PopNativeCalleeSavedRegisters(); -#if defined(TARGET_OS_FUCHSIA) && defined(USING_SHADOW_CALL_STACK) +#if defined(DART_TARGET_OS_FUCHSIA) && defined(USING_SHADOW_CALL_STACK) #error Unimplemented #endif @@ -1580,7 +1580,7 @@ void NativeEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) { // Save a space for the code object. __ PushImmediate(0); -#if defined(TARGET_OS_FUCHSIA) && defined(USING_SHADOW_CALL_STACK) +#if defined(DART_TARGET_OS_FUCHSIA) && defined(USING_SHADOW_CALL_STACK) #error Unimplemented #endif diff --git a/runtime/vm/compiler/backend/il_arm64.cc b/runtime/vm/compiler/backend/il_arm64.cc index 87cc6b7cd66..223b42423a6 100644 --- a/runtime/vm/compiler/backend/il_arm64.cc +++ b/runtime/vm/compiler/backend/il_arm64.cc @@ -1454,7 +1454,7 @@ void NativeEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) { // Now that we have THR, we can set CSP. __ SetupCSPFromThread(THR); -#if defined(TARGET_OS_FUCHSIA) +#if defined(DART_TARGET_OS_FUCHSIA) __ str(R18, compiler::Address( THR, compiler::target::Thread::saved_shadow_call_stack_offset())); diff --git a/runtime/vm/compiler/backend/il_ia32.cc b/runtime/vm/compiler/backend/il_ia32.cc index f7ef9ae793c..ee1ab8c881b 100644 --- a/runtime/vm/compiler/backend/il_ia32.cc +++ b/runtime/vm/compiler/backend/il_ia32.cc @@ -331,7 +331,7 @@ void NativeReturnInstr::EmitNativeCode(FlowGraphCompiler* compiler) { __ popl(ESI); __ popl(EBX); -#if defined(TARGET_OS_FUCHSIA) && defined(USING_SHADOW_CALL_STACK) +#if defined(DART_TARGET_OS_FUCHSIA) && defined(USING_SHADOW_CALL_STACK) #error Unimplemented #endif @@ -1131,7 +1131,7 @@ void NativeEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) { __ xorl(EAX, EAX); __ pushl(EAX); -#if defined(TARGET_OS_FUCHSIA) && defined(USING_SHADOW_CALL_STACK) +#if defined(DART_TARGET_OS_FUCHSIA) && defined(USING_SHADOW_CALL_STACK) #error Unimplemented #endif diff --git a/runtime/vm/compiler/backend/il_x64.cc b/runtime/vm/compiler/backend/il_x64.cc index 7882a76846b..cb4c1beed1a 100644 --- a/runtime/vm/compiler/backend/il_x64.cc +++ b/runtime/vm/compiler/backend/il_x64.cc @@ -409,7 +409,7 @@ void NativeReturnInstr::EmitNativeCode(FlowGraphCompiler* compiler) { // Restore C++ ABI callee-saved registers. __ PopRegisters(kCalleeSaveRegistersSet); -#if defined(TARGET_OS_FUCHSIA) && defined(USING_SHADOW_CALL_STACK) +#if defined(DART_TARGET_OS_FUCHSIA) && defined(USING_SHADOW_CALL_STACK) #error Unimplemented #endif @@ -1310,7 +1310,7 @@ void NativeEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) { // NativeReturnInstr::EmitNativeCode. __ EnterFrame(0); -#if defined(TARGET_OS_FUCHSIA) && defined(USING_SHADOW_CALL_STACK) +#if defined(DART_TARGET_OS_FUCHSIA) && defined(USING_SHADOW_CALL_STACK) #error Unimplemented #endif diff --git a/runtime/vm/compiler/ffi/abi.cc b/runtime/vm/compiler/ffi/abi.cc index 1d3bd8b919c..d71ad34868b 100644 --- a/runtime/vm/compiler/ffi/abi.cc +++ b/runtime/vm/compiler/ffi/abi.cc @@ -28,14 +28,14 @@ static_assert(offsetof(AbiAlignmentDouble, d) == 8, static_assert(offsetof(AbiAlignmentUint64, i) == 8, "FFI transformation alignment"); #elif (defined(HOST_ARCH_IA32) && /* NOLINT(whitespace/parens) */ \ - (defined(HOST_OS_LINUX) || defined(HOST_OS_MACOS) || \ - defined(HOST_OS_ANDROID))) || \ - (defined(HOST_ARCH_ARM) && defined(HOST_OS_IOS)) + (defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_MACOS) || \ + defined(DART_HOST_OS_ANDROID))) || \ + (defined(HOST_ARCH_ARM) && defined(DART_HOST_OS_IOS)) static_assert(offsetof(AbiAlignmentDouble, d) == 4, "FFI transformation alignment"); static_assert(offsetof(AbiAlignmentUint64, i) == 4, "FFI transformation alignment"); -#elif defined(HOST_ARCH_IA32) && defined(HOST_OS_WINDOWS) || \ +#elif defined(HOST_ARCH_IA32) && defined(DART_HOST_OS_WINDOWS) || \ defined(HOST_ARCH_ARM) static_assert(offsetof(AbiAlignmentDouble, d) == 8, "FFI transformation alignment"); @@ -49,11 +49,11 @@ Abi TargetAbi() { #if defined(TARGET_ARCH_X64) || defined(TARGET_ARCH_ARM64) return Abi::kWordSize64; #elif (defined(TARGET_ARCH_IA32) && /* NOLINT(whitespace/parens) */ \ - (defined(TARGET_OS_LINUX) || defined(TARGET_OS_MACOS) || \ - defined(TARGET_OS_ANDROID))) || \ - (defined(TARGET_ARCH_ARM) && defined(TARGET_OS_MACOS_IOS)) + (defined(DART_TARGET_OS_LINUX) || defined(DART_TARGET_OS_MACOS) || \ + defined(DART_TARGET_OS_ANDROID))) || \ + (defined(TARGET_ARCH_ARM) && defined(DART_TARGET_OS_MACOS_IOS)) return Abi::kWordSize32Align32; -#elif defined(TARGET_ARCH_IA32) && defined(TARGET_OS_WINDOWS) || \ +#elif defined(TARGET_ARCH_IA32) && defined(DART_TARGET_OS_WINDOWS) || \ defined(TARGET_ARCH_ARM) return Abi::kWordSize32Align64; #else diff --git a/runtime/vm/compiler/ffi/native_calling_convention.cc b/runtime/vm/compiler/ffi/native_calling_convention.cc index 8ed3646d272..0d810475f22 100644 --- a/runtime/vm/compiler/ffi/native_calling_convention.cc +++ b/runtime/vm/compiler/ffi/native_calling_convention.cc @@ -31,7 +31,7 @@ static bool SoftFpAbi() { } #else // !defined(FFI_UNIT_TESTS) static bool SoftFpAbi() { -#if defined(TARGET_ARCH_ARM) && defined(TARGET_OS_ANDROID) +#if defined(TARGET_ARCH_ARM) && defined(DART_TARGET_OS_ANDROID) return true; #else return false; @@ -135,7 +135,7 @@ class ArgumentAllocator : public ValueObject { return AllocateStack(payload_type); } -#if defined(TARGET_ARCH_X64) && !defined(TARGET_OS_WINDOWS) +#if defined(TARGET_ARCH_X64) && !defined(DART_TARGET_OS_WINDOWS) // If fits in two fpu and/or cpu registers, transfer in those. Otherwise, // transfer on stack. const NativeLocation& AllocateCompound( @@ -177,9 +177,9 @@ class ArgumentAllocator : public ValueObject { } return AllocateStack(payload_type); } -#endif // defined(TARGET_ARCH_X64) && !defined(TARGET_OS_WINDOWS) +#endif // defined(TARGET_ARCH_X64) && !defined(DART_TARGET_OS_WINDOWS) -#if defined(TARGET_ARCH_X64) && defined(TARGET_OS_WINDOWS) +#if defined(TARGET_ARCH_X64) && defined(DART_TARGET_OS_WINDOWS) // If struct fits in a single register and size is a power of two, then // use a single register and sign extend. // Otherwise, pass a pointer to a copy. @@ -209,7 +209,7 @@ class ArgumentAllocator : public ValueObject { return AllocateStack(payload_type); } -#endif // defined(TARGET_ARCH_X64) && defined(TARGET_OS_WINDOWS) +#endif // defined(TARGET_ARCH_X64) && defined(DART_TARGET_OS_WINDOWS) #if defined(TARGET_ARCH_IA32) const NativeLocation& AllocateCompound( @@ -512,7 +512,7 @@ static const NativeLocation& PointerToMemoryResultLocation( } #endif // defined(TARGET_ARCH_IA32) -#if defined(TARGET_ARCH_X64) && !defined(TARGET_OS_WINDOWS) +#if defined(TARGET_ARCH_X64) && !defined(DART_TARGET_OS_WINDOWS) static const NativeLocation& CompoundResultLocation( Zone* zone, const NativeCompoundType& payload_type) { @@ -564,9 +564,9 @@ static const NativeLocation& CompoundResultLocation( } return PointerToMemoryResultLocation(zone, payload_type); } -#endif // defined(TARGET_ARCH_X64) && !defined(TARGET_OS_WINDOWS) +#endif // defined(TARGET_ARCH_X64) && !defined(DART_TARGET_OS_WINDOWS) -#if defined(TARGET_ARCH_X64) && defined(TARGET_OS_WINDOWS) +#if defined(TARGET_ARCH_X64) && defined(DART_TARGET_OS_WINDOWS) // If struct fits in a single register do that, and sign extend. // Otherwise, pass a pointer to memory. static const NativeLocation& CompoundResultLocation( @@ -584,17 +584,17 @@ static const NativeLocation& CompoundResultLocation( } return PointerToMemoryResultLocation(zone, payload_type); } -#endif // defined(TARGET_ARCH_X64) && defined(TARGET_OS_WINDOWS) +#endif // defined(TARGET_ARCH_X64) && defined(DART_TARGET_OS_WINDOWS) -#if defined(TARGET_ARCH_IA32) && !defined(TARGET_OS_WINDOWS) +#if defined(TARGET_ARCH_IA32) && !defined(DART_TARGET_OS_WINDOWS) static const NativeLocation& CompoundResultLocation( Zone* zone, const NativeCompoundType& payload_type) { return PointerToMemoryResultLocation(zone, payload_type); } -#endif // defined(TARGET_ARCH_IA32) && !defined(TARGET_OS_WINDOWS) +#endif // defined(TARGET_ARCH_IA32) && !defined(DART_TARGET_OS_WINDOWS) -#if defined(TARGET_ARCH_IA32) && defined(TARGET_OS_WINDOWS) +#if defined(TARGET_ARCH_IA32) && defined(DART_TARGET_OS_WINDOWS) // Windows uses up to two return registers, while Linux does not. static const NativeLocation& CompoundResultLocation( Zone* zone, @@ -615,7 +615,7 @@ static const NativeLocation& CompoundResultLocation( } return PointerToMemoryResultLocation(zone, payload_type); } -#endif // defined(TARGET_ARCH_IA32) && defined(TARGET_OS_WINDOWS) +#endif // defined(TARGET_ARCH_IA32) && defined(DART_TARGET_OS_WINDOWS) #if defined(TARGET_ARCH_ARM) // Arm passes homogenous float return values in FPU registers and small diff --git a/runtime/vm/compiler/ffi/native_calling_convention_test.cc b/runtime/vm/compiler/ffi/native_calling_convention_test.cc index 1d1ae2801f6..328c0ca8e9f 100644 --- a/runtime/vm/compiler/ffi/native_calling_convention_test.cc +++ b/runtime/vm/compiler/ffi/native_calling_convention_test.cc @@ -586,7 +586,7 @@ UNIT_TEST_CASE_WITH_ZONE(NativeCallingConvention_regress46127) { RunSignatureTest(Z, "regress46127", arguments, struct_type); #if defined(TARGET_ARCH_IA32) && \ - (defined(TARGET_OS_ANDROID) || defined(TARGET_OS_LINUX)) + (defined(DART_TARGET_OS_ANDROID) || defined(DART_TARGET_OS_LINUX)) // We must count the result pointer passed on the stack as well. EXPECT_EQ(4, native_calling_convention.StackTopInBytes()); #else @@ -610,7 +610,7 @@ UNIT_TEST_CASE_WITH_ZONE(NativeCallingConvention_struct12bytesFloatx6) { const auto& struct_type = NativeStructType::FromNativeTypes(Z, member_types); #if defined(TARGET_ARCH_ARM64) && \ - (defined(TARGET_OS_MACOS) || defined(TARGET_OS_MACOS_IOS)) + (defined(DART_TARGET_OS_MACOS) || defined(DART_TARGET_OS_MACOS_IOS)) EXPECT_EQ(4, struct_type.AlignmentInBytesStack()); #endif diff --git a/runtime/vm/compiler/ffi/native_type.cc b/runtime/vm/compiler/ffi/native_type.cc index 686816c10ff..b1f8d8c5808 100644 --- a/runtime/vm/compiler/ffi/native_type.cc +++ b/runtime/vm/compiler/ffi/native_type.cc @@ -174,7 +174,7 @@ NativeStructType& NativeStructType::FromNativeTypes(Zone* zone, // If this struct is passed on the stack, it should be aligned to the largest // alignment of its members when passing those members on the stack. intptr_t alignment_stack = kAtLeast1ByteAligned; -#if (defined(TARGET_OS_MACOS_IOS) || defined(TARGET_OS_MACOS)) && \ +#if (defined(DART_TARGET_OS_MACOS_IOS) || defined(DART_TARGET_OS_MACOS)) && \ defined(TARGET_ARCH_ARM64) // On iOS64 and MacOS arm64 stack values can be less aligned than wordSize, // which deviates from the arm64 ABI. diff --git a/runtime/vm/compiler/ffi/unit_test.cc b/runtime/vm/compiler/ffi/unit_test.cc index 044b398700b..b58e59f7c3c 100644 --- a/runtime/vm/compiler/ffi/unit_test.cc +++ b/runtime/vm/compiler/ffi/unit_test.cc @@ -20,15 +20,15 @@ const char* kArch = "ia32"; const char* kArch = "x64"; #endif -#if defined(TARGET_OS_ANDROID) +#if defined(DART_TARGET_OS_ANDROID) const char* kOs = "android"; -#elif defined(TARGET_OS_MACOS_IOS) +#elif defined(DART_TARGET_OS_MACOS_IOS) const char* kOs = "ios"; -#elif defined(TARGET_OS_LINUX) +#elif defined(DART_TARGET_OS_LINUX) const char* kOs = "linux"; -#elif defined(TARGET_OS_MACOS) +#elif defined(DART_TARGET_OS_MACOS) const char* kOs = "macos"; -#elif defined(TARGET_OS_WINDOWS) +#elif defined(DART_TARGET_OS_WINDOWS) const char* kOs = "win"; #endif diff --git a/runtime/vm/compiler/stub_code_compiler_arm.cc b/runtime/vm/compiler/stub_code_compiler_arm.cc index ce2faf5fb4f..8b831c34bc4 100644 --- a/runtime/vm/compiler/stub_code_compiler_arm.cc +++ b/runtime/vm/compiler/stub_code_compiler_arm.cc @@ -1226,7 +1226,7 @@ void StubCodeCompiler::GenerateInvokeDartCodeStub(Assembler* assembler) { // target::frame_layout.exit_link_slot_from_entry_fp must be kept in sync // with the code below. -#if defined(TARGET_OS_MACOS) || defined(TARGET_OS_MACOS_IOS) +#if defined(DART_TARGET_OS_MACOS) || defined(DART_TARGET_OS_MACOS_IOS) ASSERT(target::frame_layout.exit_link_slot_from_entry_fp == -27); #else ASSERT(target::frame_layout.exit_link_slot_from_entry_fp == -28); diff --git a/runtime/vm/compiler/stub_code_compiler_arm64.cc b/runtime/vm/compiler/stub_code_compiler_arm64.cc index 451a41fae7e..4d92ced76cb 100644 --- a/runtime/vm/compiler/stub_code_compiler_arm64.cc +++ b/runtime/vm/compiler/stub_code_compiler_arm64.cc @@ -1343,7 +1343,7 @@ void StubCodeCompiler::GenerateInvokeDartCodeStub(Assembler* assembler) { __ ldr(TMP, Address(R3, target::Thread::invoke_dart_code_stub_offset())); __ Push(TMP); -#if defined(TARGET_OS_FUCHSIA) +#if defined(DART_TARGET_OS_FUCHSIA) __ str(R18, Address(R3, target::Thread::saved_shadow_call_stack_offset())); #elif defined(USING_SHADOW_CALL_STACK) #error Unimplemented @@ -1378,7 +1378,7 @@ void StubCodeCompiler::GenerateInvokeDartCodeStub(Assembler* assembler) { __ StoreToOffset(ZR, THR, target::Thread::top_exit_frame_info_offset()); // target::frame_layout.exit_link_slot_from_entry_fp must be kept in sync // with the code below. -#if defined(TARGET_OS_FUCHSIA) +#if defined(DART_TARGET_OS_FUCHSIA) ASSERT(target::frame_layout.exit_link_slot_from_entry_fp == -24); #else ASSERT(target::frame_layout.exit_link_slot_from_entry_fp == -23); @@ -3068,7 +3068,7 @@ void StubCodeCompiler::GenerateJumpToFrameStub(Assembler* assembler) { __ mov(FP, R2); // Frame_pointer. __ mov(THR, R3); __ SetupCSPFromThread(THR); -#if defined(TARGET_OS_FUCHSIA) +#if defined(DART_TARGET_OS_FUCHSIA) __ ldr(R18, Address(THR, target::Thread::saved_shadow_call_stack_offset())); #elif defined(USING_SHADOW_CALL_STACK) #error Unimplemented diff --git a/runtime/vm/compiler/stub_code_compiler_x64.cc b/runtime/vm/compiler/stub_code_compiler_x64.cc index a3c3821dc22..71c094ce6ff 100644 --- a/runtime/vm/compiler/stub_code_compiler_x64.cc +++ b/runtime/vm/compiler/stub_code_compiler_x64.cc @@ -121,7 +121,7 @@ void StubCodeCompiler::GenerateCallToRuntimeStub(Assembler* assembler) { Immediate(1 * target::kWordSize)); // Retval is next to 1st argument. __ movq(Address(RSP, retval_offset), RAX); // Set retval in target::NativeArguments. -#if defined(TARGET_OS_WINDOWS) +#if defined(DART_TARGET_OS_WINDOWS) ASSERT(target::NativeArguments::StructSize() > CallingConventions::kRegisterTransferLimit); __ movq(CallingConventions::kArg1Reg, RSP); diff --git a/runtime/vm/constants_arm.cc b/runtime/vm/constants_arm.cc index 19034276ad8..03e790f8e0c 100644 --- a/runtime/vm/constants_arm.cc +++ b/runtime/vm/constants_arm.cc @@ -13,7 +13,7 @@ namespace dart { using dart::bit_cast; const char* const cpu_reg_names[kNumberOfCpuRegisters] = { -#if defined(TARGET_OS_MACOS) || defined(TARGET_OS_MACOS_IOS) +#if defined(DART_TARGET_OS_MACOS) || defined(DART_TARGET_OS_MACOS_IOS) "r0", "r1", "r2", "r3", "r4", "pp", "r6", "fp", "r8", "r9", "thr", "r11", "ip", "sp", "lr", "pc", #else diff --git a/runtime/vm/constants_arm.h b/runtime/vm/constants_arm.h index a5f9f94d9b2..00f567090aa 100644 --- a/runtime/vm/constants_arm.h +++ b/runtime/vm/constants_arm.h @@ -99,7 +99,7 @@ enum Register { kNoRegister = -1, // Signals an illegal register. // Aliases. -#if defined(TARGET_OS_MACOS) || defined(TARGET_OS_MACOS_IOS) +#if defined(DART_TARGET_OS_MACOS) || defined(DART_TARGET_OS_MACOS_IOS) FP = R7, NOTFP = R11, #else @@ -505,7 +505,7 @@ const RegList kAllCpuRegistersList = 0xFFFF; // C++ ABI call registers. const RegList kAbiArgumentCpuRegs = (1 << R0) | (1 << R1) | (1 << R2) | (1 << R3); -#if defined(TARGET_OS_MACOS) || defined(TARGET_OS_MACOS_IOS) +#if defined(DART_TARGET_OS_MACOS) || defined(DART_TARGET_OS_MACOS_IOS) const RegList kAbiPreservedCpuRegs = (1 << R4) | (1 << R5) | (1 << R6) | (1 << R8) | (1 << R10) | (1 << R11); const int kAbiPreservedCpuRegCount = 6; @@ -532,7 +532,7 @@ const intptr_t kStoreBufferWrapperSize = 24; // Registers available to Dart that are not preserved by runtime calls. const RegList kDartVolatileCpuRegs = kDartAvailableCpuRegs & ~kAbiPreservedCpuRegs; -#if defined(TARGET_OS_MACOS) || defined(TARGET_OS_MACOS_IOS) +#if defined(DART_TARGET_OS_MACOS) || defined(DART_TARGET_OS_MACOS_IOS) const int kDartVolatileCpuRegCount = 6; #else const int kDartVolatileCpuRegCount = 5; @@ -572,7 +572,7 @@ class CallingConventions { kAlignedToWordSizeBut8AlignedTo8; // How fields in compounds are aligned. -#if defined(TARGET_OS_MACOS_IOS) +#if defined(DART_TARGET_OS_MACOS_IOS) static constexpr AlignmentStrategy kFieldAlignment = kAlignedToValueSizeBut8AlignedTo4; #else diff --git a/runtime/vm/constants_arm64.h b/runtime/vm/constants_arm64.h index 61f2c4a28fc..4700efa21e7 100644 --- a/runtime/vm/constants_arm64.h +++ b/runtime/vm/constants_arm64.h @@ -356,7 +356,7 @@ const RegList kAllCpuRegistersList = 0xFFFFFFFF; // C++ ABI call registers. const RegList kAbiArgumentCpuRegs = R(R0) | R(R1) | R(R2) | R(R3) | R(R4) | R(R5) | R(R6) | R(R7); -#if defined(TARGET_OS_FUCHSIA) +#if defined(DART_TARGET_OS_FUCHSIA) // We rely on R18 not being touched by Dart generated assembly or stubs at all. // We rely on that any calls into C++ also preserve R18. const RegList kAbiPreservedCpuRegs = R(R18) | R(R19) | R(R20) | R(R21) | @@ -433,7 +433,7 @@ class CallingConventions { kAlignedToWordSize; // How stack arguments are aligned. -#if defined(TARGET_OS_MACOS_IOS) || defined(TARGET_OS_MACOS) +#if defined(DART_TARGET_OS_MACOS_IOS) || defined(DART_TARGET_OS_MACOS) // > Function arguments may consume slots on the stack that are not multiples // > of 8 bytes. // https://developer.apple.com/documentation/xcode/writing_arm64_code_for_apple_platforms @@ -449,7 +449,7 @@ class CallingConventions { // Whether 1 or 2 byte-sized arguments or return values are passed extended // to 4 bytes. -#if defined(TARGET_OS_MACOS_IOS) || defined(TARGET_OS_MACOS) +#if defined(DART_TARGET_OS_MACOS_IOS) || defined(DART_TARGET_OS_MACOS) static constexpr ExtensionStrategy kReturnRegisterExtension = kExtendedTo4; static constexpr ExtensionStrategy kArgumentRegisterExtension = kExtendedTo4; #else diff --git a/runtime/vm/constants_ia32.h b/runtime/vm/constants_ia32.h index b83e1966699..e7276430011 100644 --- a/runtime/vm/constants_ia32.h +++ b/runtime/vm/constants_ia32.h @@ -345,7 +345,7 @@ class CallingConventions { kAlignedToWordSize; // How fields in compounds are aligned. -#if defined(TARGET_OS_WINDOWS) +#if defined(DART_TARGET_OS_WINDOWS) static constexpr AlignmentStrategy kFieldAlignment = kAlignedToValueSize; #else static constexpr AlignmentStrategy kFieldAlignment = diff --git a/runtime/vm/constants_x64.cc b/runtime/vm/constants_x64.cc index 6312a546f90..b80a77a5b49 100644 --- a/runtime/vm/constants_x64.cc +++ b/runtime/vm/constants_x64.cc @@ -18,7 +18,7 @@ const char* const fpu_reg_names[kNumberOfXmmRegisters] = { "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7", "xmm8", "xmm9", "xmm10", "xmm11", "xmm12", "xmm13", "xmm14", "xmm15"}; -#if defined(TARGET_OS_WINDOWS) +#if defined(DART_TARGET_OS_WINDOWS) const Register CallingConventions::ArgumentRegisters[] = { CallingConventions::kArg1Reg, CallingConventions::kArg2Reg, CallingConventions::kArg3Reg, CallingConventions::kArg4Reg}; diff --git a/runtime/vm/constants_x64.h b/runtime/vm/constants_x64.h index 7a3c9b781e2..6e7c80bde11 100644 --- a/runtime/vm/constants_x64.h +++ b/runtime/vm/constants_x64.h @@ -354,7 +354,7 @@ enum ScaleFactor { class CallingConventions { public: -#if defined(TARGET_OS_WINDOWS) +#if defined(DART_TARGET_OS_WINDOWS) static const Register kArg1Reg = RCX; static const Register kArg2Reg = RDX; static const Register kArg3Reg = R8; diff --git a/runtime/vm/cpu_arm.cc b/runtime/vm/cpu_arm.cc index f5f806a0e72..ac65f6d042a 100644 --- a/runtime/vm/cpu_arm.cc +++ b/runtime/vm/cpu_arm.cc @@ -14,7 +14,7 @@ #include "vm/object.h" #include "vm/simulator.h" -#if defined(HOST_OS_IOS) +#if defined(DART_HOST_OS_IOS) #include #endif @@ -57,7 +57,7 @@ DEFINE_FLAG(bool, "Use integer division instruction if supported"); #if defined(TARGET_HOST_MISMATCH) -#if defined(TARGET_OS_ANDROID) || defined(TARGET_OS_MACOS_IOS) +#if defined(DART_TARGET_OS_ANDROID) || defined(DART_TARGET_OS_MACOS_IOS) DEFINE_FLAG(bool, sim_use_hardfp, false, "Use the hardfp ABI."); #else DEFINE_FLAG(bool, sim_use_hardfp, true, "Use the hardfp ABI."); @@ -81,7 +81,7 @@ void CPU::FlushICache(uword start, uword size) { // On iOS we use sys_icache_invalidate from Darwin. See: // // https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man3/sys_icache_invalidate.3.html -#if defined(HOST_OS_IOS) +#if defined(DART_HOST_OS_IOS) sys_icache_invalidate(reinterpret_cast(start), size); #elif defined(__linux__) && !defined(ANDROID) extern void __clear_cache(char*, char*); @@ -115,7 +115,7 @@ bool HostCPUFeatures::initialized_ = false; #endif #if !defined(TARGET_HOST_MISMATCH) -#if HOST_OS_IOS +#if DART_HOST_OS_IOS void HostCPUFeatures::Init() { // TODO(24743): Actually check the CPU features and fail if we're missing // something assumed in a precompiled snapshot. @@ -130,7 +130,7 @@ void HostCPUFeatures::Init() { initialized_ = true; #endif } -#else // HOST_OS_IOS +#else // DART_HOST_OS_IOS void HostCPUFeatures::Init() { bool is_arm64 = false; CpuInfo::Init(); @@ -171,7 +171,7 @@ void HostCPUFeatures::Init() { CpuInfo::FieldContains(kCpuInfoHardware, "Marvell Armada 370/XP"); bool is_virtual_machine = CpuInfo::FieldContains(kCpuInfoHardware, "Dummy Virtual Machine"); -#if defined(HOST_OS_ANDROID) +#if defined(DART_HOST_OS_ANDROID) bool is_android = true; #else bool is_android = false; @@ -213,7 +213,7 @@ void HostCPUFeatures::Init() { initialized_ = true; #endif } -#endif // HOST_OS_IOS +#endif // DART_HOST_OS_IOS void HostCPUFeatures::Cleanup() { DEBUG_ASSERT(initialized_); diff --git a/runtime/vm/cpu_arm64.cc b/runtime/vm/cpu_arm64.cc index df0f48be466..e27ac58d59e 100644 --- a/runtime/vm/cpu_arm64.cc +++ b/runtime/vm/cpu_arm64.cc @@ -12,7 +12,7 @@ #include "vm/simulator.h" #if !defined(USING_SIMULATOR) -#if !defined(HOST_OS_FUCHSIA) +#if !defined(DART_HOST_OS_FUCHSIA) #include #else #include @@ -20,7 +20,7 @@ #include #endif -#if defined(HOST_OS_MACOS) || defined(HOST_OS_IOS) +#if defined(DART_HOST_OS_MACOS) || defined(DART_HOST_OS_IOS) #include #endif @@ -42,14 +42,14 @@ void CPU::FlushICache(uword start, uword size) { // On iOS we use sys_icache_invalidate from Darwin. See: // // https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man3/sys_icache_invalidate.3.html -#if defined(HOST_OS_MACOS) || defined(HOST_OS_IOS) +#if defined(DART_HOST_OS_MACOS) || defined(DART_HOST_OS_IOS) sys_icache_invalidate(reinterpret_cast(start), size); -#elif defined(HOST_OS_ANDROID) || defined(HOST_OS_LINUX) +#elif defined(DART_HOST_OS_ANDROID) || defined(DART_HOST_OS_LINUX) extern void __clear_cache(char*, char*); char* beg = reinterpret_cast(start); char* end = reinterpret_cast(start + size); ::__clear_cache(beg, end); -#elif defined(HOST_OS_FUCHSIA) +#elif defined(DART_HOST_OS_FUCHSIA) zx_status_t result = zx_cache_flush(reinterpret_cast(start), size, ZX_CACHE_FLUSH_INSN); ASSERT(result == ZX_OK); diff --git a/runtime/vm/cpuid.cc b/runtime/vm/cpuid.cc index dddd15a9f13..0541712b5e6 100644 --- a/runtime/vm/cpuid.cc +++ b/runtime/vm/cpuid.cc @@ -3,12 +3,12 @@ // BSD-style license that can be found in the LICENSE file. #include "vm/globals.h" -#if !defined(HOST_OS_MACOS) +#if !defined(DART_HOST_OS_MACOS) #include "vm/cpuid.h" #if defined(HOST_ARCH_IA32) || defined(HOST_ARCH_X64) // GetCpuId() on Windows, __get_cpuid() on Linux -#if defined(HOST_OS_WINDOWS) +#if defined(DART_HOST_OS_WINDOWS) #include // NOLINT #else #include // NOLINT @@ -28,7 +28,7 @@ const char* CpuId::brand_string_ = nullptr; #if defined(HOST_ARCH_IA32) || defined(HOST_ARCH_X64) void CpuId::GetCpuId(int32_t level, uint32_t info[4]) { -#if defined(HOST_OS_WINDOWS) +#if defined(DART_HOST_OS_WINDOWS) // The documentation for __cpuid is at: // http://msdn.microsoft.com/en-us/library/hskdteyh(v=vs.90).aspx __cpuid(reinterpret_cast(info), level); @@ -127,4 +127,4 @@ const char* CpuId::field(CpuInfoIndices idx) { #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64) } // namespace dart -#endif // !defined(HOST_OS_MACOS) +#endif // !defined(DART_HOST_OS_MACOS) diff --git a/runtime/vm/cpuid.h b/runtime/vm/cpuid.h index 99f4f34c808..abb4fdc0725 100644 --- a/runtime/vm/cpuid.h +++ b/runtime/vm/cpuid.h @@ -6,7 +6,7 @@ #define RUNTIME_VM_CPUID_H_ #include "vm/globals.h" -#if !defined(HOST_OS_MACOS) +#if !defined(DART_HOST_OS_MACOS) #include "vm/allocation.h" #include "vm/cpuinfo.h" @@ -48,5 +48,5 @@ class CpuId : public AllStatic { } // namespace dart -#endif // !defined(HOST_OS_MACOS) +#endif // !defined(DART_HOST_OS_MACOS) #endif // RUNTIME_VM_CPUID_H_ diff --git a/runtime/vm/cpuinfo_android.cc b/runtime/vm/cpuinfo_android.cc index 0807dfd2fdc..8c34f61408f 100644 --- a/runtime/vm/cpuinfo_android.cc +++ b/runtime/vm/cpuinfo_android.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "vm/globals.h" -#if defined(HOST_OS_ANDROID) +#if defined(DART_HOST_OS_ANDROID) #include "vm/cpuinfo.h" #include "vm/proccpuinfo.h" @@ -58,4 +58,4 @@ bool CpuInfo::HasField(const char* field) { } // namespace dart -#endif // defined(HOST_OS_ANDROID) +#endif // defined(DART_HOST_OS_ANDROID) diff --git a/runtime/vm/cpuinfo_fuchsia.cc b/runtime/vm/cpuinfo_fuchsia.cc index d5d88cff176..ca197c34dc9 100644 --- a/runtime/vm/cpuinfo_fuchsia.cc +++ b/runtime/vm/cpuinfo_fuchsia.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "vm/globals.h" -#if defined(HOST_OS_FUCHSIA) +#if defined(DART_HOST_OS_FUCHSIA) #include "vm/cpuinfo.h" @@ -66,4 +66,4 @@ bool CpuInfo::HasField(const char* field) { } // namespace dart -#endif // defined(HOST_OS_FUCHSIA) +#endif // defined(DART_HOST_OS_FUCHSIA) diff --git a/runtime/vm/cpuinfo_linux.cc b/runtime/vm/cpuinfo_linux.cc index 0c4fc99d06c..08621ed41e5 100644 --- a/runtime/vm/cpuinfo_linux.cc +++ b/runtime/vm/cpuinfo_linux.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "vm/globals.h" -#if defined(HOST_OS_LINUX) +#if defined(DART_HOST_OS_LINUX) #include "vm/cpuid.h" #include "vm/cpuinfo.h" @@ -94,4 +94,4 @@ bool CpuInfo::HasField(const char* field) { } // namespace dart -#endif // defined(HOST_OS_LINUX) +#endif // defined(DART_HOST_OS_LINUX) diff --git a/runtime/vm/cpuinfo_macos.cc b/runtime/vm/cpuinfo_macos.cc index cbc66f48cef..45968135831 100644 --- a/runtime/vm/cpuinfo_macos.cc +++ b/runtime/vm/cpuinfo_macos.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "vm/globals.h" -#if defined(HOST_OS_MACOS) +#if defined(DART_HOST_OS_MACOS) #include "vm/cpuinfo.h" @@ -76,4 +76,4 @@ bool CpuInfo::HasField(const char* field) { } // namespace dart -#endif // defined(HOST_OS_MACOS) +#endif // defined(DART_HOST_OS_MACOS) diff --git a/runtime/vm/cpuinfo_win.cc b/runtime/vm/cpuinfo_win.cc index 5e5601eeade..2a8ad21f342 100644 --- a/runtime/vm/cpuinfo_win.cc +++ b/runtime/vm/cpuinfo_win.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "vm/globals.h" -#if defined(HOST_OS_WINDOWS) +#if defined(DART_HOST_OS_WINDOWS) #include "vm/cpuid.h" #include "vm/cpuinfo.h" @@ -56,4 +56,4 @@ bool CpuInfo::HasField(const char* field) { } // namespace dart -#endif // defined(HOST_OS_WINDOWS) +#endif // defined(DART_HOST_OS_WINDOWS) diff --git a/runtime/vm/dart.cc b/runtime/vm/dart.cc index b2601a53bd9..2fbb323dac1 100644 --- a/runtime/vm/dart.cc +++ b/runtime/vm/dart.cc @@ -977,7 +977,7 @@ const char* Dart::FeaturesString(IsolateGroup* isolate_group, // Generated code must match the host architecture and ABI. #if defined(TARGET_ARCH_ARM) -#if defined(TARGET_OS_MACOS) || defined(TARGET_OS_MACOS_IOS) +#if defined(DART_TARGET_OS_MACOS) || defined(DART_TARGET_OS_MACOS_IOS) buffer.AddString(" arm-ios"); #else buffer.AddString(" arm-eabi"); @@ -985,7 +985,7 @@ const char* Dart::FeaturesString(IsolateGroup* isolate_group, buffer.AddString(TargetCPUFeatures::hardfp_supported() ? " hardfp" : " softfp"); #elif defined(TARGET_ARCH_ARM64) -#if defined(TARGET_OS_FUCHSIA) +#if defined(DART_TARGET_OS_FUCHSIA) // See signal handler cheat in Assembler::EnterFrame. buffer.AddString(" arm64-fuchsia"); #else @@ -994,7 +994,7 @@ const char* Dart::FeaturesString(IsolateGroup* isolate_group, #elif defined(TARGET_ARCH_IA32) buffer.AddString(" ia32"); #elif defined(TARGET_ARCH_X64) -#if defined(TARGET_OS_WINDOWS) +#if defined(DART_TARGET_OS_WINDOWS) buffer.AddString(" x64-win"); #else buffer.AddString(" x64-sysv"); diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc index db086986b71..756db2786e9 100644 --- a/runtime/vm/dart_api_impl.cc +++ b/runtime/vm/dart_api_impl.cc @@ -6593,7 +6593,7 @@ Dart_CreateAppAOTSnapshotAsAssembly(Dart_StreamingWriteCallback callback, void* debug_callback_data) { #if defined(TARGET_ARCH_IA32) return Api::NewError("AOT compilation is not supported on IA32."); -#elif defined(TARGET_OS_WINDOWS) +#elif defined(DART_TARGET_OS_WINDOWS) return Api::NewError("Assembly generation is not implemented for Windows."); #elif !defined(DART_PRECOMPILER) return Api::NewError( @@ -6621,7 +6621,7 @@ DART_EXPORT Dart_Handle Dart_CreateAppAOTSnapshotAsAssemblies( Dart_StreamingCloseCallback close_callback) { #if defined(TARGET_ARCH_IA32) return Api::NewError("AOT compilation is not supported on IA32."); -#elif defined(TARGET_OS_WINDOWS) +#elif defined(DART_TARGET_OS_WINDOWS) return Api::NewError("Assembly generation is not implemented for Windows."); #elif !defined(DART_PRECOMPILER) return Api::NewError( @@ -6645,7 +6645,7 @@ Dart_CreateVMAOTSnapshotAsAssembly(Dart_StreamingWriteCallback callback, void* callback_data) { #if defined(TARGET_ARCH_IA32) return Api::NewError("AOT compilation is not supported on IA32."); -#elif defined(TARGET_OS_WINDOWS) +#elif defined(DART_TARGET_OS_WINDOWS) return Api::NewError("Assembly generation is not implemented for Windows."); #elif !defined(DART_PRECOMPILER) return Api::NewError( diff --git a/runtime/vm/dwarf.cc b/runtime/vm/dwarf.cc index 53d6b39faf0..000bab4cf9e 100644 --- a/runtime/vm/dwarf.cc +++ b/runtime/vm/dwarf.cc @@ -778,7 +778,7 @@ static const char* ConvertResolvedURI(const char* str) { const intptr_t len = strlen(str); if (len > kResolvedFileRootLen && strncmp(str, kResolvedFileRoot, kResolvedFileRootLen) == 0) { -#if defined(HOST_OS_WINDOWS) +#if defined(DART_HOST_OS_WINDOWS) return str + kResolvedFileRootLen; // Strip off the entire prefix. #else return str + kResolvedFileRootLen - 1; // Leave a '/' on the front. diff --git a/runtime/vm/globals.h b/runtime/vm/globals.h index d7426c44fa2..d3ac9abe058 100644 --- a/runtime/vm/globals.h +++ b/runtime/vm/globals.h @@ -108,7 +108,8 @@ const intptr_t kDefaultMaxOldGenHeapSize = (kWordSize <= 4) ? 1536 : 30720; #define NOT_IN_PRECOMPILED_RUNTIME(code) code #endif // defined(DART_PRECOMPILED_RUNTIME) -#if !defined(PRODUCT) || defined(HOST_OS_FUCHSIA) || defined(TARGET_OS_FUCHSIA) +#if !defined(PRODUCT) || defined(DART_HOST_OS_FUCHSIA) || \ + defined(DART_TARGET_OS_FUCHSIA) #define SUPPORT_TIMELINE 1 #endif @@ -156,7 +157,7 @@ typedef uword cpp_vtable; // When using GCC we can use GCC attributes to ensure that certain // constants are 8 or 16 byte aligned. -#if defined(HOST_OS_WINDOWS) +#if defined(DART_HOST_OS_WINDOWS) #define ALIGN8 __declspec(align(8)) #define ALIGN16 __declspec(align(16)) #else @@ -172,7 +173,7 @@ static const uword kZapUninitializedWord = 0xabababababababab; #endif // Macros to get the contents of the fp register. -#if defined(HOST_OS_WINDOWS) +#if defined(DART_HOST_OS_WINDOWS) // clang-format off #if defined(HOST_ARCH_IA32) @@ -188,13 +189,13 @@ static const uword kZapUninitializedWord = 0xabababababababab; #error Unknown host architecture. #endif -#else // !defined(HOST_OS_WINDOWS)) +#else // !defined(DART_HOST_OS_WINDOWS)) // Assume GCC-compatible builtins. #define COPY_FP_REGISTER(fp) \ fp = reinterpret_cast(__builtin_frame_address(0)); -#endif // !defined(HOST_OS_WINDOWS)) +#endif // !defined(DART_HOST_OS_WINDOWS)) #if defined(TARGET_ARCH_ARM) || defined(TARGET_ARCH_ARM64) || \ defined(TARGET_ARCH_X64) diff --git a/runtime/vm/image_snapshot.cc b/runtime/vm/image_snapshot.cc index dd693837060..658892bd5f5 100644 --- a/runtime/vm/image_snapshot.cc +++ b/runtime/vm/image_snapshot.cc @@ -951,20 +951,20 @@ class DwarfAssemblyStream : public DwarfWriteStream { // Methods for writing the assembly prologues for various DWARF sections. void AbbreviationsPrologue() { -#if defined(TARGET_OS_MACOS) || defined(TARGET_OS_MACOS_IOS) +#if defined(DART_TARGET_OS_MACOS) || defined(DART_TARGET_OS_MACOS_IOS) stream_->WriteString(".section __DWARF,__debug_abbrev,regular,debug\n"); -#elif defined(TARGET_OS_LINUX) || defined(TARGET_OS_ANDROID) || \ - defined(TARGET_OS_FUCHSIA) +#elif defined(DART_TARGET_OS_LINUX) || defined(DART_TARGET_OS_ANDROID) || \ + defined(DART_TARGET_OS_FUCHSIA) stream_->WriteString(".section .debug_abbrev,\"\"\n"); #else UNIMPLEMENTED(); #endif } void DebugInfoPrologue() { -#if defined(TARGET_OS_MACOS) || defined(TARGET_OS_MACOS_IOS) +#if defined(DART_TARGET_OS_MACOS) || defined(DART_TARGET_OS_MACOS_IOS) stream_->WriteString(".section __DWARF,__debug_info,regular,debug\n"); -#elif defined(TARGET_OS_LINUX) || defined(TARGET_OS_ANDROID) || \ - defined(TARGET_OS_FUCHSIA) +#elif defined(DART_TARGET_OS_LINUX) || defined(DART_TARGET_OS_ANDROID) || \ + defined(DART_TARGET_OS_FUCHSIA) stream_->WriteString(".section .debug_info,\"\"\n"); #else UNIMPLEMENTED(); @@ -973,10 +973,10 @@ class DwarfAssemblyStream : public DwarfWriteStream { stream_->Printf("%s:\n", kDebugInfoLabel); } void LineNumberProgramPrologue() { -#if defined(TARGET_OS_MACOS) || defined(TARGET_OS_MACOS_IOS) +#if defined(DART_TARGET_OS_MACOS) || defined(DART_TARGET_OS_MACOS_IOS) stream_->WriteString(".section __DWARF,__debug_line,regular,debug\n"); -#elif defined(TARGET_OS_LINUX) || defined(TARGET_OS_ANDROID) || \ - defined(TARGET_OS_FUCHSIA) +#elif defined(DART_TARGET_OS_LINUX) || defined(DART_TARGET_OS_ANDROID) || \ + defined(DART_TARGET_OS_FUCHSIA) stream_->WriteString(".section .debug_line,\"\"\n"); #else UNIMPLEMENTED(); @@ -1131,10 +1131,10 @@ bool AssemblyImageWriter::EnterSection(ProgramSection section, current_symbols_ = new (zone_) ZoneGrowableArray(zone_, 0); } -#if defined(TARGET_OS_LINUX) || defined(TARGET_OS_ANDROID) || \ - defined(TARGET_OS_FUCHSIA) +#if defined(DART_TARGET_OS_LINUX) || defined(DART_TARGET_OS_ANDROID) || \ + defined(DART_TARGET_OS_FUCHSIA) assembly_stream_->WriteString(".section .rodata\n"); -#elif defined(TARGET_OS_MACOS) || defined(TARGET_OS_MACOS_IOS) +#elif defined(DART_TARGET_OS_MACOS) || defined(DART_TARGET_OS_MACOS_IOS) assembly_stream_->WriteString(".const\n"); #else UNIMPLEMENTED(); @@ -1308,7 +1308,7 @@ void AssemblyImageWriter::FrameUnwindPrologue() { // newer than late 2016. Can't emit .cfi_value_offset using .cfi_scape // because DW_CFA_val_offset uses scaled operand and we don't know what // data alignment factor will be choosen by the assembler when emitting CIE. -#if defined(TARGET_OS_ANDROID) +#if defined(DART_TARGET_OS_ANDROID) // On Android libunwindstack has a bug (b/191113792): it does not push // CFA value to the expression stack before evaluating expression given // to DW_CFA_expression. We have to workaround this bug by manually pushing @@ -1331,7 +1331,7 @@ void AssemblyImageWriter::FrameUnwindPrologue() { #endif #elif defined(TARGET_ARCH_ARM) -#if defined(TARGET_OS_MACOS) || defined(TARGET_OS_MACOS_IOS) +#if defined(DART_TARGET_OS_MACOS) || defined(DART_TARGET_OS_MACOS_IOS) COMPILE_ASSERT(FP == R7); assembly_stream_->WriteString(".cfi_def_cfa r7, 0\n"); // CFA is fp+0 assembly_stream_->WriteString(".cfi_offset r7, 0\n"); // saved fp is *(CFA+0) @@ -1347,7 +1347,7 @@ void AssemblyImageWriter::FrameUnwindPrologue() { // newer than late 2016. Can't emit .cfi_value_offset using .cfi_scape // because DW_CFA_val_offset uses scaled operand and we don't know what // data alignment factor will be choosen by the assembler when emitting CIE. -#if defined(TARGET_OS_ANDROID) +#if defined(DART_TARGET_OS_ANDROID) // On Android libunwindstack has a bug (b/191113792): it does not push // CFA value to the expression stack before evaluating expression given // to DW_CFA_expression. We have to workaround this bug by manually pushing @@ -1370,7 +1370,7 @@ void AssemblyImageWriter::FrameUnwindPrologue() { #endif // libunwind on ARM may use .ARM.exidx instead of .debug_frame -#if !defined(TARGET_OS_MACOS) && !defined(TARGET_OS_MACOS_IOS) +#if !defined(DART_TARGET_OS_MACOS) && !defined(DART_TARGET_OS_MACOS_IOS) COMPILE_ASSERT(FP == R11); assembly_stream_->WriteString(".fnstart\n"); assembly_stream_->WriteString(".save {r11, lr}\n"); @@ -1381,7 +1381,7 @@ void AssemblyImageWriter::FrameUnwindPrologue() { void AssemblyImageWriter::FrameUnwindEpilogue() { #if defined(TARGET_ARCH_ARM) -#if !defined(TARGET_OS_MACOS) && !defined(TARGET_OS_MACOS_IOS) +#if !defined(DART_TARGET_OS_MACOS) && !defined(DART_TARGET_OS_MACOS_IOS) assembly_stream_->WriteString(".fnend\n"); #endif #endif diff --git a/runtime/vm/malloc_hooks_unsupported.cc b/runtime/vm/malloc_hooks_unsupported.cc index d28100f63ac..df3a12b354f 100644 --- a/runtime/vm/malloc_hooks_unsupported.cc +++ b/runtime/vm/malloc_hooks_unsupported.cc @@ -10,13 +10,13 @@ #include "vm/json_stream.h" -#if defined(HOST_OS_LINUX) || defined(HOST_OS_ANDROID) +#if defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_ANDROID) #include -#elif defined(HOST_OS_MACOS) +#elif defined(DART_HOST_OS_MACOS) #include #endif -#if !defined(HOST_OS_WINDOWS) && !defined(TARGET_OS_IOS) +#if !defined(DART_HOST_OS_WINDOWS) && !defined(DART_TARGET_OS_MACOS_IOS) extern "C" { __attribute__((weak)) uintptr_t __sanitizer_get_current_allocated_bytes(); __attribute__((weak)) uintptr_t __sanitizer_get_heap_size(); @@ -60,7 +60,7 @@ bool MallocHooks::GetStats(intptr_t* used, intptr_t* capacity, const char** implementation) { #if !defined(PRODUCT) -#if !defined(HOST_OS_WINDOWS) && !defined(TARGET_OS_IOS) +#if !defined(DART_HOST_OS_WINDOWS) && !defined(DART_TARGET_OS_MACOS_IOS) if (__sanitizer_get_current_allocated_bytes != nullptr && __sanitizer_get_heap_size != nullptr) { *used = __sanitizer_get_current_allocated_bytes(); @@ -69,13 +69,13 @@ bool MallocHooks::GetStats(intptr_t* used, return true; } #endif -#if defined(HOST_OS_LINUX) || defined(HOST_OS_ANDROID) +#if defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_ANDROID) struct mallinfo info = mallinfo(); *used = info.uordblks; *capacity = *used + info.fordblks; *implementation = "unknown"; return true; -#elif defined(HOST_OS_MACOS) +#elif defined(DART_HOST_OS_MACOS) struct mstats stats = mstats(); *used = stats.bytes_used; *capacity = stats.bytes_total; diff --git a/runtime/vm/native_arguments.h b/runtime/vm/native_arguments.h index 5b206edba3e..d2df92c20d1 100644 --- a/runtime/vm/native_arguments.h +++ b/runtime/vm/native_arguments.h @@ -27,7 +27,7 @@ class Thread; uword current_sp = Simulator::Current()->get_register(SPREG); \ ASSERT(Utils::IsAligned(current_sp, OS::ActivationFrameAlignment())); \ } -#elif defined(HOST_OS_WINDOWS) +#elif defined(DART_HOST_OS_WINDOWS) // The compiler may dynamically align the stack on Windows, so do not check. #define CHECK_STACK_ALIGNMENT \ {} diff --git a/runtime/vm/native_symbol_android.cc b/runtime/vm/native_symbol_android.cc index 9d0c24558a9..d7837e3c990 100644 --- a/runtime/vm/native_symbol_android.cc +++ b/runtime/vm/native_symbol_android.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_ANDROID) +#if defined(DART_HOST_OS_ANDROID) #include "vm/native_symbol.h" #include "vm/os.h" @@ -68,4 +68,4 @@ void NativeSymbolResolver::AddSymbols(const char* dso_name, } // namespace dart -#endif // defined(HOST_OS_ANDROID) +#endif // defined(DART_HOST_OS_ANDROID) diff --git a/runtime/vm/native_symbol_fuchsia.cc b/runtime/vm/native_symbol_fuchsia.cc index 12b924961bb..1cb72a83f74 100644 --- a/runtime/vm/native_symbol_fuchsia.cc +++ b/runtime/vm/native_symbol_fuchsia.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "vm/globals.h" -#if defined(HOST_OS_FUCHSIA) +#if defined(DART_HOST_OS_FUCHSIA) #include "platform/memory_sanitizer.h" #include "vm/native_symbol.h" @@ -157,4 +157,4 @@ void NativeSymbolResolver::AddSymbols(const char* dso_name, } // namespace dart -#endif // defined(HOST_OS_FUCHSIA) +#endif // defined(DART_HOST_OS_FUCHSIA) diff --git a/runtime/vm/native_symbol_linux.cc b/runtime/vm/native_symbol_linux.cc index 158a2afea1e..75578905df4 100644 --- a/runtime/vm/native_symbol_linux.cc +++ b/runtime/vm/native_symbol_linux.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "vm/globals.h" -#if defined(HOST_OS_LINUX) +#if defined(DART_HOST_OS_LINUX) #include "platform/memory_sanitizer.h" #include "vm/native_symbol.h" @@ -69,4 +69,4 @@ void NativeSymbolResolver::AddSymbols(const char* dso_name, } // namespace dart -#endif // defined(HOST_OS_LINUX) +#endif // defined(DART_HOST_OS_LINUX) diff --git a/runtime/vm/native_symbol_macos.cc b/runtime/vm/native_symbol_macos.cc index 262bac552b2..aa1fc6c7d91 100644 --- a/runtime/vm/native_symbol_macos.cc +++ b/runtime/vm/native_symbol_macos.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "vm/globals.h" -#if defined(HOST_OS_MACOS) +#if defined(DART_HOST_OS_MACOS) #include "vm/native_symbol.h" #include "vm/os.h" @@ -66,4 +66,4 @@ void NativeSymbolResolver::AddSymbols(const char* dso_name, } // namespace dart -#endif // defined(HOST_OS_MACOS) +#endif // defined(DART_HOST_OS_MACOS) diff --git a/runtime/vm/native_symbol_win.cc b/runtime/vm/native_symbol_win.cc index 9ddc3a4e6cc..db48485a094 100644 --- a/runtime/vm/native_symbol_win.cc +++ b/runtime/vm/native_symbol_win.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "vm/globals.h" -#if defined(HOST_OS_WINDOWS) +#if defined(DART_HOST_OS_WINDOWS) #include "vm/lockers.h" #include "vm/native_symbol.h" @@ -26,7 +26,7 @@ void NativeSymbolResolver::Init() { // Symbol resolution API's used in this file are not supported // when compiled in UWP. -#ifndef TARGET_OS_WINDOWS_UWP +#ifndef DART_TARGET_OS_WINDOWS_UWP SymSetOptions(SYMOPT_UNDNAME | SYMOPT_DEFERRED_LOADS); HANDLE hProcess = GetCurrentProcess(); if (!SymInitialize(hProcess, NULL, TRUE)) { @@ -45,7 +45,7 @@ void NativeSymbolResolver::Cleanup() { return; } running_ = false; -#ifndef TARGET_OS_WINDOWS_UWP +#ifndef DART_TARGET_OS_WINDOWS_UWP HANDLE hProcess = GetCurrentProcess(); if (!SymCleanup(hProcess)) { DWORD error = GetLastError(); @@ -57,7 +57,7 @@ void NativeSymbolResolver::Cleanup() { } char* NativeSymbolResolver::LookupSymbolName(uword pc, uword* start) { -#ifdef TARGET_OS_WINDOWS_UWP +#ifdef DART_TARGET_OS_WINDOWS_UWP return NULL; #else static const intptr_t kMaxNameLength = 2048; @@ -86,7 +86,7 @@ char* NativeSymbolResolver::LookupSymbolName(uword pc, uword* start) { *start = pc - displacement; } return Utils::StrDup(pSymbol->Name); -#endif // ifdef TARGET_OS_WINDOWS_UWP +#endif // ifdef DART_TARGET_OS_WINDOWS_UWP } void NativeSymbolResolver::FreeSymbolName(char* name) { @@ -107,4 +107,4 @@ void NativeSymbolResolver::AddSymbols(const char* dso_name, } // namespace dart -#endif // defined(HOST_OS_WINDOWS) +#endif // defined(DART_HOST_OS_WINDOWS) diff --git a/runtime/vm/os_android.cc b/runtime/vm/os_android.cc index 10ad9cf62ba..3a32eecb373 100644 --- a/runtime/vm/os_android.cc +++ b/runtime/vm/os_android.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "vm/globals.h" -#if defined(HOST_OS_ANDROID) +#if defined(DART_HOST_OS_ANDROID) #include "vm/os.h" @@ -349,4 +349,4 @@ void OS::Exit(int code) { } // namespace dart -#endif // defined(HOST_OS_ANDROID) +#endif // defined(DART_HOST_OS_ANDROID) diff --git a/runtime/vm/os_fuchsia.cc b/runtime/vm/os_fuchsia.cc index 46c430376bc..448a10baa97 100644 --- a/runtime/vm/os_fuchsia.cc +++ b/runtime/vm/os_fuchsia.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "vm/globals.h" -#if defined(HOST_OS_FUCHSIA) +#if defined(DART_HOST_OS_FUCHSIA) #include "vm/os.h" @@ -638,4 +638,4 @@ void OS::Exit(int code) { } // namespace dart -#endif // defined(HOST_OS_FUCHSIA) +#endif // defined(DART_HOST_OS_FUCHSIA) diff --git a/runtime/vm/os_linux.cc b/runtime/vm/os_linux.cc index 9cbb5076778..5d78dc1ff05 100644 --- a/runtime/vm/os_linux.cc +++ b/runtime/vm/os_linux.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "vm/globals.h" -#if defined(HOST_OS_LINUX) +#if defined(DART_HOST_OS_LINUX) #include "vm/os.h" @@ -660,4 +660,4 @@ void OS::Exit(int code) { } // namespace dart -#endif // defined(HOST_OS_LINUX) +#endif // defined(DART_HOST_OS_LINUX) diff --git a/runtime/vm/os_macos.cc b/runtime/vm/os_macos.cc index 0a7e5293189..eed635df0d2 100644 --- a/runtime/vm/os_macos.cc +++ b/runtime/vm/os_macos.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "vm/globals.h" -#if defined(HOST_OS_MACOS) +#if defined(DART_HOST_OS_MACOS) #include "vm/os.h" @@ -15,7 +15,7 @@ #include // NOLINT #include // NOLINT #include // NOLINT -#if HOST_OS_IOS +#if DART_HOST_OS_IOS #include // NOLINT #endif @@ -26,7 +26,7 @@ namespace dart { const char* OS::Name() { -#if HOST_OS_IOS +#if DART_HOST_OS_IOS return "ios"; #else return "macos"; @@ -126,7 +126,7 @@ int64_t OS::GetCurrentThreadCPUMicrosForTimeline() { } intptr_t OS::ActivationFrameAlignment() { -#if HOST_OS_IOS +#if DART_HOST_OS_IOS #if TARGET_ARCH_ARM // Even if we generate code that maintains a stronger alignment, we cannot // assert the stronger stack alignment because C++ code will not maintain it. @@ -140,11 +140,11 @@ intptr_t OS::ActivationFrameAlignment() { #else #error Unimplemented #endif -#else // HOST_OS_IOS +#else // DART_HOST_OS_IOS // OS X activation frames must be 16 byte-aligned; see "Mac OS X ABI // Function Call Guide". return 16; -#endif // HOST_OS_IOS +#endif // DART_HOST_OS_IOS } int OS::NumberOfAvailableProcessors() { @@ -190,7 +190,7 @@ DART_NOINLINE uintptr_t OS::GetProgramCounter() { } void OS::Print(const char* format, ...) { -#if HOST_OS_IOS +#if DART_HOST_OS_IOS va_list args; va_start(args, format); vsyslog(LOG_INFO, format, args); @@ -267,7 +267,7 @@ bool OS::StringToInt64(const char* str, int64_t* value) { void OS::RegisterCodeObservers() {} void OS::PrintErr(const char* format, ...) { -#if HOST_OS_IOS +#if DART_HOST_OS_IOS va_list args; va_start(args, format); vsyslog(LOG_ERR, format, args); @@ -312,4 +312,4 @@ void OS::Exit(int code) { } // namespace dart -#endif // defined(HOST_OS_MACOS) +#endif // defined(DART_HOST_OS_MACOS) diff --git a/runtime/vm/os_thread.h b/runtime/vm/os_thread.h index edd66f5bbb8..dca500353c5 100644 --- a/runtime/vm/os_thread.h +++ b/runtime/vm/os_thread.h @@ -13,20 +13,20 @@ #include "vm/globals.h" // On iOS, thread_local requires iOS 9+. -#if !HOST_OS_IOS +#if !DART_HOST_OS_IOS #define HAS_C11_THREAD_LOCAL 1 #endif // Declare the OS-specific types ahead of defining the generic classes. -#if defined(HOST_OS_ANDROID) +#if defined(DART_HOST_OS_ANDROID) #include "vm/os_thread_android.h" -#elif defined(HOST_OS_FUCHSIA) +#elif defined(DART_HOST_OS_FUCHSIA) #include "vm/os_thread_fuchsia.h" -#elif defined(HOST_OS_LINUX) +#elif defined(DART_HOST_OS_LINUX) #include "vm/os_thread_linux.h" -#elif defined(HOST_OS_MACOS) +#elif defined(DART_HOST_OS_MACOS) #include "vm/os_thread_macos.h" -#elif defined(HOST_OS_WINDOWS) +#elif defined(DART_HOST_OS_WINDOWS) #include "vm/os_thread_win.h" #else #error Unknown target os. diff --git a/runtime/vm/os_thread_android.cc b/runtime/vm/os_thread_android.cc index cff837876db..df257e330ab 100644 --- a/runtime/vm/os_thread_android.cc +++ b/runtime/vm/os_thread_android.cc @@ -4,7 +4,7 @@ #include "platform/globals.h" // NOLINT -#if defined(HOST_OS_ANDROID) +#if defined(DART_HOST_OS_ANDROID) #include "vm/os_thread.h" @@ -490,4 +490,4 @@ void Monitor::NotifyAll() { } // namespace dart -#endif // defined(HOST_OS_ANDROID) +#endif // defined(DART_HOST_OS_ANDROID) diff --git a/runtime/vm/os_thread_fuchsia.cc b/runtime/vm/os_thread_fuchsia.cc index 9108f5dffdf..1eb8a3a0f14 100644 --- a/runtime/vm/os_thread_fuchsia.cc +++ b/runtime/vm/os_thread_fuchsia.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" // NOLINT -#if defined(HOST_OS_FUCHSIA) +#if defined(DART_HOST_OS_FUCHSIA) #include "vm/os.h" #include "vm/os_thread.h" @@ -492,4 +492,4 @@ void Monitor::NotifyAll() { } // namespace dart -#endif // defined(HOST_OS_FUCHSIA) +#endif // defined(DART_HOST_OS_FUCHSIA) diff --git a/runtime/vm/os_thread_linux.cc b/runtime/vm/os_thread_linux.cc index 053736d9017..167721a67b9 100644 --- a/runtime/vm/os_thread_linux.cc +++ b/runtime/vm/os_thread_linux.cc @@ -4,7 +4,7 @@ #include "platform/globals.h" // NOLINT -#if defined(HOST_OS_LINUX) +#if defined(DART_HOST_OS_LINUX) #include "vm/os_thread.h" @@ -496,4 +496,4 @@ void Monitor::NotifyAll() { } // namespace dart -#endif // defined(HOST_OS_LINUX) +#endif // defined(DART_HOST_OS_LINUX) diff --git a/runtime/vm/os_thread_macos.cc b/runtime/vm/os_thread_macos.cc index e24ce128dfb..401fdc79a52 100644 --- a/runtime/vm/os_thread_macos.cc +++ b/runtime/vm/os_thread_macos.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" // NOLINT -#if defined(HOST_OS_MACOS) +#if defined(DART_HOST_OS_MACOS) #include "vm/os_thread.h" @@ -459,4 +459,4 @@ void Monitor::NotifyAll() { } // namespace dart -#endif // defined(HOST_OS_MACOS) +#endif // defined(DART_HOST_OS_MACOS) diff --git a/runtime/vm/os_thread_win.cc b/runtime/vm/os_thread_win.cc index 7c2f9b2caef..8b859a83afb 100644 --- a/runtime/vm/os_thread_win.cc +++ b/runtime/vm/os_thread_win.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" // NOLINT -#if defined(HOST_OS_WINDOWS) +#if defined(DART_HOST_OS_WINDOWS) #include "vm/growable_array.h" #include "vm/lockers.h" @@ -530,4 +530,4 @@ PIMAGE_TLS_CALLBACK p_thread_callback_dart = OnDartThreadExit; #endif // _WIN64 } // extern "C" -#endif // defined(HOST_OS_WINDOWS) +#endif // defined(DART_HOST_OS_WINDOWS) diff --git a/runtime/vm/os_win.cc b/runtime/vm/os_win.cc index da2d6f7d5a7..3eb9be090ae 100644 --- a/runtime/vm/os_win.cc +++ b/runtime/vm/os_win.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "vm/globals.h" -#if defined(HOST_OS_WINDOWS) +#if defined(DART_HOST_OS_WINDOWS) #include "vm/os.h" @@ -348,4 +348,4 @@ void OS::Exit(int code) { } // namespace dart -#endif // defined(HOST_OS_WINDOWS) +#endif // defined(DART_HOST_OS_WINDOWS) diff --git a/runtime/vm/proccpuinfo.cc b/runtime/vm/proccpuinfo.cc index 6278627086b..066e3f7a5f6 100644 --- a/runtime/vm/proccpuinfo.cc +++ b/runtime/vm/proccpuinfo.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "vm/globals.h" -#if defined(HOST_OS_LINUX) || defined(HOST_OS_ANDROID) +#if defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_ANDROID) #include "vm/proccpuinfo.h" @@ -146,4 +146,4 @@ bool ProcCpuInfo::HasField(const char* field) { } // namespace dart -#endif // defined(HOST_OS_LINUX) || defined(HOST_OS_ANDROID) +#endif // defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_ANDROID) diff --git a/runtime/vm/proccpuinfo.h b/runtime/vm/proccpuinfo.h index 02ee2bf176e..ff249d42d2d 100644 --- a/runtime/vm/proccpuinfo.h +++ b/runtime/vm/proccpuinfo.h @@ -6,7 +6,7 @@ #define RUNTIME_VM_PROCCPUINFO_H_ #include "vm/globals.h" -#if defined(HOST_OS_LINUX) || defined(HOST_OS_ANDROID) +#if defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_ANDROID) #include "vm/allocation.h" @@ -29,6 +29,6 @@ class ProcCpuInfo : public AllStatic { } // namespace dart -#endif // defined(HOST_OS_LINUX) || defined(HOST_OS_ANDROID) +#endif // defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_ANDROID) #endif // RUNTIME_VM_PROCCPUINFO_H_ diff --git a/runtime/vm/profiler.cc b/runtime/vm/profiler.cc index 568c78a5fcf..532eb63e831 100644 --- a/runtime/vm/profiler.cc +++ b/runtime/vm/profiler.cc @@ -797,7 +797,7 @@ static void CopyStackBuffer(Sample* sample, uword sp_addr) { } } -#if defined(HOST_OS_WINDOWS) +#if defined(DART_HOST_OS_WINDOWS) // On Windows this code is synchronously executed from the thread interrupter // thread. This means we can safely have a static fault_address. static uword fault_address = 0; @@ -826,7 +826,7 @@ static void CollectSample(Isolate* isolate, uword sp, ProfilerCounters* counters) { ASSERT(counters != NULL); -#if defined(HOST_OS_WINDOWS) +#if defined(DART_HOST_OS_WINDOWS) // Use structured exception handling to trap guard page access on Windows. __try { #endif @@ -854,7 +854,7 @@ static void CollectSample(Isolate* isolate, sample->SetAt(0, pc); } -#if defined(HOST_OS_WINDOWS) +#if defined(DART_HOST_OS_WINDOWS) // Use structured exception handling to trap guard page access. } __except (GuardPageExceptionFilter(GetExceptionInformation())) { // NOLINT // Sample collection triggered a guard page fault: @@ -1013,14 +1013,15 @@ void Profiler::DumpStackTrace(void* context) { DumpStackTrace(/*for_crash=*/true); return; } -#if defined(HOST_OS_LINUX) || defined(HOST_OS_MACOS) || defined(HOST_OS_ANDROID) +#if defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_MACOS) || \ + defined(DART_HOST_OS_ANDROID) ucontext_t* ucontext = reinterpret_cast(context); mcontext_t mcontext = ucontext->uc_mcontext; uword pc = SignalHandler::GetProgramCounter(mcontext); uword fp = SignalHandler::GetFramePointer(mcontext); uword sp = SignalHandler::GetCStackPointer(mcontext); DumpStackTrace(sp, fp, pc, /*for_crash=*/true); -#elif defined(HOST_OS_WINDOWS) +#elif defined(DART_HOST_OS_WINDOWS) CONTEXT* ctx = reinterpret_cast(context); #if defined(HOST_ARCH_IA32) uword pc = static_cast(ctx->Eip); diff --git a/runtime/vm/profiler_test.cc b/runtime/vm/profiler_test.cc index 5d6bd682297..1829169ca63 100644 --- a/runtime/vm/profiler_test.cc +++ b/runtime/vm/profiler_test.cc @@ -478,8 +478,8 @@ ISOLATE_UNIT_TEST_CASE(Profiler_TrivialRecordAllocation) { } } -#if defined(DART_USE_TCMALLOC) && defined(HOST_OS_LINUX) && defined(DEBUG) && \ - defined(HOST_ARCH_X64) +#if defined(DART_USE_TCMALLOC) && defined(DART_HOST_OS_LINUX) && \ + defined(DEBUG) && defined(HOST_ARCH_X64) DART_NOINLINE static void NativeAllocationSampleHelper(char** result) { ASSERT(result != NULL); @@ -584,7 +584,7 @@ ISOLATE_UNIT_TEST_CASE(Profiler_NativeAllocation) { stack_trace_collection_enabled); FLAG_profiler_native_memory = enable_malloc_hooks_saved; } -#endif // defined(DART_USE_TCMALLOC) && defined(HOST_OS_LINUX) && \ +#endif // defined(DART_USE_TCMALLOC) && defined(DART_HOST_OS_LINUX) && \ // defined(DEBUG) && defined(HOST_ARCH_X64) ISOLATE_UNIT_TEST_CASE(Profiler_ToggleRecordAllocation) { diff --git a/runtime/vm/runtime_entry.cc b/runtime/vm/runtime_entry.cc index 2cd5a195b4e..c7305ca34fd 100644 --- a/runtime/vm/runtime_entry.cc +++ b/runtime/vm/runtime_entry.cc @@ -3595,7 +3595,7 @@ static Thread* GetThreadForNativeCallback(uword callback_id, return thread; } -#if defined(HOST_OS_WINDOWS) +#if defined(DART_HOST_OS_WINDOWS) #pragma intrinsic(_ReturnAddress) #endif @@ -3606,7 +3606,7 @@ static Thread* GetThreadForNativeCallback(uword callback_id, extern "C" Thread* DLRT_GetThreadForNativeCallback(uword callback_id) { CHECK_STACK_ALIGNMENT; TRACE_RUNTIME_CALL("GetThreadForNativeCallback %" Pd, callback_id); -#if defined(HOST_OS_WINDOWS) +#if defined(DART_HOST_OS_WINDOWS) void* return_address = _ReturnAddress(); #else void* return_address = __builtin_return_address(0); diff --git a/runtime/vm/service.cc b/runtime/vm/service.cc index 804ca501f2e..51d5a000599 100644 --- a/runtime/vm/service.cc +++ b/runtime/vm/service.cc @@ -4238,7 +4238,7 @@ static void RequestHeapSnapshot(Thread* thread, JSONStream* js) { PrintSuccess(js); } -#if defined(HOST_OS_LINUX) || defined(HOST_OS_ANDROID) +#if defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_ANDROID) struct VMMapping { char path[256]; size_t size; @@ -4404,7 +4404,7 @@ static intptr_t GetProcessMemoryUsageHelper(JSONStream* js) { } // On Android, malloc is better labeled by /proc/self/smaps. -#if !defined(HOST_OS_ANDROID) +#if !defined(DART_HOST_OS_ANDROID) intptr_t used, capacity; const char* implementation; if (MallocHooks::GetStats(&used, &capacity, &implementation)) { @@ -4432,7 +4432,7 @@ static intptr_t GetProcessMemoryUsageHelper(JSONStream* js) { } #endif -#if defined(HOST_OS_LINUX) || defined(HOST_OS_ANDROID) +#if defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_ANDROID) AddVMMappings(&rss_children); #endif // TODO(46166): Implement for other operating systems. diff --git a/runtime/vm/signal_handler.h b/runtime/vm/signal_handler.h index 41eea90dc59..22821d35fba 100644 --- a/runtime/vm/signal_handler.h +++ b/runtime/vm/signal_handler.h @@ -8,10 +8,10 @@ #include "vm/allocation.h" #include "vm/globals.h" -#if defined(HOST_OS_LINUX) +#if defined(DART_HOST_OS_LINUX) #include // NOLINT #include // NOLINT -#elif defined(HOST_OS_ANDROID) +#elif defined(DART_HOST_OS_ANDROID) #include // NOLINT #if !defined(__BIONIC_HAVE_UCONTEXT_T) #include // NOLINT @@ -25,15 +25,15 @@ typedef struct ucontext { uint32_t uc_sigmask; } ucontext_t; #endif // !defined(__BIONIC_HAVE_UCONTEXT_T) -#elif defined(HOST_OS_MACOS) +#elif defined(DART_HOST_OS_MACOS) #include // NOLINT #include // NOLINT -#elif defined(HOST_OS_WINDOWS) +#elif defined(DART_HOST_OS_WINDOWS) // Stub out for windows. struct siginfo_t; struct mcontext_t; struct sigset_t {}; -#elif defined(HOST_OS_FUCHSIA) +#elif defined(DART_HOST_OS_FUCHSIA) #include // NOLINT #include // NOLINT #endif @@ -42,7 +42,7 @@ struct sigset_t {}; // work around incorrect Thumb -> ARM transitions. See SignalHandlerTrampoline // below for more details. #if defined(HOST_ARCH_ARM) && \ - (defined(HOST_OS_LINUX) || defined(HOST_OS_ANDROID)) && \ + (defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_ANDROID)) && \ !defined(__thumb__) #define USE_SIGNAL_HANDLER_TRAMPOLINE #endif diff --git a/runtime/vm/signal_handler_android.cc b/runtime/vm/signal_handler_android.cc index cdef00fc363..47c2dedb637 100644 --- a/runtime/vm/signal_handler_android.cc +++ b/runtime/vm/signal_handler_android.cc @@ -6,7 +6,7 @@ #include "vm/instructions.h" #include "vm/signal_handler.h" #include "vm/simulator.h" -#if defined(HOST_OS_ANDROID) +#if defined(DART_HOST_OS_ANDROID) namespace dart { @@ -138,4 +138,4 @@ void SignalHandler::Remove() { } // namespace dart -#endif // defined(HOST_OS_ANDROID) +#endif // defined(DART_HOST_OS_ANDROID) diff --git a/runtime/vm/signal_handler_fuchsia.cc b/runtime/vm/signal_handler_fuchsia.cc index a0f0cf1af17..3a2f161994e 100644 --- a/runtime/vm/signal_handler_fuchsia.cc +++ b/runtime/vm/signal_handler_fuchsia.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "vm/globals.h" -#if defined(HOST_OS_FUCHSIA) +#if defined(DART_HOST_OS_FUCHSIA) #include "vm/signal_handler.h" @@ -46,4 +46,4 @@ void SignalHandler::Remove() { } // namespace dart -#endif // defined(HOST_OS_FUCHSIA) +#endif // defined(DART_HOST_OS_FUCHSIA) diff --git a/runtime/vm/signal_handler_linux.cc b/runtime/vm/signal_handler_linux.cc index a9cb30bcec8..ae75730848e 100644 --- a/runtime/vm/signal_handler_linux.cc +++ b/runtime/vm/signal_handler_linux.cc @@ -6,7 +6,7 @@ #include "vm/instructions.h" #include "vm/signal_handler.h" #include "vm/simulator.h" -#if defined(HOST_OS_LINUX) +#if defined(DART_HOST_OS_LINUX) namespace dart { @@ -117,4 +117,4 @@ void SignalHandler::Remove() { } // namespace dart -#endif // defined(HOST_OS_LINUX) +#endif // defined(DART_HOST_OS_LINUX) diff --git a/runtime/vm/signal_handler_macos.cc b/runtime/vm/signal_handler_macos.cc index 081a947ddb6..71ad84f5cca 100644 --- a/runtime/vm/signal_handler_macos.cc +++ b/runtime/vm/signal_handler_macos.cc @@ -6,7 +6,7 @@ #include "vm/instructions.h" #include "vm/signal_handler.h" #include "vm/simulator.h" -#if defined(HOST_OS_MACOS) +#if defined(DART_HOST_OS_MACOS) namespace dart { @@ -113,4 +113,4 @@ void SignalHandler::Remove() { } // namespace dart -#endif // defined(HOST_OS_MACOS) +#endif // defined(DART_HOST_OS_MACOS) diff --git a/runtime/vm/signal_handler_win.cc b/runtime/vm/signal_handler_win.cc index f38ba71ab58..254164c3350 100644 --- a/runtime/vm/signal_handler_win.cc +++ b/runtime/vm/signal_handler_win.cc @@ -4,7 +4,7 @@ #include "vm/globals.h" #include "vm/signal_handler.h" -#if defined(HOST_OS_WINDOWS) +#if defined(DART_HOST_OS_WINDOWS) namespace dart { @@ -43,4 +43,4 @@ void SignalHandler::Remove() { } // namespace dart -#endif // defined(HOST_OS_WINDOWS) +#endif // defined(DART_HOST_OS_WINDOWS) diff --git a/runtime/vm/simulator_arm.cc b/runtime/vm/simulator_arm.cc index a775233a6d0..d17cb92e08e 100644 --- a/runtime/vm/simulator_arm.cc +++ b/runtime/vm/simulator_arm.cc @@ -3554,7 +3554,7 @@ int64_t Simulator::Call(int32_t entry, int32_t r6_val = get_register(R6); int32_t r7_val = get_register(R7); int32_t r8_val = get_register(R8); -#if !defined(TARGET_OS_MACOS) && !defined(TARGET_OS_MACOS_IOS) +#if !defined(DART_TARGET_OS_MACOS) && !defined(DART_TARGET_OS_MACOS_IOS) int32_t r9_val = get_register(R9); #endif int32_t r10_val = get_register(R10); @@ -3588,7 +3588,7 @@ int64_t Simulator::Call(int32_t entry, set_register(R6, callee_saved_value); set_register(R7, callee_saved_value); set_register(R8, callee_saved_value); -#if !defined(TARGET_OS_MACOS) && !defined(TARGET_OS_MACOS_IOS) +#if !defined(DART_TARGET_OS_MACOS) && !defined(DART_TARGET_OS_MACOS_IOS) set_register(R9, callee_saved_value); #endif set_register(R10, callee_saved_value); @@ -3616,7 +3616,7 @@ int64_t Simulator::Call(int32_t entry, ASSERT(callee_saved_value == get_register(R6)); ASSERT(callee_saved_value == get_register(R7)); ASSERT(callee_saved_value == get_register(R8)); -#if !defined(TARGET_OS_MACOS) && !defined(TARGET_OS_MACOS_IOS) +#if !defined(DART_TARGET_OS_MACOS) && !defined(DART_TARGET_OS_MACOS_IOS) ASSERT(callee_saved_value == get_register(R9)); #endif ASSERT(callee_saved_value == get_register(R10)); @@ -3639,7 +3639,7 @@ int64_t Simulator::Call(int32_t entry, set_register(R6, r6_val); set_register(R7, r7_val); set_register(R8, r8_val); -#if !defined(TARGET_OS_MACOS) && !defined(TARGET_OS_MACOS_IOS) +#if !defined(DART_TARGET_OS_MACOS) && !defined(DART_TARGET_OS_MACOS_IOS) set_register(R9, r9_val); #endif set_register(R10, r10_val); diff --git a/runtime/vm/simulator_arm64.cc b/runtime/vm/simulator_arm64.cc index 83f65d7dc03..f62ce3bf78c 100644 --- a/runtime/vm/simulator_arm64.cc +++ b/runtime/vm/simulator_arm64.cc @@ -950,7 +950,7 @@ void Simulator::set_register(Instr* instr, R31Type r31t) { // Register is in range. ASSERT((reg >= 0) && (reg < kNumberOfCpuRegisters)); -#if !defined(TARGET_OS_FUCHSIA) +#if !defined(DART_TARGET_OS_FUCHSIA) ASSERT(instr == NULL || reg != R18); // R18 is globally reserved on iOS. #endif @@ -2711,7 +2711,7 @@ void Simulator::DecodeMiscDP3Source(Instr* instr) { // Format(instr, "smulh 'rd, 'rn, 'rm"); const int64_t rn_val = get_register(rn, R31IsZR); const int64_t rm_val = get_register(rm, R31IsZR); -#if defined(HOST_OS_WINDOWS) +#if defined(DART_HOST_OS_WINDOWS) // Visual Studio does not support __int128. int64_t alu_out; Multiply128(rn_val, rm_val, &alu_out); @@ -2719,7 +2719,7 @@ void Simulator::DecodeMiscDP3Source(Instr* instr) { const __int128 res = static_cast<__int128>(rn_val) * static_cast<__int128>(rm_val); const int64_t alu_out = static_cast(res >> 64); -#endif // HOST_OS_WINDOWS +#endif // DART_HOST_OS_WINDOWS set_register(instr, rd, alu_out, R31IsZR); } else if ((instr->Bits(29, 3) == 4) && (instr->Bits(21, 3) == 6) && (instr->Bit(15) == 0)) { @@ -2727,7 +2727,7 @@ void Simulator::DecodeMiscDP3Source(Instr* instr) { // Format(instr, "umulh 'rd, 'rn, 'rm"); const uint64_t rn_val = get_register(rn, R31IsZR); const uint64_t rm_val = get_register(rm, R31IsZR); -#if defined(HOST_OS_WINDOWS) +#if defined(DART_HOST_OS_WINDOWS) // Visual Studio does not support __int128. uint64_t alu_out; UnsignedMultiply128(rn_val, rm_val, &alu_out); @@ -2735,7 +2735,7 @@ void Simulator::DecodeMiscDP3Source(Instr* instr) { const unsigned __int128 res = static_cast(rn_val) * static_cast(rm_val); const uint64_t alu_out = static_cast(res >> 64); -#endif // HOST_OS_WINDOWS +#endif // DART_HOST_OS_WINDOWS set_register(instr, rd, alu_out, R31IsZR); } else if ((instr->Bits(29, 3) == 4) && (instr->Bit(15) == 0)) { if (instr->Bits(21, 3) == 5) { diff --git a/runtime/vm/stack_frame.cc b/runtime/vm/stack_frame.cc index b0831552a8d..e9fc6f7b2ed 100644 --- a/runtime/vm/stack_frame.cc +++ b/runtime/vm/stack_frame.cc @@ -146,7 +146,7 @@ bool StackFrame::IsStubFrame() const { } ASSERT(!(IsEntryFrame() || IsExitFrame())); -#if !defined(HOST_OS_WINDOWS) && !defined(HOST_OS_FUCHSIA) +#if !defined(DART_HOST_OS_WINDOWS) && !defined(DART_HOST_OS_FUCHSIA) // On Windows and Fuchsia, the profiler calls this from a separate thread // where Thread::Current() is NULL, so we cannot create a NoSafepointScope. NoSafepointScope no_safepoint; @@ -335,7 +335,7 @@ CodePtr StackFrame::LookupDartCode() const { // We add a no gc scope to ensure that the code below does not trigger // a GC as we are handling raw object references here. It is possible // that the code is called while a GC is in progress, that is ok. -#if !defined(HOST_OS_WINDOWS) && !defined(HOST_OS_FUCHSIA) +#if !defined(DART_HOST_OS_WINDOWS) && !defined(DART_HOST_OS_FUCHSIA) // On Windows and Fuchsia, the profiler calls this from a separate thread // where Thread::Current() is NULL, so we cannot create a NoSafepointScope. NoSafepointScope no_safepoint; diff --git a/runtime/vm/stack_frame_arm.h b/runtime/vm/stack_frame_arm.h index e79cc9c4f5a..8b5a5d36132 100644 --- a/runtime/vm/stack_frame_arm.h +++ b/runtime/vm/stack_frame_arm.h @@ -49,7 +49,7 @@ static const int kCallerSpSlotFromFp = 2; static const int kLastParamSlotFromEntrySp = 0; // Entry and exit frame layout. -#if defined(TARGET_OS_MACOS) || defined(TARGET_OS_MACOS_IOS) +#if defined(DART_TARGET_OS_MACOS) || defined(DART_TARGET_OS_MACOS_IOS) static const int kExitLinkSlotFromEntryFp = -27; COMPILE_ASSERT(kAbiPreservedCpuRegCount == 6); COMPILE_ASSERT(kAbiPreservedFpuRegCount == 4); diff --git a/runtime/vm/stack_frame_arm64.h b/runtime/vm/stack_frame_arm64.h index a487e67891c..a6d1e9d8e9d 100644 --- a/runtime/vm/stack_frame_arm64.h +++ b/runtime/vm/stack_frame_arm64.h @@ -49,7 +49,7 @@ static const int kCallerSpSlotFromFp = 2; static const int kLastParamSlotFromEntrySp = 0; // Entry and exit frame layout. -#if defined(TARGET_OS_FUCHSIA) +#if defined(DART_TARGET_OS_FUCHSIA) static const int kExitLinkSlotFromEntryFp = -24; COMPILE_ASSERT(kAbiPreservedCpuRegCount == 11); #else diff --git a/runtime/vm/stack_frame_x64.h b/runtime/vm/stack_frame_x64.h index fd6176b0f3c..d924db1ccd3 100644 --- a/runtime/vm/stack_frame_x64.h +++ b/runtime/vm/stack_frame_x64.h @@ -52,11 +52,11 @@ static const int kCallerSpSlotFromFp = 2; static const int kLastParamSlotFromEntrySp = 1; // Skip return address. // Entry and exit frame layout. -#if defined(TARGET_OS_WINDOWS) +#if defined(DART_TARGET_OS_WINDOWS) static const int kExitLinkSlotFromEntryFp = -33; #else static const int kExitLinkSlotFromEntryFp = -11; -#endif // defined(TARGET_OS_WINDOWS) +#endif // defined(DART_TARGET_OS_WINDOWS) // For FFI native -> Dart callbacks, the number of stack slots between arguments // passed on stack and arguments saved in callback prologue. 2 = return adddress diff --git a/runtime/vm/tagged_pointer.h b/runtime/vm/tagged_pointer.h index cbf9a354f0d..dac584b4b7f 100644 --- a/runtime/vm/tagged_pointer.h +++ b/runtime/vm/tagged_pointer.h @@ -194,7 +194,7 @@ class ObjectPtr { uword heap_base() const { // TODO(rmacnak): Why does Windows have trouble linking GetClassId used // here? -#if !defined(HOST_OS_WINDOWS) +#if !defined(DART_HOST_OS_WINDOWS) ASSERT(IsHeapObject()); ASSERT(!IsInstructions()); ASSERT(!IsInstructionsSection()); diff --git a/runtime/vm/thread.h b/runtime/vm/thread.h index 0f746385969..2d80830add6 100644 --- a/runtime/vm/thread.h +++ b/runtime/vm/thread.h @@ -1261,7 +1261,7 @@ class RuntimeCallDeoptScope : public StackResource { } }; -#if defined(HOST_OS_WINDOWS) +#if defined(DART_HOST_OS_WINDOWS) // Clears the state of the current thread and frees the allocation. void WindowsThreadCleanUp(); #endif diff --git a/runtime/vm/thread_interrupter_android.cc b/runtime/vm/thread_interrupter_android.cc index 87eb5fc656e..367fa416afd 100644 --- a/runtime/vm/thread_interrupter_android.cc +++ b/runtime/vm/thread_interrupter_android.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_ANDROID) +#if defined(DART_HOST_OS_ANDROID) #include // NOLINT #include // NOLINT @@ -75,4 +75,4 @@ void ThreadInterrupter::RemoveSignalHandler() { } // namespace dart -#endif // defined(HOST_OS_ANDROID) +#endif // defined(DART_HOST_OS_ANDROID) diff --git a/runtime/vm/thread_interrupter_fuchsia.cc b/runtime/vm/thread_interrupter_fuchsia.cc index c0f5d5e1a5c..b2955694ae9 100644 --- a/runtime/vm/thread_interrupter_fuchsia.cc +++ b/runtime/vm/thread_interrupter_fuchsia.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_FUCHSIA) +#if defined(DART_HOST_OS_FUCHSIA) #include "vm/thread_interrupter.h" @@ -255,4 +255,4 @@ void ThreadInterrupter::RemoveSignalHandler() { } // namespace dart -#endif // defined(HOST_OS_FUCHSIA) +#endif // defined(DART_HOST_OS_FUCHSIA) diff --git a/runtime/vm/thread_interrupter_linux.cc b/runtime/vm/thread_interrupter_linux.cc index 04b0686f2d4..300a3dd1468 100644 --- a/runtime/vm/thread_interrupter_linux.cc +++ b/runtime/vm/thread_interrupter_linux.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_LINUX) +#if defined(DART_HOST_OS_LINUX) #include // NOLINT @@ -74,4 +74,4 @@ void ThreadInterrupter::RemoveSignalHandler() { } // namespace dart -#endif // defined(HOST_OS_LINUX) +#endif // defined(DART_HOST_OS_LINUX) diff --git a/runtime/vm/thread_interrupter_macos.cc b/runtime/vm/thread_interrupter_macos.cc index eb89fe75a8a..bc81f93882d 100644 --- a/runtime/vm/thread_interrupter_macos.cc +++ b/runtime/vm/thread_interrupter_macos.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_MACOS) +#if defined(DART_HOST_OS_MACOS) #include // NOLINT #include // NOLINT @@ -95,4 +95,4 @@ void ThreadInterrupter::RemoveSignalHandler() { } // namespace dart -#endif // defined(HOST_OS_MACOS) +#endif // defined(DART_HOST_OS_MACOS) diff --git a/runtime/vm/thread_interrupter_win.cc b/runtime/vm/thread_interrupter_win.cc index c862a225279..bfbf5d1e55d 100644 --- a/runtime/vm/thread_interrupter_win.cc +++ b/runtime/vm/thread_interrupter_win.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" -#if defined(HOST_OS_WINDOWS) +#if defined(DART_HOST_OS_WINDOWS) #include "vm/flags.h" #include "vm/os.h" @@ -118,4 +118,4 @@ void ThreadInterrupter::RemoveSignalHandler() { } // namespace dart -#endif // defined(HOST_OS_WINDOWS) +#endif // defined(DART_HOST_OS_WINDOWS) diff --git a/runtime/vm/timeline.cc b/runtime/vm/timeline.cc index 74d2ef47710..e57fa3b67e6 100644 --- a/runtime/vm/timeline.cc +++ b/runtime/vm/timeline.cc @@ -106,13 +106,13 @@ static TimelineEventRecorder* CreateTimelineRecorder() { THR_Print("Using the Systrace timeline recorder.\n"); } -#if defined(HOST_OS_LINUX) || defined(HOST_OS_ANDROID) +#if defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_ANDROID) return new TimelineEventSystraceRecorder(); -#elif defined(HOST_OS_MACOS) +#elif defined(DART_HOST_OS_MACOS) if (__builtin_available(iOS 12.0, macOS 10.14, *)) { return new TimelineEventMacosRecorder(); } -#elif defined(HOST_OS_FUCHSIA) +#elif defined(DART_HOST_OS_FUCHSIA) return new TimelineEventFuchsiaRecorder(); #else OS::PrintErr( @@ -754,13 +754,13 @@ TimelineStream::TimelineStream(const char* name, bool enabled) : name_(name), fuchsia_name_(fuchsia_name), -#if defined(HOST_OS_FUCHSIA) +#if defined(DART_HOST_OS_FUCHSIA) enabled_(static_cast(true)) // For generated code. #else enabled_(static_cast(enabled)) #endif { -#if defined(HOST_OS_MACOS) +#if defined(DART_HOST_OS_MACOS) if (__builtin_available(iOS 12.0, macOS 10.14, *)) { macos_log_ = os_log_create("Dart", name); } @@ -1086,7 +1086,7 @@ void TimelineEventRecorder::WriteTo(const char* directory) { int64_t TimelineEventRecorder::GetNextAsyncId() { // TODO(johnmccutchan): Gracefully handle wrap around. -#if defined(HOST_OS_FUCHSIA) +#if defined(DART_HOST_OS_FUCHSIA) return trace_generate_nonce(); #else uint32_t next = static_cast(async_id_.fetch_add(1u)); diff --git a/runtime/vm/timeline.h b/runtime/vm/timeline.h index ce3def96aa2..69302aa9231 100644 --- a/runtime/vm/timeline.h +++ b/runtime/vm/timeline.h @@ -15,16 +15,16 @@ #include "vm/os.h" #include "vm/os_thread.h" -#if defined(FUCHSIA_SDK) || defined (HOST_OS_FUCHSIA) +#if defined(FUCHSIA_SDK) || defined(DART_HOST_OS_FUCHSIA) #include #include -#elif defined(HOST_OS_MACOS) +#elif defined(DART_HOST_OS_MACOS) #include #if defined(__MAC_10_14) || defined (__IPHONE_12_0) -#define HOST_OS_SUPPORTS_SIGNPOST 1 +#define DART_HOST_OS_SUPPORTS_SIGNPOST 1 #endif // signpost.h exists in macOS 10.14, iOS 12 or above -#if defined(HOST_OS_SUPPORTS_SIGNPOST) +#if defined(DART_HOST_OS_SUPPORTS_SIGNPOST) #include #else #include @@ -77,7 +77,7 @@ class TimelineStream { const char* fuchsia_name() const { return fuchsia_name_; } bool enabled() { -#if defined(HOST_OS_FUCHSIA) +#if defined(DART_HOST_OS_FUCHSIA) #ifdef PRODUCT return trace_is_category_enabled(fuchsia_name_); #else @@ -85,7 +85,7 @@ class TimelineStream { #endif // PRODUCT #else return enabled_ != 0; -#endif // defined(HOST_OS_FUCHSIA) +#endif // defined(DART_HOST_OS_FUCHSIA) } void set_enabled(bool enabled) { enabled_ = enabled ? 1 : 0; } @@ -100,9 +100,9 @@ class TimelineStream { return OFFSET_OF(TimelineStream, enabled_); } -#if defined(HOST_OS_FUCHSIA) +#if defined(DART_HOST_OS_FUCHSIA) trace_site_t* trace_site() { return &trace_site_; } -#elif defined(HOST_OS_MACOS) +#elif defined(DART_HOST_OS_MACOS) os_log_t macos_log() { return macos_log_; } #endif @@ -114,9 +114,9 @@ class TimelineStream { // 0 or 1. If this becomes a BitField, the generated code must be updated. uintptr_t enabled_; -#if defined(HOST_OS_FUCHSIA) +#if defined(DART_HOST_OS_FUCHSIA) trace_site_t trace_site_ = {}; -#elif defined(HOST_OS_MACOS) +#elif defined(DART_HOST_OS_MACOS) os_log_t macos_log_ = {}; #endif }; @@ -933,7 +933,7 @@ class TimelineEventPlatformRecorder : public TimelineEventRecorder { void CompleteEvent(TimelineEvent* event); }; -#if defined(HOST_OS_FUCHSIA) +#if defined(DART_HOST_OS_FUCHSIA) // A recorder that sends events to Fuchsia's tracing app. class TimelineEventFuchsiaRecorder : public TimelineEventPlatformRecorder { public: @@ -946,9 +946,9 @@ class TimelineEventFuchsiaRecorder : public TimelineEventPlatformRecorder { private: void OnEvent(TimelineEvent* event); }; -#endif // defined(HOST_OS_FUCHSIA) +#endif // defined(DART_HOST_OS_FUCHSIA) -#if defined(HOST_OS_ANDROID) || defined(HOST_OS_LINUX) +#if defined(DART_HOST_OS_ANDROID) || defined(DART_HOST_OS_LINUX) // A recorder that writes events to Android Systrace. This class is exposed in // this header file only so that PrintSystrace can be visible to // timeline_test.cc. @@ -969,9 +969,9 @@ class TimelineEventSystraceRecorder : public TimelineEventPlatformRecorder { int systrace_fd_; }; -#endif // defined(HOST_OS_ANDROID) || defined(HOST_OS_LINUX) +#endif // defined(DART_HOST_OS_ANDROID) || defined(DART_HOST_OS_LINUX) -#if defined(HOST_OS_MACOS) +#if defined(DART_HOST_OS_MACOS) // A recorder that sends events to Macos's tracing app. See: // https://developer.apple.com/documentation/os/logging?language=objc class TimelineEventMacosRecorder : public TimelineEventPlatformRecorder { @@ -985,7 +985,7 @@ class TimelineEventMacosRecorder : public TimelineEventPlatformRecorder { private: void OnEvent(TimelineEvent* event) API_AVAILABLE(ios(12.0), macos(10.14)); }; -#endif // defined(HOST_OS_MACOS) +#endif // defined(DART_HOST_OS_MACOS) class DartTimelineEventHelpers : public AllStatic { public: diff --git a/runtime/vm/timeline_android.cc b/runtime/vm/timeline_android.cc index 046d0a2b75f..93e2faad417 100644 --- a/runtime/vm/timeline_android.cc +++ b/runtime/vm/timeline_android.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "vm/globals.h" -#if defined(HOST_OS_ANDROID) && defined(SUPPORT_TIMELINE) +#if defined(DART_HOST_OS_ANDROID) && defined(SUPPORT_TIMELINE) #include #include @@ -115,4 +115,4 @@ void TimelineEventSystraceRecorder::OnEvent(TimelineEvent* event) { } // namespace dart -#endif // defined(HOST_OS_ANDROID) && !defined(PRODUCT) +#endif // defined(DART_HOST_OS_ANDROID) && !defined(PRODUCT) diff --git a/runtime/vm/timeline_fuchsia.cc b/runtime/vm/timeline_fuchsia.cc index 5d119fc8199..38bca2995a6 100644 --- a/runtime/vm/timeline_fuchsia.cc +++ b/runtime/vm/timeline_fuchsia.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "vm/globals.h" -#if defined(HOST_OS_FUCHSIA) && defined(SUPPORT_TIMELINE) +#if defined(DART_HOST_OS_FUCHSIA) && defined(SUPPORT_TIMELINE) #include #include #include @@ -121,4 +121,4 @@ void TimelineEventFuchsiaRecorder::OnEvent(TimelineEvent* event) { } // namespace dart -#endif // defined(HOST_OS_FUCHSIA) && defined(SUPPORT_TIMELINE) +#endif // defined(DART_HOST_OS_FUCHSIA) && defined(SUPPORT_TIMELINE) diff --git a/runtime/vm/timeline_linux.cc b/runtime/vm/timeline_linux.cc index 3756f1688ec..f685df22c9c 100644 --- a/runtime/vm/timeline_linux.cc +++ b/runtime/vm/timeline_linux.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "vm/globals.h" -#if defined(HOST_OS_LINUX) && defined(SUPPORT_TIMELINE) +#if defined(DART_HOST_OS_LINUX) && defined(SUPPORT_TIMELINE) #include #include @@ -115,4 +115,4 @@ void TimelineEventSystraceRecorder::OnEvent(TimelineEvent* event) { } // namespace dart -#endif // defined(HOST_OS_LINUX) && !defined(PRODUCT) +#endif // defined(DART_HOST_OS_LINUX) && !defined(PRODUCT) diff --git a/runtime/vm/timeline_macos.cc b/runtime/vm/timeline_macos.cc index 93e0f7db202..1bda7e5c1b4 100644 --- a/runtime/vm/timeline_macos.cc +++ b/runtime/vm/timeline_macos.cc @@ -3,8 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "vm/globals.h" -#if defined(HOST_OS_MACOS) && defined(SUPPORT_TIMELINE) - +#if defined(DART_HOST_OS_MACOS) && defined(SUPPORT_TIMELINE) #include "vm/log.h" #include "vm/timeline.h" @@ -22,7 +21,7 @@ void TimelineEventMacosRecorder::OnEvent(TimelineEvent* event) { return; } -#if defined(HOST_OS_SUPPORTS_SIGNPOST) +#if defined(DART_HOST_OS_SUPPORTS_SIGNPOST) os_log_t log = event->stream_->macos_log(); if (!os_signpost_enabled(log)) { return; @@ -75,9 +74,9 @@ void TimelineEventMacosRecorder::OnEvent(TimelineEvent* event) { default: break; } -#endif // defined(HOST_OS_SUPPORTS_SIGNPOST) +#endif // defined(DART_HOST_OS_SUPPORTS_SIGNPOST) } } // namespace dart -#endif // defined(HOST_OS_MACOS) && defined(SUPPORT_TIMELINE) +#endif // defined(DART_HOST_OS_MACOS) && defined(SUPPORT_TIMELINE) diff --git a/runtime/vm/timeline_test.cc b/runtime/vm/timeline_test.cc index f171921a555..97699cd3045 100644 --- a/runtime/vm/timeline_test.cc +++ b/runtime/vm/timeline_test.cc @@ -163,7 +163,7 @@ TEST_CASE(TimelineEventDurationPrintJSON) { event.DurationEnd(); } -#if defined(HOST_OS_ANDROID) || defined(HOST_OS_LINUX) +#if defined(DART_HOST_OS_ANDROID) || defined(DART_HOST_OS_LINUX) TEST_CASE(TimelineEventPrintSystrace) { const intptr_t kBufferLength = 1024; char buffer[kBufferLength]; @@ -209,7 +209,7 @@ TEST_CASE(TimelineEventPrintSystrace) { kBufferLength); EXPECT_STREQ("", buffer); } -#endif // defined(HOST_OS_ANDROID) || defined(HOST_OS_LINUX) +#endif // defined(DART_HOST_OS_ANDROID) || defined(DART_HOST_OS_LINUX) TEST_CASE(TimelineEventArguments) { // Create a test stream. diff --git a/runtime/vm/virtual_memory_compressed.h b/runtime/vm/virtual_memory_compressed.h index 4201018ec96..0df8b1c0cab 100644 --- a/runtime/vm/virtual_memory_compressed.h +++ b/runtime/vm/virtual_memory_compressed.h @@ -20,9 +20,9 @@ static constexpr intptr_t kCompressedHeapNumPages = static constexpr intptr_t kCompressedHeapBitmapSize = kCompressedHeapNumPages / 8; -#if !defined(HOST_OS_FUCHSIA) +#if !defined(DART_HOST_OS_FUCHSIA) #define DART_COMPRESSED_HEAP -#endif // !defined(HOST_OS_FUCHSIA) +#endif // !defined(DART_HOST_OS_FUCHSIA) #endif // defined(DART_COMPRESSED_POINTERS) #if defined(DART_COMPRESSED_HEAP) diff --git a/runtime/vm/virtual_memory_fuchsia.cc b/runtime/vm/virtual_memory_fuchsia.cc index 731b86d7f4a..7f7347d9877 100644 --- a/runtime/vm/virtual_memory_fuchsia.cc +++ b/runtime/vm/virtual_memory_fuchsia.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "vm/globals.h" -#if defined(HOST_OS_FUCHSIA) +#if defined(DART_HOST_OS_FUCHSIA) #include "vm/virtual_memory.h" @@ -279,4 +279,4 @@ void VirtualMemory::Protect(void* address, intptr_t size, Protection mode) { } // namespace dart -#endif // defined(HOST_OS_FUCHSIA) +#endif // defined(DART_HOST_OS_FUCHSIA) diff --git a/runtime/vm/virtual_memory_posix.cc b/runtime/vm/virtual_memory_posix.cc index aeb4a52a42c..2d8757daf98 100644 --- a/runtime/vm/virtual_memory_posix.cc +++ b/runtime/vm/virtual_memory_posix.cc @@ -3,7 +3,8 @@ // BSD-style license that can be found in the LICENSE file. #include "vm/globals.h" -#if defined(HOST_OS_ANDROID) || defined(HOST_OS_LINUX) || defined(HOST_OS_MACOS) +#if defined(DART_HOST_OS_ANDROID) || defined(DART_HOST_OS_LINUX) || \ + defined(DART_HOST_OS_MACOS) #include "vm/virtual_memory.h" @@ -37,7 +38,7 @@ namespace dart { DECLARE_FLAG(bool, dual_map_code); DECLARE_FLAG(bool, write_protect_code); -#if defined(TARGET_OS_LINUX) +#if defined(DART_TARGET_OS_LINUX) DECLARE_FLAG(bool, generate_perf_events_symbols); DECLARE_FLAG(bool, generate_perf_jitdump); #endif @@ -101,7 +102,7 @@ void VirtualMemory::Init() { #if defined(DUAL_MAPPING_SUPPORTED) // Perf is Linux-specific and the flags aren't defined in Product. -#if defined(TARGET_OS_LINUX) && !defined(PRODUCT) +#if defined(DART_TARGET_OS_LINUX) && !defined(PRODUCT) // Perf interacts strangely with memfds, leading it to sometimes collect // garbled return addresses. if (FLAG_generate_perf_events_symbols || FLAG_generate_perf_jitdump) { @@ -136,7 +137,7 @@ void VirtualMemory::Init() { } #endif // defined(DUAL_MAPPING_SUPPORTED) -#if defined(HOST_OS_LINUX) || defined(HOST_OS_ANDROID) +#if defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_ANDROID) FILE* fp = fopen("/proc/sys/vm/max_map_count", "r"); if (fp != nullptr) { size_t max_map_count = 0; @@ -286,7 +287,7 @@ VirtualMemory* VirtualMemory::AllocateAligned(intptr_t size, // The mapping will be RX and stays that way until it will eventually be // unmapped. MemoryRegion region(region_ptr, size); - // DUAL_MAPPING_SUPPORTED is false in TARGET_OS_MACOS and hence support + // DUAL_MAPPING_SUPPORTED is false in DART_TARGET_OS_MACOS and hence support // for MAP_JIT is not required here. const int alias_prot = PROT_READ | PROT_EXEC; void* hint = reinterpret_cast(&Dart_Initialize); @@ -333,11 +334,11 @@ VirtualMemory* VirtualMemory::AllocateAligned(intptr_t size, #endif int map_flags = MAP_PRIVATE | MAP_ANONYMOUS; -#if (defined(HOST_OS_MACOS) && !defined(HOST_OS_IOS)) +#if (defined(DART_HOST_OS_MACOS) && !defined(DART_HOST_OS_IOS)) if (is_executable && IsAtLeastOS10_14()) { map_flags |= MAP_JIT; } -#endif // defined(HOST_OS_MACOS) +#endif // defined(DART_HOST_OS_MACOS) void* hint = nullptr; // Some 64-bit microarchitectures store only the low 32-bits of targets as @@ -431,4 +432,5 @@ void VirtualMemory::Protect(void* address, intptr_t size, Protection mode) { } // namespace dart -#endif // defined(HOST_OS_ANDROID ... HOST_OS_LINUX ... HOST_OS_MACOS) +#endif // defined(DART_HOST_OS_ANDROID) || defined(DART_HOST_OS_LINUX) || \ + // defined(DART_HOST_OS_MACOS) diff --git a/runtime/vm/virtual_memory_win.cc b/runtime/vm/virtual_memory_win.cc index 994833dbd40..5348b3cd735 100644 --- a/runtime/vm/virtual_memory_win.cc +++ b/runtime/vm/virtual_memory_win.cc @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. #include "vm/globals.h" -#if defined(HOST_OS_WINDOWS) +#if defined(DART_HOST_OS_WINDOWS) #include "vm/virtual_memory.h" @@ -191,4 +191,4 @@ void VirtualMemory::Protect(void* address, intptr_t size, Protection mode) { } // namespace dart -#endif // defined(HOST_OS_WINDOWS) +#endif // defined(DART_HOST_OS_WINDOWS)