add size optimisation hacks by me from Android except ifdef’d

(note, I’d prefer everyone to keep IDSTRINGs around though)
This commit is contained in:
tg 2010-09-14 21:15:11 +00:00
parent dcbfc48855
commit 08862021ee
3 changed files with 10 additions and 3 deletions

View File

@ -1,5 +1,5 @@
#!/bin/sh
srcversion='$MirOS: src/bin/mksh/Build.sh,v 1.459 2010/08/24 15:46:06 tg Exp $'
srcversion='$MirOS: src/bin/mksh/Build.sh,v 1.460 2010/09/14 21:15:09 tg Exp $'
#-
# Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
# Thorsten Glaser <tg@mirbsd.org>
@ -30,6 +30,7 @@ srcversion='$MirOS: src/bin/mksh/Build.sh,v 1.459 2010/08/24 15:46:06 tg Exp $'
# MKSH_NOPWNAM MKSH_NO_LIMITS MKSH_SMALL MKSH_S_NOVI
# MKSH_UNEMPLOYED MKSH_DEFAULT_EXECSHELL MKSHRC_PATH
# MKSH_DEFAULT_TMPDIR MKSH_CLRTOEOL_STRING MKSH_A4PB
# MKSH_NO_DEPRECATED_WARNING MKSH_DONT_EMIT_IDSTRING
LC_ALL=C
export LC_ALL

4
misc.c
View File

@ -29,7 +29,7 @@
#include <grp.h>
#endif
__RCSID("$MirOS: src/bin/mksh/misc.c,v 1.145 2010/08/28 20:22:21 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/misc.c,v 1.146 2010/09/14 21:15:10 tg Exp $");
unsigned char chtypes[UCHAR_MAX + 1]; /* type bits for unsigned char */
@ -330,12 +330,14 @@ parse_args(const char **argv,
break;
}
i = option(go.optarg);
#ifndef MKSH_NO_DEPRECATED_WARNING
if ((enum sh_flag)i == FARC4RANDOM) {
warningf(true, "Do not use set ±o arc4random,"
" it will be removed in the next version"
" of mksh!");
return (0);
}
#endif
if ((i != (size_t)-1) && set == Flag(i))
/* Don't check the context if the flag
* isn't changing - makes "set -o interactive"

6
sh.h
View File

@ -141,16 +141,20 @@
#undef __SCCSID
#define __IDSTRING_CONCAT(l,p) __LINTED__ ## l ## _ ## p
#define __IDSTRING_EXPAND(l,p) __IDSTRING_CONCAT(l,p)
#ifdef MKSH_DONT_EMIT_IDSTRING
#define __IDSTRING(prefix, string) /* nothing */
#else
#define __IDSTRING(prefix, string) \
static const char __IDSTRING_EXPAND(__LINE__,prefix) [] \
MKSH_A_USED = "@(""#)" #prefix ": " string
#endif
#define __COPYRIGHT(x) __IDSTRING(copyright,x)
#define __RCSID(x) __IDSTRING(rcsid,x)
#define __SCCSID(x) __IDSTRING(sccsid,x)
#endif
#ifdef EXTERN
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.412 2010/09/05 19:51:35 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.413 2010/09/14 21:15:11 tg Exp $");
#endif
#define MKSH_VERSION "R39 2010/09/05"