6#if defined(DART_HOST_OS_MACOS)
12#include <sys/utsname.h>
19#if !defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) || \
20 __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ <= 1060
21 intptr_t
len = strlen(
s);
22 if ((n < 0) || (
len < 0)) {
30 return reinterpret_cast<char*
>(memmove(
result,
s,
len));
43#if !defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) || \
44 __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ <= 1060
46 while ((
len <= n) && (*
s !=
'\0')) {
67 FATAL(
"Fatal error in Utils::VSNPrint with format '%s'",
format);
75size_t Utils::Read(
int filedes,
void* buf,
size_t nbyte) {
76 return read(filedes, buf, nbyte);
87int32_t DarwinMajorVersionInternal() {
93 struct utsname uname_info;
94 if (uname(&uname_info) != 0) {
95 FATAL(
"Fatal error in DarwinMajorVersionInternal : invalid return uname");
99 if (strcmp(uname_info.sysname,
"Darwin") != 0) {
101 "Fatal error in DarwinMajorVersionInternal : unexpected uname"
107 int32_t darwin_major_version = 0;
108 char*
dot = strchr(uname_info.release,
'.');
111 char* end_ptr =
nullptr;
112 darwin_major_version = strtol(uname_info.release, &end_ptr, 10);
113 if (errno != 0 || (end_ptr == uname_info.release)) {
120 "Fatal error in DarwinMajorVersionInternal :"
121 " could not parse uname release '%s'",
126 return darwin_major_version;
131int32_t MacOSXVersionInternal() {
132 const int32_t darwin_major_version = DarwinMajorVersionInternal();
134 int32_t major_version;
135 int32_t minor_version;
137 if (darwin_major_version < 20) {
146 major_version = (darwin_major_version - 9);
153 const int32_t field_multiplier = (darwin_major_version < 14) ? 10 : 100;
154 const int32_t major_multiplier = field_multiplier * field_multiplier;
155 const int32_t minor_multiplier = field_multiplier;
157 return major_version * major_multiplier + minor_version * minor_multiplier;
161 static int mac_os_x_version = MacOSXVersionInternal();
162 return mac_os_x_version;
168int32_t MacOSMinorVersion(int32_t
version) {
172 const int32_t field_multiplier =
173 (
version < MAC_OS_X_VERSION_10_10) ? 10 : 100;
174 return (
version / field_multiplier) % field_multiplier;
177int32_t MacOSMajorVersion(int32_t
version) {
181 const int32_t field_multiplier =
182 (
version < MAC_OS_X_VERSION_10_10) ? 10 : 100;
183 return version / (field_multiplier * field_multiplier);
190 if (current_version >= MAC_OS_X_VERSION_MIN_REQUIRED) {
195 "Current Mac OS X version %d.%d is lower than minimum supported version "
197 MacOSMajorVersion(current_version), MacOSMinorVersion(current_version),
198 MacOSMajorVersion(MAC_OS_X_VERSION_MIN_REQUIRED),
199 MacOSMinorVersion(MAC_OS_X_VERSION_MIN_REQUIRED));
static bool read(SkStream *stream, void *buffer, size_t amount)
static constexpr T Maximum(T x, T y)
static int SNPrint(char *str, size_t size, const char *format,...) PRINTF_ATTRIBUTE(3
static char * StrDup(const char *s)
static int static int VSNPrint(char *str, size_t size, const char *format, va_list args)
static size_t Read(int filedes, void *buf, size_t nbyte)
static intptr_t StrNLen(const char *s, intptr_t n)
static int Close(int fildes)
static int Unlink(const char *path)
static char * SCreate(const char *format,...) PRINTF_ATTRIBUTE(1
static char * StrNDup(const char *s, intptr_t n)
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
uint32_t uint32_t * format
void * malloc(size_t size)
char * CheckIsAtLeastMinRequiredMacOSVersion()
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
char * strdup(const char *str1)
SINT T dot(const Vec< N, T > &a, const Vec< N, T > &b)