[glib/wip/new-gsource: 4/8] Add 'GHandle'



commit e5f819ee57a4c86745e6eb2100e1978c544e8376
Author: Ryan Lortie <desrt desrt ca>
Date:   Mon Oct 29 18:34:18 2012 +0100

    Add 'GHandle'
    
    On Windows this is HANDLE.  On UNIX, it's an fd (int).
    
    https://bugzilla.gnome.org/show_bug.cgi?id=686853

 docs/reference/glib/glib-sections.txt |    1 +
 glib/gpoll.h                          |   13 +++++++++++++
 2 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/docs/reference/glib/glib-sections.txt b/docs/reference/glib/glib-sections.txt
index 546bc98..2ac3429 100644
--- a/docs/reference/glib/glib-sections.txt
+++ b/docs/reference/glib/glib-sections.txt
@@ -500,6 +500,7 @@ g_child_watch_add
 g_child_watch_add_full
 
 <SUBSECTION>
+GHandle
 GPollFD
 g_poll
 G_POLLFD_FORMAT
diff --git a/glib/gpoll.h b/glib/gpoll.h
index f28b758..e28bf6f 100644
--- a/glib/gpoll.h
+++ b/glib/gpoll.h
@@ -101,6 +101,19 @@ struct _GPollFD
   gushort 	revents;
 };
 
+/**
+ * ghandle:
+ *
+ * Corresponds to the type of a file handle on the current operating
+ * system.  On UNIX this is an integer (file descriptor).  On Windows,
+ * it is HANDLE.
+ **/
+#ifdef G_OS_WIN32
+typedef HANDLE GHandle;
+#else
+typedef gint GHandle;
+#endif
+
 #ifdef G_OS_WIN32
 #if GLIB_SIZEOF_VOID_P == 8
 #define G_POLLFD_FORMAT "%#I64x"



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]