aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/xcb-util-wm/build.patch
blob: 1b72f5bf55e8f42f3f9e929872517905ee8f12b5 (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
diff --git a/ewmh/ewmh.c.m4 b/ewmh/ewmh.c.m4
index b986105f6..a0ce37c2a 100644
--- a/ewmh/ewmh.c.m4	
+++ b/ewmh/ewmh.c.m4
@@ -45,7 +45,7 @@
 
 #include <sys/types.h>
 
-#define ssizeof(foo)            (ssize_t)sizeof(foo)
+#define ssizeof(foo)            (ptrdiff_t)sizeof(foo)
 #define countof(foo)            (ssizeof(foo) / ssizeof(foo[0]))
 
 /**
@@ -1119,12 +1119,13 @@ xcb_ewmh_append_wm_icon_checked(xcb_ewmh_connection_t *ewmh,
                                 uint32_t img_len, uint32_t *img)
 {
   const uint32_t data_len = img_len + 2;
-  uint32_t data[data_len];
+  uint32_t *data = (uint32_t*)malloc(data_len*sizeof(uint32_t));
 
-  set_wm_icon_data(data, width, height, img_len, img);
-
-  return xcb_ewmh_set_wm_icon_checked(ewmh, XCB_PROP_MODE_APPEND, window,
-                                      data_len, data);
+  set_wm_icon_data(data, width, height, img_len, img);
+  const xcb_void_cookie_t res = xcb_ewmh_set_wm_icon_checked(ewmh, XCB_PROP_MODE_APPEND, window,
+                                      data_len, data);
+  free(data);
+  return res;
 }
 
 xcb_void_cookie_t
@@ -1134,12 +1135,13 @@ xcb_ewmh_append_wm_icon(xcb_ewmh_connection_t *ewmh,
                         uint32_t img_len, uint32_t *img)
 {
   const uint32_t data_len = img_len + 2;
-  uint32_t data[data_len];
-
-  set_wm_icon_data(data, width, height, img_len, img);
+  uint32_t *data = (uint32_t*)malloc(data_len*sizeof(uint32_t));
 
-  return xcb_ewmh_set_wm_icon(ewmh, XCB_PROP_MODE_APPEND, window,
-                              data_len, data);
+  set_wm_icon_data(data, width, height, img_len, img);
+  const xcb_void_cookie_t res = xcb_ewmh_set_wm_icon(ewmh, XCB_PROP_MODE_APPEND, window,
+                              data_len, data);
+  free(data);
+  return res;
 }
 
 DO_GET_PROPERTY(wm_icon, _NET_WM_ICON, XCB_ATOM_CARDINAL, UINT_MAX)