Convert g_win32_gdi.c to C++