move some portability stuff required only for setmode.c into that

(XXX we somehow do need a sorta libbsd…)
This commit is contained in:
tg
2008-04-06 23:27:19 +00:00
parent 5adfcdbd83
commit afaa3ffa59
2 changed files with 10 additions and 6 deletions

View File

@@ -1,4 +1,4 @@
/** $MirOS: src/bin/mksh/setmode.c,v 1.9 2007/10/25 15:23:10 tg Exp $ */ /** $MirOS: src/bin/mksh/setmode.c,v 1.10 2008/04/06 23:27:19 tg Exp $ */
/** $miros: src/lib/libc/gen/setmode.c,v 1.9 2007/10/25 15:13:39 tg Exp $ */ /** $miros: src/lib/libc/gen/setmode.c,v 1.9 2007/10/25 15:13:39 tg Exp $ */
/* $OpenBSD: setmode.c,v 1.17 2005/08/08 08:05:34 espie Exp $ */ /* $OpenBSD: setmode.c,v 1.17 2005/08/08 08:05:34 espie Exp $ */
/* $NetBSD: setmode.c,v 1.15 1997/02/07 22:21:06 christos Exp $ */ /* $NetBSD: setmode.c,v 1.15 1997/02/07 22:21:06 christos Exp $ */
@@ -58,7 +58,8 @@
#endif #endif
__SCCSID("@(#)setmode.c 8.2 (Berkeley) 3/25/94"); __SCCSID("@(#)setmode.c 8.2 (Berkeley) 3/25/94");
__RCSID("$MirOS: src/bin/mksh/setmode.c,v 1.9 2007/10/25 15:23:10 tg Exp $"); __RCSID("$MirOS: src/bin/mksh/setmode.c,v 1.10 2008/04/06 23:27:19 tg Exp $");
__RCSID("$miros: src/lib/libc/gen/setmode.c,v 1.9 2007/10/25 15:13:39 tg Exp $");
/* for mksh */ /* for mksh */
#ifdef ksh_isdigit #ifdef ksh_isdigit
@@ -66,6 +67,12 @@ __RCSID("$MirOS: src/bin/mksh/setmode.c,v 1.9 2007/10/25 15:23:10 tg Exp $");
#define isdigit ksh_isdigit #define isdigit ksh_isdigit
#endif #endif
/* for portability */
#ifndef S_ISTXT
#define S_ISTXT 0001000
#endif
#define SET_LEN 6 /* initial # of bitcmd struct to malloc */ #define SET_LEN 6 /* initial # of bitcmd struct to malloc */
#define SET_LEN_INCR 4 /* # of bitcmd structs to add as needed */ #define SET_LEN_INCR 4 /* # of bitcmd structs to add as needed */

5
sh.h
View File

@@ -8,7 +8,7 @@
/* $OpenBSD: c_test.h,v 1.4 2004/12/20 11:34:26 otto Exp $ */ /* $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 $ */ /* $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.202 2008/04/02 16:55:06 tg Exp $" #define MKSH_SH_H_ID "$MirOS: src/bin/mksh/sh.h,v 1.203 2008/04/06 23:27:19 tg Exp $"
#define MKSH_VERSION "R33 2008/04/01" #define MKSH_VERSION "R33 2008/04/01"
#if HAVE_SYS_PARAM_H #if HAVE_SYS_PARAM_H
@@ -164,9 +164,6 @@ typedef int bool;
#define ksh_isspace(c) ksh_isspace_((unsigned)(c)) #define ksh_isspace(c) ksh_isspace_((unsigned)(c))
#endif #endif
#ifndef S_ISTXT
#define S_ISTXT 0001000
#endif
#ifndef S_ISLNK #ifndef S_ISLNK
#define S_ISLNK(m) ((m & 0170000) == 0120000) #define S_ISLNK(m) ((m & 0170000) == 0120000)
#endif #endif