don't use __extension__, cought by sunpro on linux

This commit is contained in:
tg 2007-06-09 22:01:42 +00:00
parent 40484a2f21
commit bf671f42fa
3 changed files with 16 additions and 17 deletions

View File

@ -1,5 +1,5 @@
#!/bin/sh
# $MirOS: src/bin/mksh/Build.sh,v 1.209 2007/06/06 23:25:28 tg Exp $
# $MirOS: src/bin/mksh/Build.sh,v 1.210 2007/06/09 22:01:40 tg Exp $
#-
# Environment used: CC CFLAGS CPPFLAGS LDFLAGS LIBS NOWARN NROFF TARGET_OS
# CPPFLAGS recognised: MKSH_SMALL MKSH_ASSUME_UTF8 MKSH_NEED_MKNOD MKSH_NOPWNAM
@ -413,7 +413,7 @@ elif test $ct = sunpro; then
ac_flags 1 xc99 "-xc99"
fi
ac_test expstmt '' "if the compiler supports statements as expressions" <<-'EOF'
#define ksh_isspace(c) __extension__({ \
#define ksh_isspace(c) ({ \
unsigned ksh_isspace_c = (c); \
(ksh_isspace_c >= 0x09 && ksh_isspace_c <= 0x0D) || \
(ksh_isspace_c == 0x20); \

7
edit.c
View File

@ -5,7 +5,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/edit.c,v 1.101 2007/06/06 23:28:13 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/edit.c,v 1.102 2007/06/09 22:01:41 tg Exp $");
/* tty driver characters we are interested in */
typedef struct {
@ -758,15 +758,14 @@ static void utf_ptradj(char *, char **);
/* UTF-8 hack: high-level functions */
#if HAVE_EXPSTMT
#define utf_backch(c) \
(!Flag(FUTFHACK) ? (c) - 1 : __extension__({ \
#define utf_backch(c) (!Flag(FUTFHACK) ? (c) - 1 : ({ \
u_char *utf_backch_cp = (u_char *)(c); \
--utf_backch_cp; \
while ((*utf_backch_cp >= 0x80) && \
(*utf_backch_cp < 0xC0)) \
--utf_backch_cp; \
(__typeof__ (c))utf_backch_cp; \
}))
}))
#else
#define utf_backch(c) (!Flag(FUTFHACK) ? (c) - 1 : \
(c) + (ptrdiff_t)(utf_backch_((u_char *)c) - ((u_char *)(c))))

8
sh.h
View File

@ -8,7 +8,7 @@
/* $OpenBSD: c_test.h,v 1.4 2004/12/20 11:34:26 otto Exp $ */
/* $OpenBSD: tty.h,v 1.5 2004/12/20 11:34:26 otto Exp $ */
#define MKSH_SH_H_ID "$MirOS: src/bin/mksh/sh.h,v 1.144 2007/06/09 21:59:21 tg Exp $"
#define MKSH_SH_H_ID "$MirOS: src/bin/mksh/sh.h,v 1.145 2007/06/09 22:01:42 tg Exp $"
#define MKSH_VERSION "R29 2007/06/06"
#if HAVE_SYS_PARAM_H
@ -148,7 +148,7 @@ typedef int bool;
#if HAVE_EXPSTMT
/* this macro must not evaluate its arguments several times */
#define ksh_isspace(c) __extension__({ \
#define ksh_isspace(c) ({ \
unsigned ksh_isspace_c = (c); \
(ksh_isspace_c >= 0x09 && ksh_isspace_c <= 0x0D) || \
(ksh_isspace_c == 0x20); \
@ -275,14 +275,14 @@ char *ucstrchr(char *, int);
char *ucstrstr(char *, const char *);
#define strchr ucstrchr
#define strstr ucstrstr
#define cstrchr(s,c) __extension__({ \
#define cstrchr(s,c) ({ \
union mksh_cchack in, out; \
\
in.ro = (s); \
out.rw = ucstrchr(in.rw, (c)); \
(out.ro); \
})
#define cstrstr(b,l) __extension__({ \
#define cstrstr(b,l) ({ \
union mksh_cchack in, out; \
\
in.ro = (b); \