On Thu, Jan 13, 2022 at 04:44:23PM +0100, Frederik Seiffert wrote: > Hi all, > > I was wondering: does anyone know of a reason why GSNativeChar is defined as > uint16_t instead of wchar_t in GSConfig.h on Windows? > > While they are probably technically the same (both are 16 bit on Windows), > the latter would avoid a bunch of warnings / avoid having to cast when > passing paths to Windows system APIs that expect wchar_t. This also applies > to client code as this type is returned by NSString fileSystemRepresentation.
>From the general C perspective, if a cast is necessary to silence a warning, >then wchar_t must have a different underlying type of that of uint16_t, as >typedef is a type alias, not a new type definition. Which suggests that the wchar_t is possibly a signed 16 bit int, or of a different size (irrespective of signedness). Mind, the MS compiler could be playing special games with the type. DF
