From bc145658bdaeaeea0cdbd719e2756f09a2dbfb48 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sun, 27 May 2012 10:45:57 -0400 Subject: [PATCH] Warn if no Unicode functions implementation is found --- src/hb-unicode-private.hh | 1 + src/hb-warning.cc | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/src/hb-unicode-private.hh b/src/hb-unicode-private.hh index c06dfe5fd..519fa0ba8 100644 --- a/src/hb-unicode-private.hh +++ b/src/hb-unicode-private.hh @@ -97,6 +97,7 @@ extern HB_INTERNAL hb_unicode_funcs_t _hb_glib_unicode_funcs; extern HB_INTERNAL hb_unicode_funcs_t _hb_icu_unicode_funcs; #define _hb_unicode_funcs_default _hb_icu_unicode_funcs #else +#define HB_UNICODE_FUNCS_NIL 1 extern HB_INTERNAL hb_unicode_funcs_t _hb_unicode_funcs_nil; #define _hb_unicode_funcs_default _hb_unicode_funcs_nil #endif diff --git a/src/hb-warning.cc b/src/hb-warning.cc index 6b5585fff..c13731b86 100644 --- a/src/hb-warning.cc +++ b/src/hb-warning.cc @@ -51,3 +51,16 @@ #warning "To suppress these warnings, define HB_NO_MT" #endif #endif + + +#include "hb-unicode-private.hh" + +#if !defined(HB_NO_UNICODE_FUNCS) && defined(HB_UNICODE_FUNCS_NIL) +#ifdef _MSC_VER +#pragma message("Could not find any Unicode functions implementation, you have to provide your own") +#pragma message("To suppress this warnings, define HB_NO_UNICODE_FUNCS") +#else +#warning "Could not find any Unicode functions implementation, you have to provide your own" +#warning "To suppress this warning, define HB_NO_UNICODE_FUNCS" +#endif +#endif