ldc/ldc-1.32.2-llvm-16.0.4-use_std_optional_api.patch

31 lines
1.4 KiB
Diff

--- ldc-1.32.2/driver/args.h.orig 2023-05-28 16:39:55.277642880 +0200
+++ ldc-1.32.2/driver/args.h 2023-05-28 16:43:17.582551616 +0200
@@ -40,8 +40,8 @@
// Executes a command line and returns its exit code.
// Optionally uses a response file to overcome cmdline length limitations.
int executeAndWait(std::vector<const char *> fullArgs,
- llvm::Optional<llvm::sys::WindowsEncodingMethod>
- responseFileEncoding = {llvm::None},
+ std::optional<llvm::sys::WindowsEncodingMethod>
+ responseFileEncoding = {std::nullopt},
std::string *errorMsg = nullptr);
} // namespace args
--- ldc-1.32.2/driver/args.cpp.orig 2023-05-28 16:43:44.700403861 +0200
+++ ldc-1.32.2/driver/args.cpp 2023-05-28 16:46:39.739443702 +0200
@@ -159,11 +159,11 @@
int executeAndWait(
std::vector<const char *> fullArgs,
- llvm::Optional<llvm::sys::WindowsEncodingMethod> responseFileEncoding,
+ std::optional<llvm::sys::WindowsEncodingMethod> responseFileEncoding,
std::string *errorMsg) {
args::ResponseFile rspFile;
- if (responseFileEncoding.hasValue() &&
- !rspFile.setup(fullArgs, responseFileEncoding.getValue())) {
+ if (responseFileEncoding.has_value() &&
+ !rspFile.setup(fullArgs, responseFileEncoding.value())) {
if (errorMsg)
*errorMsg = "could not write temporary response file";
return -1;