Skip to content

Commit d35af38

Browse files
authored
Merge pull request swiftlang#75721 from hyp/eng/75691
[windows] split out complex module from ucrt module, to allow new swi…
2 parents a07caa8 + cecd4c0 commit d35af38

File tree

4 files changed

+20
-11
lines changed

4 files changed

+20
-11
lines changed

stdlib/public/Platform/ucrt.modulemap

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,13 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13+
module _complex [system] {
14+
header "complex.h"
15+
export *
16+
}
17+
1318
module ucrt [system] {
1419
module C {
15-
module complex {
16-
/* disallow the header in C++ mode as it forwards to `ccomplex`. */
17-
requires !cplusplus
18-
19-
header "complex.h"
20-
export *
21-
}
22-
2320
module ctype {
2421
header "ctype.h"
2522
export *

stdlib/public/Platform/ucrt.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
@_exported import ucrt // Clang module
14+
// Extra clang module that's split out from ucrt:
15+
@_exported import _complex
1416

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

test/Interop/Cxx/stdlib/foundation-and-std-module.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,12 @@
33
// RUN: %target-swift-frontend %s -c -enable-experimental-cxx-interop -Xcc -std=c++17 -Xcc -fmodules-cache-path=%t
44
// RUN: %target-swift-frontend %s -c -enable-experimental-cxx-interop -Xcc -std=c++20 -Xcc -fmodules-cache-path=%t
55

6-
// RUN: find %t | %FileCheck %s
7-
86
// RUN: %empty-directory(%t)
97

108
// RUN: %target-swift-frontend %s -c -enable-experimental-cxx-interop -Xcc -std=c++17 -Xcc -fmodules-cache-path=%t -DADD_CXXSTDLIB
119
// RUN: %target-swift-frontend %s -c -enable-experimental-cxx-interop -Xcc -std=c++20 -Xcc -fmodules-cache-path=%t -DADD_CXXSTDLIB
1210

13-
// REQUIRES: OS=macosx || OS=linux-gnu
11+
// RUN: %{python} -c "import os, glob; print('\n'.join(glob.glob(os.path.join('%/t', '**', '*.pcm'), recursive=True)))" | %FileCheck %s
1412

1513
#if canImport(Foundation)
1614
import Foundation

test/stdlib/CRTWinAPIs.swift

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// RUN: %target-typecheck-verify-swift
2+
// REQUIRES: OS=windows-msvc
3+
4+
// This file has CRT-specific C stdlib tests, that use
5+
// some APIs present only in CRT.
6+
7+
import CRT
8+
9+
func complexFunctionsAvailableInSwift() {
10+
let complexValue = _Cbuild(1.0, 2.0) // Construct a complex double using MSVC-specific API.
11+
let _ = creal(complexValue)
12+
}

0 commit comments

Comments
 (0)