gsass1 / NTop

💻 htop-like system-monitor for Windows with Vi-keybindings.
GNU General Public License v3.0
1.21k stars 69 forks source link

Fix Unicode build #58

Closed fghzxm closed 11 months ago

fghzxm commented 11 months ago

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.

gsass1 commented 11 months ago

Thanks!!