summaryrefslogtreecommitdiff
path: root/app-text/llpp/files/llpp-30-keysym.patch
blob: b1527e1856f151961fb6a42a0027524512506b99 (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
53
54
55
From 6e40f7315cb620fef1d96bbe56cfe24dd91e182a Mon Sep 17 00:00:00 2001
From: Eli Schwartz <eschwartz93@gmail.com>
Date: Tue, 5 Jun 2018 11:56:06 -0400
Subject: [PATCH] Do not use CPPFLAGS to add headers to source files

Source code, e.g. #include, belongs in the source code, not the build
system. Build systems are for defining include paths, not the includes
themselves.

Drop the KeySym keyword since it seems to be a useless alias for
uint32_t which might as well be used directly instead of indirectly
using #define everywhere.
---
 link.c               | 4 ++--
 wsi/x11/keysym2ucs.c | 4 +++-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/link.c b/link.c
index 783b12f..e8dcac3 100644
--- a/link.c
+++ b/link.c
@@ -3437,9 +3437,9 @@ CAMLprim value ml_keysymtoutf8 (value keysym_v)
 {
     CAMLparam1 (keysym_v);
     CAMLlocal1 (str_v);
-    KeySym keysym = Int_val (keysym_v);
+    uint32_t keysym = Int_val (keysym_v);
     Rune rune;
-    extern long keysym2ucs (KeySym);
+    extern long keysym2ucs (uint32_t);
     int len;
     char buf[5];
 
diff --git a/wsi/x11/keysym2ucs.c b/wsi/x11/keysym2ucs.c
index 38f9f1f..0f907c2 100644
--- a/wsi/x11/keysym2ucs.c
+++ b/wsi/x11/keysym2ucs.c
@@ -37,6 +37,8 @@
  * AUTOMATICALLY GENERATED FILE, DO NOT EDIT !!! (unicode/convmap.pl)
  */
 
+#include <inttypes.h>
+
 struct codepair {
   unsigned short keysym;
   unsigned short ucs;
@@ -816,7 +818,7 @@ struct codepair {
   { 0x20ac, 0x20ac }, /*                    EuroSign € EURO SIGN */
 };
 
-long keysym2ucs(KeySym keysym)
+long keysym2ucs(uint32_t keysym)
 {
     int min = 0;
     int max = sizeof(keysymtab) / sizeof(struct codepair) - 1;