chromium/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/system/sys_info_mac.mm

// Copyright 2016 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "partition_alloc/partition_alloc_base/system/sys_info.h"

#import <Foundation/Foundation.h>

#include "partition_alloc/partition_alloc_base/numerics/safe_conversions.h"

namespace partition_alloc::internal::base {

// static
void SysInfo::OperatingSystemVersionNumbers(int32_t* major_version,
                                            int32_t* minor_version,
                                            int32_t* bugfix_version) {
  NSOperatingSystemVersion version =
      NSProcessInfo.processInfo.operatingSystemVersion;
  *major_version = saturated_cast<int32_t>(version.majorVersion);
  *minor_version = saturated_cast<int32_t>(version.minorVersion);
  *bugfix_version = saturated_cast<int32_t>(version.patchVersion);
}

}  // namespace partition_alloc::internal::base