This commit erases all usages of std::wstring from the face of the project and reduces wchar_t usages to the necessary minimum, mostly for interoperability with WinAPI functions. UTF-8 encoded std::strings are used in place of std::wstring objects, and code which must operate on actual characters instead of the bytes which might represent a character has been modified in order to work properly - mostly the subtitle renderer and reader classes.
The POSIX compatibility layer provided by the Microsoft C Runtime Library
treats its string arguments as if they were passed to the A-family of WinAPI
functions, which means that they undergo conversion to the ACP before being
passed to the actual WinAPI call. Passing UTF-8 encoded strings could have
never really worked.
This commit uses "wide" (i.e. UTF-16) commandline arguments when launching the
program on Windows, and uses the "wide" Windows APIs when dealing with strings.
This makes it independent from the currently selected active code page on the
system, and hopefully fixes issues with "nonstandard" characters appearing in
file and directory paths.
Fixes#172.
The repository now contains a clang-format file which should be used when committing new code. Additionally, a new workflow job is added which checks the conformance of source files to the specified formatting rules.
Fixes#47.
TerminatableThread is now implemented by using std::thread. The terminate()
function provided by the base class was actually not used anywhere, and was
removed along with the base class itself.
As a bonus, the completely unused files common_win32.{cpp,h} are also removed.
Precompiled headers aren't actually used by any of the compilers, so leaving
this header in the repo doesn't make much sense.
However, removing it revealed some places in the code which rely on windows.h
being included on WIN32, which was probably included via the tchar.h include.
These places have been fixed to explicitly include windows.h.
Currently can build tsmuxer CLI and libmediation in native 64-bit
on Linux. Windows, Mac, and 32-bit untested (32-bit is mostly
a function of the user's CXX_FLAGS settings anyway).
As a consequence of trying to get it to build the correct files,
the textSubtitleRender{FT|Win32}.* files had to be moved to an
osdep/ subdirectory. Some #include cases were also fixed to
point to the correct headers and directories in the source
tree or elsewhere.
Install rules need to be fleshed out for static/shared libs and
headers for libmediation, uninstall rules need to be added.
tsMuxerGUI needs to be hooked in as well.