mirror of
https://github.com/dart-lang/sdk
synced 2024-11-02 12:24:24 +00:00
8462f1da74
simulator. Also changes the MacOS implementation of that property. TEST=platform_os_version_test.dart Bug: 47138 Change-Id: I9134845a216423c8a383b804986af1ebb3c8d3d9 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214863 Commit-Queue: Brian Quinlan <bquinlan@google.com> Reviewed-by: Chinmay Garde <chinmaygarde@google.com> Reviewed-by: Siva Annamalai <asiva@google.com>
29 lines
854 B
Text
29 lines
854 B
Text
// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
|
|
// 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.
|
|
|
|
#include "platform/globals.h"
|
|
|
|
#if !defined(DART_HOST_OS_MACOS)
|
|
#error Do not build platform_macos_cocoa.mm on non-MacOS platforms.
|
|
#endif
|
|
|
|
#include "bin/platform_macos_cocoa.h"
|
|
|
|
#import <Foundation/NSProcessInfo.h>
|
|
#import <Foundation/NSString.h>
|
|
|
|
namespace dart {
|
|
namespace bin {
|
|
|
|
std::string NSProcessInfoOperatingSystemVersionString() {
|
|
@autoreleasepool {
|
|
// `operatingSystemVersionString` has been available since iOS 2.0+ and macOS 10.2+.
|
|
NSString* version =
|
|
[[NSProcessInfo processInfo] operatingSystemVersionString];
|
|
return std::string([version UTF8String]);
|
|
}
|
|
}
|
|
|
|
} // namespace bin
|
|
} // namespace dart
|