File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Sources/_TestingInternals Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 11//
22// This source file is part of the Swift.org open source project
33//
4- // Copyright (c) 2024 Apple Inc. and the Swift project authors
4+ // Copyright (c) 2025 Apple Inc. and the Swift project authors
55// Licensed under Apache License v2.0 with Runtime Library Exception
66//
77// See https://swift.org/LICENSE.txt for license information
1313#include < atomic>
1414
1515#if defined(__OpenBSD__)
16- static std::atomic<const char *> earlyCWD { nullptr };
16+ // / Storage for ``swt_getEarlyCWD()``.
17+ static constinit std::atomic<const char *> earlyCWD { nullptr };
1718
1819// / At process start (before `main()` is called), capture the current working
1920// / directory.
@@ -22,7 +23,7 @@ static std::atomic<const char *> earlyCWD { nullptr };
2223// / possible) resolve the executable path when the first argument is a relative
2324// / path (which can occur when manually invoking the test executable.)
2425__attribute__ ((__constructor__(101 ), __used__))
25- static void swt_captureEarlyCWD (void ) {
26+ static void captureEarlyCWD (void ) {
2627 static char buffer[PATH_MAX * 2 ];
2728 if (getcwd (buffer, sizeof (buffer))) {
2829 earlyCWD.store (buffer);
You can’t perform that action at this time.
0 commit comments