diff options
author | defanor <defanor@uberspace.net> | 2021-09-19 22:58:59 +0300 |
---|---|---|
committer | defanor <defanor@uberspace.net> | 2021-09-19 23:03:16 +0300 |
commit | 859b5e90c3c99ce5adcc6cb4a296dde3a97000c9 (patch) | |
tree | 41c95e87d43992d93c13a1c7745a4470372cb18b /src | |
parent | c84f9e76d8e93c37b974c0fc64a6afdf432595cc (diff) |
Allow to build without ICU (and JID checks)
Diffstat (limited to 'src')
-rw-r--r-- | src/rexmpp_jid.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/rexmpp_jid.c b/src/rexmpp_jid.c index ee7b326..659df3e 100644 --- a/src/rexmpp_jid.c +++ b/src/rexmpp_jid.c @@ -9,9 +9,11 @@ #include <stddef.h> #include <string.h> #include <stdio.h> +#ifdef HAVE_ICU #include <unicode/ustring.h> #include <unicode/uset.h> #include <unicode/uspoof.h> +#endif #include "rexmpp_jid.h" int rexmpp_jid_parse (const char *str, struct rexmpp_jid *jid) { @@ -71,6 +73,7 @@ int rexmpp_jid_parse (const char *str, struct rexmpp_jid *jid) { /* <https://tools.ietf.org/html/rfc7622#section-3>, <https://tools.ietf.org/html/rfc8265#section-3.3> */ int rexmpp_jid_check (struct rexmpp_jid *jid) { +#ifdef HAVE_ICU UErrorCode err = U_ZERO_ERROR; UChar local[1023], domain[1023], resource[1023]; int32_t local_len = 0, domain_len = 0, resource_len = 0; @@ -173,6 +176,8 @@ int rexmpp_jid_check (struct rexmpp_jid *jid) { /* TODO: normalization, unorm2_normalize */ /* TODO: directionality */ - +#else + (void)jid; +#endif return 1; } |