Erhm... looks like it is the.. eer... Ruby macro that is causing the problem? I've tried another conversion in hope that it works.
This code is too dangerous, you have to fix it. Basically, you reinterpret_cast to unsigned int a type that you know nothing about -- and might no be the same size. sf::Window::getSystemHandle() usually returns a long or a pointer, so there's a chance that its size is 8 bytes on 64-bits architectures, whereas unsigned int will most likely be stuck at 4 bytes.
A correct code would:
-
static_cast<unsigned int>(reinterpret_cast<uintptr_t>(handle)) for pointers
-
static_cast<unsigned int>(handle) for numeric types
You can use overloads and templates to handle both cases without having to worry about the type returned by getSystemHandle().
By the way, uintptr_t is not standard, but it is the only numeric type which can safely replace a pointer type