Skip to content

Commit e689ad3

Browse files
authored
Merge pull request #78819 from CodaFi/max-power
2 parents ea2c501 + 0f94164 commit e689ad3

File tree

3 files changed

+4
-10
lines changed

3 files changed

+4
-10
lines changed

lib/Basic/Platform.cpp

+4-6
Original file line numberDiff line numberDiff line change
@@ -434,8 +434,6 @@ llvm::Triple swift::getUnversionedTriple(const llvm::Triple &triple) {
434434
std::optional<llvm::VersionTuple>
435435
swift::getSwiftRuntimeCompatibilityVersionForTarget(
436436
const llvm::Triple &Triple) {
437-
#define MAX(a, b) ((a) > (b) ? (a) : (b))
438-
439437
if (Triple.isMacOSX()) {
440438
llvm::VersionTuple OSVersion;
441439
Triple.getMacOSXVersion(OSVersion);
@@ -445,7 +443,7 @@ swift::getSwiftRuntimeCompatibilityVersionForTarget(
445443
auto floorFor64 = [&Triple](llvm::VersionTuple v) {
446444
if (!Triple.isAArch64()) return v;
447445
// macOS got first arm64(e) support in 11.0, i.e. VersionTuple(5, 3)
448-
return MAX(v, llvm::VersionTuple(5, 3));
446+
return std::max(v, llvm::VersionTuple(5, 3));
449447
};
450448

451449
if (Major == 10) {
@@ -489,13 +487,13 @@ swift::getSwiftRuntimeCompatibilityVersionForTarget(
489487
if (Triple.isAArch64() && Major <= 14 &&
490488
(Triple.isSimulatorEnvironment() ||
491489
Triple.isMacCatalystEnvironment()))
492-
return MAX(v, llvm::VersionTuple(5, 3));
490+
return std::max(v, llvm::VersionTuple(5, 3));
493491

494492
if (Triple.getArchName() != "arm64e") return v;
495493

496494
// iOS got first arm64e support in 12.0, which has a Swift runtime version
497495
// older than 5.0, so let's floor at VersionTuple(5, 0) instead.
498-
return MAX(v, llvm::VersionTuple(5, 0));
496+
return std::max(v, llvm::VersionTuple(5, 0));
499497
};
500498

501499
if (Major <= 12) {
@@ -532,7 +530,7 @@ swift::getSwiftRuntimeCompatibilityVersionForTarget(
532530
auto floorFor64bits = [&Triple](llvm::VersionTuple v) {
533531
if (!Triple.isArch64Bit()) return v;
534532
// 64-bit watchOS was introduced with Swift 5.3
535-
return MAX(v, llvm::VersionTuple(5, 3));
533+
return std::max(v, llvm::VersionTuple(5, 3));
536534
};
537535

538536
if (Major <= 5) {

stdlib/tools/swift-reflection-test/swift-reflection-test.c

-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
// on live swift executables.
1414
//===----------------------------------------------------------------------===//
1515

16-
#define MIN(a,b) (((a)<(b))?(a):(b))
17-
#define MAX(a,b) (((a)>(b))?(a):(b))
1816
#define SECTIONS_PER_INFO 6
1917

2018
#include "swift/SwiftRemoteMirror/SwiftRemoteMirror.h"

test/Interop/SwiftToCxx/enums/small-enums-pass-return-in-cxx-execution.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
#include <cstddef>
1515
#include "enums.h"
1616

17-
#define MAX(a, b) ((a) >= (b) ? (a) : (b))
18-
1917
int main() {
2018
using namespace Enums;
2119

0 commit comments

Comments
 (0)