From bf671f42fa2e91e2e5dcaf0fdc6b940ffae96845 Mon Sep 17 00:00:00 2001 From: tg Date: Sat, 9 Jun 2007 22:01:42 +0000 Subject: [PATCH] don't use __extension__, cought by sunpro on linux --- Build.sh | 4 ++-- edit.c | 21 ++++++++++----------- sh.h | 8 ++++---- 3 files changed, 16 insertions(+), 17 deletions(-) diff --git a/Build.sh b/Build.sh index 6ce3382..b43f8a4 100644 --- a/Build.sh +++ b/Build.sh @@ -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); \ diff --git a/edit.c b/edit.c index 9d41b79..f4e2b21 100644 --- a/edit.c +++ b/edit.c @@ -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,17 +758,16 @@ static void utf_ptradj(char *, char **); /* UTF-8 hack: high-level functions */ #if HAVE_EXPSTMT -#define utf_backch(c) \ - (!Flag(FUTFHACK) ? (c) - 1 : __extension__({ \ - 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; \ - })) +#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 : \ +#define utf_backch(c) (!Flag(FUTFHACK) ? (c) - 1 : \ (c) + (ptrdiff_t)(utf_backch_((u_char *)c) - ((u_char *)(c)))) static u_char *utf_backch_(u_char *); static u_char * diff --git a/sh.h b/sh.h index c6dfb19..6d08aaa 100644 --- a/sh.h +++ b/sh.h @@ -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); \