Unfortunately when building with LLVM < 15, we're using C++-11,
so the std::optional bits are only available in C++-17.
Even more unfortunately we can't really override this, rather
inherit the fact of using C++-17 when using LLVM > 16.
Thus, we add a slightly messy conditional compilation situation
to allow usage of LDC on older LLVM versions, and with newer
LLVM/libcxx.
Signed-off-by: Ikey Doherty <ikey@serpentos.com>
And use the wide API for pure is-env-variable-set checks too, as the
first call to a narrow env API function would lead to the C runtime
preparing and maintaining both narrow and wide environments.
only)
This makes _d_wrun_main (cherry-picked from dlang/druntime#2701) use the
provided args directly instead of the process's real arguments (on
Windows) - if the host D compiler supports it.
E.g., this is required when passing --DRT-* options from a response file
to _d_wrun_main.
As a major change, the encoding of the Windows cmdline arguments is
switched from the current codepage to UTF-8.
Note that the MinGW-based libs currently only provide narrow CRT entry
points.