Skip to content

Revert "Mark several C macros imported from <float.h> as deprecated." #6817

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions stdlib/public/Platform/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ set(swift_platform_sources
tgmath.swift.gyb)

add_swift_library(swiftDarwin ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_SDK_OVERLAY
Darwin.swift.gyb
Darwin.swift
${swift_platform_sources}
POSIXError.swift
MachError.swift
Expand All @@ -18,7 +18,7 @@ add_swift_library(swiftDarwin ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_SDK_OVERLAY
API_NOTES_NON_OVERLAY)

add_swift_library(swiftGlibc ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_SDK_OVERLAY
Glibc.swift.gyb
Glibc.swift
${swift_platform_sources}

SWIFT_COMPILE_FLAGS "${SWIFT_RUNTIME_SWIFT_COMPILE_FLAGS}"
Expand Down
31 changes: 31 additions & 0 deletions stdlib/public/Platform/Darwin.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//

@_exported import Darwin // Clang module

public let MAP_FAILED =
UnsafeMutableRawPointer(bitPattern: -1)! as UnsafeMutableRawPointer!

@available(swift, deprecated: 3.0, message: "Please use 'Double.pi' or '.pi' to get the value of correct type and avoid casting.")
public let M_PI = Double.pi

@available(swift, deprecated: 3.0, message: "Please use 'Double.pi / 2' or '.pi / 2' to get the value of correct type and avoid casting.")
public let M_PI_2 = Double.pi / 2

@available(swift, deprecated: 3.0, message: "Please use 'Double.pi / 4' or '.pi / 4' to get the value of correct type and avoid casting.")
public let M_PI_4 = Double.pi / 4

@available(swift, deprecated: 3.0, message: "Please use '2.squareRoot()'.")
public let M_SQRT2 = 2.squareRoot()

@available(swift, deprecated: 3.0, message: "Please use '0.5.squareRoot()'.")
public let M_SQRT1_2 = 0.5.squareRoot()
72 changes: 0 additions & 72 deletions stdlib/public/Platform/Darwin.swift.gyb

This file was deleted.

31 changes: 31 additions & 0 deletions stdlib/public/Platform/Glibc.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//

@_exported import SwiftGlibc // Clang module

public let MAP_FAILED =
UnsafeMutableRawPointer(bitPattern: -1)! as UnsafeMutableRawPointer!

@available(swift, deprecated: 3.0, message: "Please use '.pi' to get the value of correct type and avoid casting.")
public let M_PI = Double.pi

@available(swift, deprecated: 3.0, message: "Please use '.pi / 2' to get the value of correct type and avoid casting.")
public let M_PI_2 = Double.pi / 2

@available(swift, deprecated: 3.0, message: "Please use '.pi / 4' to get the value of correct type and avoid casting.")
public let M_PI_4 = Double.pi / 4

@available(swift, deprecated: 3.0, message: "Please use '2.squareRoot()'.")
public let M_SQRT2 = 2.squareRoot()

@available(swift, deprecated: 3.0, message: "Please use '0.5.squareRoot()'.")
public let M_SQRT1_2 = 0.5.squareRoot()
72 changes: 0 additions & 72 deletions stdlib/public/Platform/Glibc.swift.gyb

This file was deleted.

File renamed without changes.
35 changes: 0 additions & 35 deletions test/stdlib/FloatConstants.swift

This file was deleted.