Files
swift-mirror/stdlib/public/Concurrency/CFExecutor.cpp
Justice Adams d454771ee2 [CMAKE] Fix layering issue between Concurrency and Darwin overlay (#82973)
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
2025-07-23 16:04:14 -07:00

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);
}