summaryrefslogtreecommitdiff
path: root/glib/src/glib_enums.defs.patch
blob: feac2c2ad94debf50bf1512a31a5a24d1b7956c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
--- glib_enums.defs	2012-02-28 12:17:21.000000000 -0500
+++ glib_enums.defs.new	2012-02-28 12:00:52.000000000 -0500
@@ -386,16 +386,24 @@
 ;;   G_IO_NVAL	GLIB_SYSDEF_POLLNVAL
 ;; } GIOCondition;
 
+;; We hand-edit these to use the actual enum values,
+;; because the values are actually defines that contain a =,
+;; which is very bizarre.
+;; We would need to include the header anyway,
+;; because we can't just use numeric values.
+;; If you regenerate this .defs file and forget to make this change
+;; then you will see compiler errors like this:
+;; ../glibmm/iochannel.h:154:12: error: expected primary-expression before '=' token
 (define-flags-extended IOCondition
   (in-module "G")
   (c-name "GIOCondition")
   (values
-    '("in" "G_IO_IN" "GLIB_SYSDEF_POLLIN")
-    '("out" "G_IO_OUT" "GLIB_SYSDEF_POLLOUT")
-    '("pri" "G_IO_PRI" "GLIB_SYSDEF_POLLPRI")
-    '("err" "G_IO_ERR" "GLIB_SYSDEF_POLLERR")
-    '("hup" "G_IO_HUP" "GLIB_SYSDEF_POLLHUP")
-    '("nval" "G_IO_NVAL" "GLIB_SYSDEF_POLLNVAL")
+    '("in" "G_IO_IN" "G_IO_IN")
+    '("out" "G_IO_OUT" "G_IO_OUT")
+    '("pri" "G_IO_PRI" "G_IO_PRI")
+    '("err" "G_IO_ERR" "G_IO_ERR")
+    '("hup" "G_IO_HUP" "G_IO_HUP")
+    '("nval" "G_IO_NVAL" "G_IO_NVAL")
   )
 )
 
@@ -411,6 +419,10 @@
 ;;   G_IO_FLAG_GET_MASK = G_IO_FLAG_MASK,
 ;;   G_IO_FLAG_SET_MASK = G_IO_FLAG_APPEND | G_IO_FLAG_NONBLOCK
 ;; } GIOFlags;
+;; Note that we add is-writeable in glibmm to preserve API.
+;; They do that with a #define in glib, though an enum would have been OK:
+;; See http://git.gnome.org/browse/glib/commit/glib/giochannel.h?id=0d1a2eb4bfcd733e0c015c76fb0ca0308b8a61f0
+;; and https://bugzilla.gnome.org/show_bug.cgi?id=657045#c6
 
 (define-flags-extended IOFlags
   (in-module "G")
@@ -419,6 +431,7 @@
     '("append" "G_IO_FLAG_APPEND" "1 << 0")
     '("nonblock" "G_IO_FLAG_NONBLOCK" "1 << 1")
     '("is-readable" "G_IO_FLAG_IS_READABLE" "1 << 2")
+    '("is-writeable" "G_IO_FLAG_IS_WRITEABLE" "1 << 3")
     '("is-writable" "G_IO_FLAG_IS_WRITABLE" "1 << 3")
     '("is-seekable" "G_IO_FLAG_IS_SEEKABLE" "1 << 4")
     '("mask" "G_IO_FLAG_MASK" "(1 << 5) - 1")