Reply To: MWEdit

Home Forums Projects MWEdit Reply To: MWEdit

#5330

Fixed it! For some reason, MSVC wasn’t bringing in tchar.h from common/dl_base.h. I added #include <tchar.h> to common/dl_str.h and the error went away. Looking at the new error log, it looks like _WIN32 isn’t being brought in from MSVC for whatever reason even though it’s a compiler level macro. That should be easy enough to fix: I’ll just add it to the definition list in the build script. Could be a bug in MSVC or whatever but we can easily deal with it 🙂

That said, we now have two options: add tchar.h to all the files (my preference as it makes things clear that we’re using the header) or leave it in common/dl_base.h. It should be noted that the latter option won’t work on non-Windows systems anyways even if it is in an OS level check due to this line:
#define _stricmp(string1, string2) stricmp(string1, string2)
stricmp() is a Windows extension to string.h and isn’t in the standard (there is a similar function in the C++ standard, std::strcmp(), that provides a slightly different comparison value so we can swap out the function easily enough temporarily) so we’ll need to rewrite all of the Unicode handling anyways for cross-platform support once we get there. We can leave it in for now but we’ll just have to remember that we’ll need to change things.

The complaints about the boolean types are because they’re in a _WIN32 check, which is broken for whatever reason. That said, those need to be swapped for the standard boolean keywords, bool, true, and false anyways (which are treated as type int so should be fine to swap in) for portability.

If that plan sounds good, I’ll start work on the fixes in the next few days 🙂