zsh-workers
 help / color / mirror / code / Atom feed
From: "Jun T." <takimoto-j@kba.biglobe.ne.jp>
To: "zsh-workers@zsh.org" <zsh-workers@zsh.org>
Subject: Re: [PATCH] add build-time option to use unicode9 character widths
Date: Wed, 30 Nov 2016 19:49:39 +0900	[thread overview]
Message-ID: <41AC7B0E-EC94-4F34-BB23-5DC937C52D43@kba.biglobe.ne.jp> (raw)
In-Reply-To: <20161129074228.60551-2-joshua@rubixconsulting.com>


On 2016/11/29, at 16:42, Joshua Rubin <joshua@rubixconsulting.com> wrote:
> 
> 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 */
> 
> /**/
> -#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.     */
 
+/**/
 #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
 
 
+/**/
 #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
 
 
+/**/
 #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 = (long)time((time_t) 0);
     return 0;
 }
+
+/**/
 #endif
 
 
 /* compute the difference between two calendar times */
 
+/**/
 #ifndef HAVE_DIFFTIME
+
+/**/
 double
 difftime(time_t t2, time_t t1)
 {
     return ((double)t2 - (double)t1);
 }
+
+/**/
 #endif
 
 
+/**/
 #ifndef HAVE_STRERROR
 extern char *sys_errlist[];
 
@@ -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. */
 
+/**/
 char *
 strerror(int errnum)
 {
     return (sys_errlist[errnum]);
 }
+
+/**/
 #endif
 
 
@@ -186,6 +210,7 @@ zpathmax(char *dir)
 }
 #endif /* 0 */
 
+/**/
 #ifdef HAVE_SYSCONF
 /*
  * This is replaced by a macro from system.h if not HAVE_SYSCONF.
@@ -230,6 +255,8 @@ zopenmax(void)
 
     return (max_zsh_fd > openmax) ? max_zsh_fd : openmax;
 }
+
+/**/
 #endif
 
 /*
@@ -532,6 +559,7 @@ output64(zlong val)
 /**/
 #endif /* ZSH_64_BIT_TYPE */
 
+/**/
 #ifndef HAVE_STRTOUL
 
 /*
@@ -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 = any ? s - 1 : nptr;
 	return (acc);
 }
+
+/**/
 #endif /* HAVE_STRTOUL */
 
 /**/
 #ifdef ENABLE_UNICODE9
 #include "./wcwidth9.h"
+
+/**/
 int
 mk_wcwidth(wchar_t ucs)
 {
@@ -646,6 +680,7 @@ mk_wcwidth(wchar_t ucs)
   return w;
 }
 
+/**/
 #elif defined(BROKEN_WCWIDTH) && (defined(__STDC_ISO_10646__) || defined(__APPLE__))
 
 /*




  reply	other threads:[~2016-11-30 11:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20161129080722epcas3p3b988ea1997082b500e96febcab712655@epcas3p3.samsung.com>
2016-11-29  7:42 ` Joshua Rubin
2016-11-29  7:42   ` Joshua Rubin
2016-11-30 10:49     ` Jun T. [this message]
2016-11-29 17:21   ` Peter Stephenson
2016-11-29 19:53     ` Bart Schaefer
2016-11-30  9:49       ` Peter Stephenson
2016-11-30  9:53         ` Mikael Magnusson
2016-11-30 10:27           ` Peter Stephenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=41AC7B0E-EC94-4F34-BB23-5DC937C52D43@kba.biglobe.ne.jp \
    --to=takimoto-j@kba.biglobe.ne.jp \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).