From b5e88fc2db3b9252d7680f3d6b173bac78538cf3 Mon Sep 17 00:00:00 2001 From: Jaakko Heinonen Date: Sat, 10 Sep 2005 07:11:11 +0000 Subject: [PATCH] - mbswidth change to avoid empty translation unit warnings --- mbswidth.c | 13 +++++++++++-- misc.c | 10 ++-------- 2 files changed, 13 insertions(+), 10 deletions(-) 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 -- 2.39.2