From: Jim Meyering Date: Mon, 24 Jul 2000 06:41:58 +0000 (+0000) Subject: (_XOPEN_SOURCE): Don't define; this causes problems on Solaris 7. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ec482f5cb9a59b3b8d5eb6263bc690983986d1ed;p=pspp (_XOPEN_SOURCE): Don't define; this causes problems on Solaris 7. (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare. --- diff --git a/lib/mbswidth.c b/lib/mbswidth.c index 9a0d3a99b1..09777c5b5e 100644 --- a/lib/mbswidth.c +++ b/lib/mbswidth.c @@ -21,11 +21,6 @@ # include #endif -/* Tell GNU libc to declare wcwidth(). */ -#ifndef _XOPEN_SOURCE -# define _XOPEN_SOURCE 500 -#endif - /* Get MB_LEN_MAX. */ #if HAVE_LIMITS_H # include @@ -62,10 +57,20 @@ # define mbsinit(ps) 1 #endif -/* If wcwidth() doesn't exist, assume all printable characters have +#ifndef HAVE_DECL_WCWIDTH +"this configure-time declaration test was not run" +#endif +#if !HAVE_DECL_WCWIDTH +int wcwidth (); +#endif + +#ifndef wcwidth +# if !HAVE_WCWIDTH +/* wcwidth doesn't exist, so assume all printable characters have width 1. */ -#if !defined wcwidth && !HAVE_WCWIDTH -# define wcwidth(wc) ((wc) == 0 ? 0 : iswprint (wc) ? 1 : -1) +# define wcwidth(wc) ((wc) == 0 ? 0 : iswprint (wc) ? 1 : -1) +# else +# endif #endif /* Get ISPRINT. */