This regression has arisen in the interval between my last commit on WSL master, and current HEAD on WSL 4.0-dev.
setup.cpp is a C++ source component for mingw-get-setup.exe; when I attempt to compile it today, after updating my headers to 4.0-dev HEAD, I see:
setup.cpp: In function `bool mkdir_default(wchar_t*)':
setup.cpp:540: error: `_wmkdir' was not declared in this scope
setup.cpp: In function `void rmdir_default(const wchar_t*, const wchar_t*)':
setup.cpp:565: error: `_wrmdir' was not declared in this scope
According to:
http://msdn.microsoft.com/en-us/library/2fkk4dzw.aspx
_wmkdir should be prototyped when either direct.h or wchar.h is included.
Likewise, according to:
http://msdn.microsoft.com/en-us/library/wt8es881.aspx
_wrmdir should be prototyped when either of this same pair of headers is included.
setup.cpp includes wchar.h; it does not include direct.h; (the regression is masked, if I do also include direct.h, so it appears to arise explicitly in wchar.h).
Yep; wchar.h looks well and truly hosed. There's an unclosed C style comment on line 451, but closing that exposes an #endif without matching #if error at line 653. That's not where the error really lies; it's just the last line in the file, which happens to be an #endif line, and there are too many #endifs preceding it.
On line 230, there's an #endif which proclaims that it closes a _WTIME_DEFINED block, (presumably beginning with the #ifndef _WTIME_DEFINED on line 189); it actually closes the #ifndef RC_INVOKED block starting at line 60. Block nesting between lines 208 and 230 looks especially suspect, but the whole caboodle is in such a mess that I've no idea where to even begin trying to fix it.
I believe I've found the block nesting error, but I need to do some more testing to be certain. Some more recent commits seem to have compounded the breakage, and I'm also seeing evidence of malformation in stat.h.
Both the unterminated comment and the mis-appropriated #endif should be resolved in the 4.0-dev branch. I remember finding these and fixing them.
https://sourceforge.net/p/mingw/mingw-org-wsl/ci/4.0-dev/tree/include/wchar.h
The stat.h file has a misplaced extern "C"{ opening block that will be resolved soon.
With recent changes in my working directory I've no trouble building the following code.
After making adjustments, as I've noted on [#1973], this is no longer a problem for me either. However, this isn't the end of the saga; those same adjustments have simply served to expose another fatal inconsistency between wchar.h and sys/stat.h, which I think will be better discussed in the context of [#1973].
Related
Issues: #1973
I'm attaching the patches against 4.0-dev that I have in my current working directory. Some of the changes allowed GCC to tell me where the problem was. Some of the changes allowed my IDE to give me better information. I'm currently using NetBeans just for THOI. With these changes I was able to build the example above.
And I'm able to build this
But, as my follow up on [#1973] shows, that isn't sufficient to expose the deeper issues.
Related
Issues: #1973
This should be resolved in the current 4.0-dev branch.