crystal-lang/crystal

Inconsistency in the definition of ULONG_PTR for Windows 32-bit

yanecc opened this issue · 2 comments

Bug Report

I have noticed an inconsistency in the definition of ULONG_PTR between the C language and Crystal in 32-bit systems.

In a 32-bit system, ULONG_PTR is supposed to be defined as unsigned long (Uint32), same with UINT_PTR

#if defined(_WIN64)
 typedef unsigned __int64 ULONG_PTR;
#else
 typedef unsigned long ULONG_PTR;
#endif

while in Crystal, it's

alias ULONG_PTR = Uint64

Hi. Your report makes sense, but Crystal never aimed or claimed to support 32-bit Windows systems, only 64-bit. Also apparently according to the news, Windows itself is about to drop support of 32-bit x86 systems in two days

The referenced binding is for the x86_64-windows-msvc target, so explicitly for 64-bit systems. Bindings for 32-bit Windows would be in a folder like lib_c/i386-windows-msvc, if Crystal would ever get support for that.