Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
platform_macos_cocoa.mm
Go to the documentation of this file.
1// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
2// for details. All rights reserved. Use of this source code is governed by a
3// BSD-style license that can be found in the LICENSE file.
4
5#include "platform/globals.h"
6
7#if !defined(DART_HOST_OS_MACOS)
8#error Do not build platform_macos_cocoa.mm on non-MacOS platforms.
9#endif
10
12
13#import <Foundation/NSProcessInfo.h>
14#import <Foundation/NSString.h>
15
16namespace dart {
17namespace bin {
18
20 @autoreleasepool {
21 // `operatingSystemVersionString` has been available since iOS 2.0+ and macOS 10.2+.
22 NSString* version =
23 [[NSProcessInfo processInfo] operatingSystemVersionString];
24 return std::string([version UTF8String]);
25 }
26}
27
28} // namespace bin
29} // namespace dart
std::string NSProcessInfoOperatingSystemVersionString()