mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-01-01 05:16:05 +01:00
40050: prepend /**/ to global functions and #ifdefs
This commit is contained in:
parent
2d87bf8dff
commit
e8699613bc
2 changed files with 39 additions and 0 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
2016-12-01 Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp>
|
||||||
|
|
||||||
|
* 40050: Src/compat.c: prepend /**/ to global functions and #ifdefs
|
||||||
|
|
||||||
2016-11-30 Peter Stephenson <p.stephenson@samsung.com>
|
2016-11-30 Peter Stephenson <p.stephenson@samsung.com>
|
||||||
|
|
||||||
* 40049: NEWS: notes on Unicode 9 (40037).
|
* 40049: NEWS: notes on Unicode 9 (40037).
|
||||||
|
|
35
Src/compat.c
35
Src/compat.c
|
@ -33,7 +33,10 @@
|
||||||
/* Return pointer to first occurence of string t *
|
/* Return pointer to first occurence of string t *
|
||||||
* in string s. Return NULL if not present. */
|
* in string s. Return NULL if not present. */
|
||||||
|
|
||||||
|
/**/
|
||||||
#ifndef HAVE_STRSTR
|
#ifndef HAVE_STRSTR
|
||||||
|
|
||||||
|
/**/
|
||||||
char *
|
char *
|
||||||
strstr(const char *s, const char *t)
|
strstr(const char *s, const char *t)
|
||||||
{
|
{
|
||||||
|
@ -48,10 +51,15 @@ strstr(const char *s, const char *t)
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**/
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/**/
|
||||||
#ifndef HAVE_GETHOSTNAME
|
#ifndef HAVE_GETHOSTNAME
|
||||||
|
|
||||||
|
/**/
|
||||||
int
|
int
|
||||||
gethostname(char *name, size_t namelen)
|
gethostname(char *name, size_t namelen)
|
||||||
{
|
{
|
||||||
|
@ -65,10 +73,15 @@ gethostname(char *name, size_t namelen)
|
||||||
strcpy(name, uts.nodename);
|
strcpy(name, uts.nodename);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**/
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/**/
|
||||||
#ifndef HAVE_GETTIMEOFDAY
|
#ifndef HAVE_GETTIMEOFDAY
|
||||||
|
|
||||||
|
/**/
|
||||||
int
|
int
|
||||||
gettimeofday(struct timeval *tv, struct timezone *tz)
|
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);
|
tv->tv_sec = (long)time((time_t) 0);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**/
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* compute the difference between two calendar times */
|
/* compute the difference between two calendar times */
|
||||||
|
|
||||||
|
/**/
|
||||||
#ifndef HAVE_DIFFTIME
|
#ifndef HAVE_DIFFTIME
|
||||||
|
|
||||||
|
/**/
|
||||||
double
|
double
|
||||||
difftime(time_t t2, time_t t1)
|
difftime(time_t t2, time_t t1)
|
||||||
{
|
{
|
||||||
return ((double)t2 - (double)t1);
|
return ((double)t2 - (double)t1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**/
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/**/
|
||||||
#ifndef HAVE_STRERROR
|
#ifndef HAVE_STRERROR
|
||||||
extern char *sys_errlist[];
|
extern char *sys_errlist[];
|
||||||
|
|
||||||
|
@ -97,11 +118,14 @@ extern char *sys_errlist[];
|
||||||
* error number, and returns a pointer to that string. *
|
* error number, and returns a pointer to that string. *
|
||||||
* This is not a particularly robust version of strerror. */
|
* This is not a particularly robust version of strerror. */
|
||||||
|
|
||||||
|
/**/
|
||||||
char *
|
char *
|
||||||
strerror(int errnum)
|
strerror(int errnum)
|
||||||
{
|
{
|
||||||
return (sys_errlist[errnum]);
|
return (sys_errlist[errnum]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**/
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -186,6 +210,7 @@ zpathmax(char *dir)
|
||||||
}
|
}
|
||||||
#endif /* 0 */
|
#endif /* 0 */
|
||||||
|
|
||||||
|
/**/
|
||||||
#ifdef HAVE_SYSCONF
|
#ifdef HAVE_SYSCONF
|
||||||
/*
|
/*
|
||||||
* This is replaced by a macro from system.h if not 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;
|
return (max_zsh_fd > openmax) ? max_zsh_fd : openmax;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**/
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -532,6 +559,7 @@ output64(zlong val)
|
||||||
/**/
|
/**/
|
||||||
#endif /* ZSH_64_BIT_TYPE */
|
#endif /* ZSH_64_BIT_TYPE */
|
||||||
|
|
||||||
|
/**/
|
||||||
#ifndef HAVE_STRTOUL
|
#ifndef HAVE_STRTOUL
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -569,6 +597,8 @@ output64(zlong val)
|
||||||
* Ignores `locale' stuff. Assumes that the upper and lower case
|
* Ignores `locale' stuff. Assumes that the upper and lower case
|
||||||
* alphabets and digits are each contiguous.
|
* alphabets and digits are each contiguous.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/**/
|
||||||
unsigned long
|
unsigned long
|
||||||
strtoul(nptr, endptr, base)
|
strtoul(nptr, endptr, base)
|
||||||
const char *nptr;
|
const char *nptr;
|
||||||
|
@ -632,11 +662,15 @@ strtoul(nptr, endptr, base)
|
||||||
*endptr = any ? s - 1 : nptr;
|
*endptr = any ? s - 1 : nptr;
|
||||||
return (acc);
|
return (acc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**/
|
||||||
#endif /* HAVE_STRTOUL */
|
#endif /* HAVE_STRTOUL */
|
||||||
|
|
||||||
/**/
|
/**/
|
||||||
#ifdef ENABLE_UNICODE9
|
#ifdef ENABLE_UNICODE9
|
||||||
#include "./wcwidth9.h"
|
#include "./wcwidth9.h"
|
||||||
|
|
||||||
|
/**/
|
||||||
int
|
int
|
||||||
mk_wcwidth(wchar_t ucs)
|
mk_wcwidth(wchar_t ucs)
|
||||||
{
|
{
|
||||||
|
@ -646,6 +680,7 @@ mk_wcwidth(wchar_t ucs)
|
||||||
return w;
|
return w;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**/
|
||||||
#elif defined(BROKEN_WCWIDTH) && (defined(__STDC_ISO_10646__) || defined(__APPLE__))
|
#elif defined(BROKEN_WCWIDTH) && (defined(__STDC_ISO_10646__) || defined(__APPLE__))
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in a new issue