From: Jaakko Heinonen Date: Sat, 10 Sep 2005 07:11:11 +0000 (+0000) Subject: - mbswidth change to avoid empty translation unit warnings X-Git-Tag: upstream/0.6.1~2^2~169 X-Git-Url: https://git.deb.at/w?p=pkg%2Fabook.git;a=commitdiff_plain;h=b5e88fc2db3b9252d7680f3d6b173bac78538cf3 - mbswidth change to avoid empty translation unit warnings --- diff --git a/mbswidth.c b/mbswidth.c index a38d03e..2162205 100644 --- a/mbswidth.c +++ b/mbswidth.c @@ -24,11 +24,11 @@ # include #endif -#ifdef HANDLE_MULTIBYTE /* for abook */ - /* Specification. */ #include "mbswidth.h" +#ifdef HANDLE_MULTIBYTE /* for abook */ + /* Get MB_CUR_MAX. */ #include @@ -326,4 +326,13 @@ mbsnbytes (const char *string, size_t nbytes, int maxwidth, int flags) return maxwidth; } +#else /* HANDLE_MULTIBYTE */ + +#include +int +mbswidth (const char *string, int flags) +{ + return strlen(string); +} #endif /* HANDLE_MULTIBYTE */ + diff --git a/misc.c b/misc.c index 9a603db..90f41ac 100644 --- a/misc.c +++ b/misc.c @@ -18,9 +18,7 @@ #ifdef HAVE_CONFIG_H # include "config.h" #endif -#ifdef HANDLE_MULTIBYTE -# include -#endif +#include #include "misc.h" #include "xmalloc.h" @@ -274,11 +272,7 @@ int strwidth(const char *s) { assert(s); -#ifdef HANDLE_MULTIBYTE - return (int)mbswidth(s, 0); -#else - return strlen(s); -#endif + return mbswidth(s, 0); } int