From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6332 invoked by alias); 30 Nov 2016 11:25:49 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 40050 Received: (qmail 6685 invoked from network); 30 Nov 2016 11:25:48 -0000 X-Qmail-Scanner-Diagnostics: from rcpt-mqugw.biglobe.ne.jp by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(133.208.100.2):SA:0(-2.9/5.0):. Processed in 1.854609 secs); 30 Nov 2016 11:25:48 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: takimoto-j@kba.biglobe.ne.jp X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at spf01.biglobe.ne.jp designates 133.208.100.2 as permitted sender) X-Biglobe-Sender: Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.6 \(1510\)) Subject: Re: [PATCH] add build-time option to use unicode9 character widths From: "Jun T." In-Reply-To: <20161129074228.60551-2-joshua@rubixconsulting.com> Date: Wed, 30 Nov 2016 19:49:39 +0900 Content-Transfer-Encoding: quoted-printable Message-Id: <41AC7B0E-EC94-4F34-BB23-5DC937C52D43@kba.biglobe.ne.jp> References: <20161129074228.60551-1-joshua@rubixconsulting.com> <20161129074228.60551-2-joshua@rubixconsulting.com> To: "zsh-workers@zsh.org" X-Mailer: Apple Mail (2.1510) X-Biglobe-Spnum: 49434 On 2016/11/29, at 16:42, Joshua Rubin = wrote: >=20 > diff --git a/Src/compat.c b/Src/compat.c > index 81afd4d..02412b3 100644 > --- a/Src/compat.c > +++ b/Src/compat.c > @@ -635,7 +635,18 @@ strtoul(nptr, endptr, base) > #endif /* HAVE_STRTOUL */ >=20 > /**/ > -#if defined(BROKEN_WCWIDTH) && (defined(__STDC_ISO_10646__) || = defined(__APPLE__)) > +#ifdef ENABLE_UNICODE9 > +#include "./wcwidth9.h" > +int > +mk_wcwidth(wchar_t ucs) > +{ (snip) > + > +#elif defined(BROKEN_WCWIDTH) && (defined(__STDC_ISO_10646__) || = defined(__APPLE__)) We need /**/ before function definition and #elif so that they are properly included into compat.syms. I've found there are many #ifdef's and (global) functions in compat.c which lack /**/. In the following patch I also added /**/ to them. diff --git a/Src/compat.c b/Src/compat.c index 02412b3..a295694 100644 --- a/Src/compat.c +++ b/Src/compat.c @@ -33,7 +33,10 @@ /* Return pointer to first occurence of string t * * in string s. Return NULL if not present. */ =20 +/**/ #ifndef HAVE_STRSTR + +/**/ char * strstr(const char *s, const char *t) { @@ -48,10 +51,15 @@ strstr(const char *s, const char *t) } return NULL; } + +/**/ #endif =20 =20 +/**/ #ifndef HAVE_GETHOSTNAME + +/**/ int gethostname(char *name, size_t namelen) { @@ -65,10 +73,15 @@ gethostname(char *name, size_t namelen) strcpy(name, uts.nodename); return 0; } + +/**/ #endif =20 =20 +/**/ #ifndef HAVE_GETTIMEOFDAY + +/**/ int gettimeofday(struct timeval *tv, struct timezone *tz) { @@ -76,20 +89,28 @@ gettimeofday(struct timeval *tv, struct timezone = *tz) tv->tv_sec =3D (long)time((time_t) 0); return 0; } + +/**/ #endif =20 =20 /* compute the difference between two calendar times */ =20 +/**/ #ifndef HAVE_DIFFTIME + +/**/ double difftime(time_t t2, time_t t1) { return ((double)t2 - (double)t1); } + +/**/ #endif =20 =20 +/**/ #ifndef HAVE_STRERROR extern char *sys_errlist[]; =20 @@ -97,11 +118,14 @@ extern char *sys_errlist[]; * error number, and returns a pointer to that string. * * This is not a particularly robust version of strerror. */ =20 +/**/ char * strerror(int errnum) { return (sys_errlist[errnum]); } + +/**/ #endif =20 =20 @@ -186,6 +210,7 @@ zpathmax(char *dir) } #endif /* 0 */ =20 +/**/ #ifdef HAVE_SYSCONF /* * This is replaced by a macro from system.h if not HAVE_SYSCONF. @@ -230,6 +255,8 @@ zopenmax(void) =20 return (max_zsh_fd > openmax) ? max_zsh_fd : openmax; } + +/**/ #endif =20 /* @@ -532,6 +559,7 @@ output64(zlong val) /**/ #endif /* ZSH_64_BIT_TYPE */ =20 +/**/ #ifndef HAVE_STRTOUL =20 /* @@ -569,6 +597,8 @@ output64(zlong val) * Ignores `locale' stuff. Assumes that the upper and lower case * alphabets and digits are each contiguous. */ + +/**/ unsigned long strtoul(nptr, endptr, base) const char *nptr; @@ -632,11 +662,15 @@ strtoul(nptr, endptr, base) *endptr =3D any ? s - 1 : nptr; return (acc); } + +/**/ #endif /* HAVE_STRTOUL */ =20 /**/ #ifdef ENABLE_UNICODE9 #include "./wcwidth9.h" + +/**/ int mk_wcwidth(wchar_t ucs) { @@ -646,6 +680,7 @@ mk_wcwidth(wchar_t ucs) return w; } =20 +/**/ #elif defined(BROKEN_WCWIDTH) && (defined(__STDC_ISO_10646__) || = defined(__APPLE__)) =20 /*