Implement long path support on Windows by applying Microsoft's
recommended application manifest.
To make this work on both Visual C++ and MinGW, include the manifest as
a resource when generating the resource files. This way it will be
embedded into the executables generated by both compilers.
It's important for the manifest resource to have ID 1, otherwise GCC
will embed a default manifest.
Note that in addition to this, the user needs to have [long paths enabled]
either by modifying the registry or by enabling a group policy.
[long paths enabled]: https://docs.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=cmd#enable-long-paths-in-windows-10-version-1607-and-later
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
As it is overridden by the definition in common.mk, instead define
YEAR, MONTH and DAY which are used there.
This macro is useful for daily build&installation by the
combination with "relative-load", for example:
```sh
$ ./configure --prefix=/. --enable-load-relative \
--with-destdir='$(HOME)/.rbenv/versions/$(RUBY_RELEASE_DATE)'
```
This can install images usable by rbenv per days.
This partially reverts commit "Windows: Improve readablity of
getenv() encoding" 14453a256d.
The `getenv` macro defined here is to also substitute the function
in dln_find.c, not only in this file.
Now we require C99, these features available of course.
* prototypes
* stdarg prototypes
* token pasting
* stringization
* string literal concatenation
* Windows: Read ENV names and values as UTF-8 encoded Strings
Implements issue #12650: fix https://bugs.ruby-lang.org/issues/12650
This also removes the special encoding for ENV['PATH'] and some
complexity in the code that is unnecessary now.
* Windows: Improve readablity of getenv() encoding
getenv() did use the expected codepage as an implicit parameter of the macro.
This is mis-leading since include/ruby/win32.h has a different definition.
Using the "cp" variable explicit (like the other function calls) makes it
more readable and consistent.
* Windows: Change external C-API macros getenv() and execv() to use UTF-8
They used to process and return strings with locale encoding,
but since all ruby-internal spawn and environment functions use UTF-8,
it makes sense to change the C-API equally.
This partially reverts commit "Windows: Improve readablity of
getenv() encoding" 14453a256d.
The `getenv` macro defined here is to also substitute the function
in dln_find.c, not only in this file.
getenv() did use the expected codepage as an implicit parameter of the macro.
This is mis-leading since include/ruby/win32.h has a different definition.
Using the "cp" variable explicit (like the other function calls) makes it
more readable and consistent.