using ThreadFunctionType = unsigned(__stdcall *)(void *);
using ITK_THREAD_RETURN_TYPE = unsigned;
Note the loss of __stdcall in ITK_THREAD_RETURN_TYPE. As a result, the following code doesn’t compile on 32-bit. It compiles on 64-bit because AFAIK __stdcall is ignored.
I have not tried to compile ITK in 32-bit mode in a long time. I am not sure anyone has. And I don’t remember whether we support it any more.
You could make a PR which adds __stdcall to ITK_THREAD_RETURN_TYPE and see whether the CI complains about it. If not, and it fixes your problem, we could merge it.