mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Concurrency from the Core project is importing the Darwin platform overlay, which in turn depends on SwiftCore from the Core project, breaking the project layering. Concurrency only needs the Clang module, but Swift does not have a mechanism to only import a clang module. For now import the functionality needed from Darwin by importing and wrapping the associated functions from `<dlfcn.h>` within `CFExecutor.cpp` Also remove Darwin import from `AsyncStreamBuffer.swift` because it is not used
26 lines
850 B
C++
26 lines
850 B
C++
//===--- CFExecutor.cpp ----------------------------===//
|
|
//
|
|
// This source file is part of the Swift.org open source project
|
|
//
|
|
// Copyright (c) 2014 - 2025 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
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
#include "swift/Runtime/Concurrency.h"
|
|
#include <dlfcn.h>
|
|
|
|
using namespace swift;
|
|
|
|
SWIFT_CC(swift)
|
|
extern "C" void * _swift_concurrency_dlopen_noload(const char * __path) {
|
|
return dlopen( __path, RTLD_NOLOAD);
|
|
}
|
|
|
|
SWIFT_CC(swift)
|
|
extern "C" void * _swift_concurrency_dlsym(void * __handle, const char * __symbol) {
|
|
return dlsym(__handle, __symbol);
|
|
}
|