summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--glib/glibmm/dispatcher.cc12
1 files changed, 5 insertions, 7 deletions
diff --git a/glib/glibmm/dispatcher.cc b/glib/glibmm/dispatcher.cc
index 3c8a65d0..73b69be8 100644
--- a/glib/glibmm/dispatcher.cc
+++ b/glib/glibmm/dispatcher.cc
@@ -165,8 +165,6 @@ private:
/**** Glib::DispatchNotifier ***********************************************/
-// static
-
thread_local DispatchNotifier* DispatchNotifier::thread_specific_instance_ = nullptr;
DispatchNotifier::DispatchNotifier(const Glib::RefPtr<MainContext>& context)
@@ -186,11 +184,11 @@ DispatchNotifier::DispatchNotifier(const Glib::RefPtr<MainContext>& context)
try
{
-#ifdef G_OS_WIN32
- const int fd = GPOINTER_TO_INT(fd_receiver_);
-#else
- const int fd = fd_receiver_;
-#endif
+ // PollFD::fd_t is the type of GPollFD::fd.
+ // In Windows, it has the same size as HANDLE, but it's not guaranteed to be the same type.
+ // In Unix, a file descriptor is an int.
+ const auto fd = (PollFD::fd_t)fd_receiver_;
+
// The following code is equivalent to
// context_->signal_io().connect(
// sigc::mem_fun(*this, &DispatchNotifier::pipe_io_handler), fd, Glib::IO_IN);