isle icon indicating copy to clipboard operation
isle copied to clipboard

Calls to A variants should be agnostic instead

Open AJenbo opened this issue 8 months ago • 0 comments

I see lots of calls that are point to the ASCII variant of WinAPI methods, in the actual source they would likely have been for the generic version, the Windows headers have defines that will pick either the Unicode or ASCII variant at build time depending on the target. Cleaning this up will:

  • likely make it closer to the original
  • make it more portable
  • easier to implement a substitution

See for an example: https://github.com/isledecomp/isle/blob/fff2021bb552de98630670c538062dd98565d4d3/LEGO1/lego/legoomni/src/video/legovideomanager.cpp#L401

This is roughly what the windows header that sorts this out looks like, meaning that you can't tell from the compiled binary if the source had CreateFontA or CreateFont:

#ifdef WIN_NT
#define CreateFont CreateFontW
#else
#define CreateFont CreateFontA
#endif

AJenbo avatar May 11 '25 00:05 AJenbo