This should have a Windows alternative, something like

    #ifdef _WIN32
    g_io_channel_win32_new_fd(_fileno(stdin))
    …
according to http://msdn.microsoft.com/en-us/library/zs6wbdhx.aspx and https://developer.gnome.org/glib/2.34/glib-IO-Channels.html#g-io-channel-win32-new-fd