This patch makes a number of code changes to make Unicode build actually work (instead of crashing). This involves using the _t-family of CRT string routines and using the _T() macro to wrap char and string literals wherever Unicode needs to be handled.
Some macros are also added to util.h that perform explicit zero-extending operations on character types; this is to defend against build setups whose compiler (possibly through a command line switch) treats char and/or wchar_t as signed, therefore performs sign-extension when a char is implicitly converted to an int or a wchar_t.
Care has been taken to ensure Unicode build of the program doesn't do things differently from the ASCII/MBCS build; in particular config file operations remain ASCII-based as they are today.
This patch makes a number of code changes to make Unicode build actually work (instead of crashing). This involves using the
_t
-family of CRT string routines and using the_T()
macro to wrap char and string literals wherever Unicode needs to be handled.Some macros are also added to util.h that perform explicit zero-extending operations on character types; this is to defend against build setups whose compiler (possibly through a command line switch) treats
char
and/orwchar_t
as signed, therefore performs sign-extension when achar
is implicitly converted to anint
or awchar_t
.Care has been taken to ensure Unicode build of the program doesn't do things differently from the ASCII/MBCS build; in particular config file operations remain ASCII-based as they are today.