1. Changed the Win32 code to use _O_U8TEXT()
2. Reordered system #includes
3. Changed a number of 'std::wcout << ...' to use util::stream_format()
I'm getting massive code compilation issues, and it isn't clear to me what the problem is. I'm committing my WIP right now, with the intention of reviewing the specifics soon.
I really don't like the prevalence of '#ifdef WIN32' in this change, both the _setmode() and bypassing codecvt. I strongly suspect that the latter is the consequence of some mistake that in practice doesn't cause problems in MSVC. I welcome all eyes.
Use standard uint64_t, uint32_t, uint16_t or uint8_t instead of UINT64, UINT32, UINT16 or UINT8
also use standard int64_t, int32_t, int16_t or int8_t instead of INT64, INT32, INT16 or INT8
Still a bit of work to do, most notably around adoption of std::unique_ptr<>, which may be a challenge here on account of some assumptions regarding lifetime of streams by modules.
This also eliminated the need for get_sector_size
The asute reviewer will note that a side effect of this change is that in scenarios where we once returned IMGTOOLERR_OUTOFMEMORY, we now throw std::bad_alloc. This is deliberate. Having an error code for out of memory conditions no longer makes sense with MAME's embrace of the C++ way of doing things. It is highly likely that I will follow up this change with one that eliminates IMGTOOLERR_OUTOFMEMORY in favor of throwing std::bad_alloc.
This commit also fixes a recent regression in which we passed nullptr to an std::string ctor
The main point of this change is to C++-ify option_guide. It was changed from a struct array to a class, namespaced etc, with the ultimate hope of incorporating an in-emulation image creation UI.
Imgtool got hit with a number of changes; I'll probably have to bring that off of the backburner and touch that up too