From 6e40f7315cb620fef1d96bbe56cfe24dd91e182a Mon Sep 17 00:00:00 2001 From: Eli Schwartz 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 + 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;