diff --git a/build b/build index 1905b3ef9..934aacafc 100755 --- a/build +++ b/build @@ -1,6 +1,6 @@ cc -std=c99 -funsigned-char \ -Wall -Wno-format-security -Wno-comment -o hush \ --Iinclude -include include/autoconf.h \ +-Iinclude \ -Dhush_main=main -DNDEBUG -D"BB_VER=KBUILD_STR(1.22.1)" -D"KBUILD_STR(s)=#s" \ shell/hush.c \ shell/match.c \ diff --git a/coreutils/echo.c b/coreutils/echo.c index 9663894ec..47c1b095a 100644 --- a/coreutils/echo.c +++ b/coreutils/echo.c @@ -73,7 +73,7 @@ int echo_main(int argc UNUSED_PARAM, char **argv) #if !ENABLE_FEATURE_FANCY_ECHO enum { eflag = '\\', - nflag = 1, /* 1 -- print '\n' */ + nflag = 1 /* 1 -- print '\n' */ }; argv++; diff --git a/include/applet_metadata.h b/include/applet_metadata.h index 566ef3517..df230293f 100644 --- a/include/applet_metadata.h +++ b/include/applet_metadata.h @@ -14,10 +14,10 @@ typedef enum bb_install_loc_t { BB_DIR_SBIN, #if ENABLE_INSTALL_NO_USR BB_DIR_USR_BIN = BB_DIR_BIN, - BB_DIR_USR_SBIN = BB_DIR_SBIN, + BB_DIR_USR_SBIN = BB_DIR_SBIN #else BB_DIR_USR_BIN, - BB_DIR_USR_SBIN, + BB_DIR_USR_SBIN #endif } bb_install_loc_t; diff --git a/include/autoconf.h b/include/autoconf.h index 2d98202e4..c654dd37d 100644 --- a/include/autoconf.h +++ b/include/autoconf.h @@ -7,11 +7,11 @@ #define CONFIG_HAVE_DOT_CONFIG 1 #define ENABLE_HAVE_DOT_CONFIG 1 #ifdef MAKE_SUID -# define IF_HAVE_DOT_CONFIG(...) __VA_ARGS__ "CONFIG_HAVE_DOT_CONFIG" +# define IF_HAVE_DOT_CONFIG(x) x "CONFIG_HAVE_DOT_CONFIG" #else -# define IF_HAVE_DOT_CONFIG(...) __VA_ARGS__ +# define IF_HAVE_DOT_CONFIG(x) x #endif -#define IF_NOT_HAVE_DOT_CONFIG(...) +#define IF_NOT_HAVE_DOT_CONFIG(x) /* * Busybox Settings @@ -22,472 +22,472 @@ */ #undef CONFIG_DESKTOP #define ENABLE_DESKTOP 0 -#define IF_DESKTOP(...) -#define IF_NOT_DESKTOP(...) __VA_ARGS__ +#define IF_DESKTOP(x) +#define IF_NOT_DESKTOP(x) x #undef CONFIG_EXTRA_COMPAT #define ENABLE_EXTRA_COMPAT 0 -#define IF_EXTRA_COMPAT(...) -#define IF_NOT_EXTRA_COMPAT(...) __VA_ARGS__ +#define IF_EXTRA_COMPAT(x) +#define IF_NOT_EXTRA_COMPAT(x) x #define CONFIG_INCLUDE_SUSv2 1 #define ENABLE_INCLUDE_SUSv2 1 #ifdef MAKE_SUID -# define IF_INCLUDE_SUSv2(...) __VA_ARGS__ "CONFIG_INCLUDE_SUSv2" +# define IF_INCLUDE_SUSv2(x) x "CONFIG_INCLUDE_SUSv2" #else -# define IF_INCLUDE_SUSv2(...) __VA_ARGS__ +# define IF_INCLUDE_SUSv2(x) x #endif -#define IF_NOT_INCLUDE_SUSv2(...) +#define IF_NOT_INCLUDE_SUSv2(x) #define CONFIG_USE_PORTABLE_CODE 1 #define ENABLE_USE_PORTABLE_CODE 1 #ifdef MAKE_SUID -# define IF_USE_PORTABLE_CODE(...) __VA_ARGS__ "CONFIG_USE_PORTABLE_CODE" +# define IF_USE_PORTABLE_CODE(x) x "CONFIG_USE_PORTABLE_CODE" #else -# define IF_USE_PORTABLE_CODE(...) __VA_ARGS__ +# define IF_USE_PORTABLE_CODE(x) x #endif -#define IF_NOT_USE_PORTABLE_CODE(...) +#define IF_NOT_USE_PORTABLE_CODE(x) #undef CONFIG_PLATFORM_LINUX #define ENABLE_PLATFORM_LINUX 0 -#define IF_PLATFORM_LINUX(...) -#define IF_NOT_PLATFORM_LINUX(...) __VA_ARGS__ +#define IF_PLATFORM_LINUX(x) +#define IF_NOT_PLATFORM_LINUX(x) x #define CONFIG_FEATURE_BUFFERS_USE_MALLOC 1 #define ENABLE_FEATURE_BUFFERS_USE_MALLOC 1 #ifdef MAKE_SUID -# define IF_FEATURE_BUFFERS_USE_MALLOC(...) __VA_ARGS__ "CONFIG_FEATURE_BUFFERS_USE_MALLOC" +# define IF_FEATURE_BUFFERS_USE_MALLOC(x) x "CONFIG_FEATURE_BUFFERS_USE_MALLOC" #else -# define IF_FEATURE_BUFFERS_USE_MALLOC(...) __VA_ARGS__ +# define IF_FEATURE_BUFFERS_USE_MALLOC(x) x #endif -#define IF_NOT_FEATURE_BUFFERS_USE_MALLOC(...) +#define IF_NOT_FEATURE_BUFFERS_USE_MALLOC(x) #undef CONFIG_FEATURE_BUFFERS_GO_ON_STACK #define ENABLE_FEATURE_BUFFERS_GO_ON_STACK 0 -#define IF_FEATURE_BUFFERS_GO_ON_STACK(...) -#define IF_NOT_FEATURE_BUFFERS_GO_ON_STACK(...) __VA_ARGS__ +#define IF_FEATURE_BUFFERS_GO_ON_STACK(x) +#define IF_NOT_FEATURE_BUFFERS_GO_ON_STACK(x) x #undef CONFIG_FEATURE_BUFFERS_GO_IN_BSS #define ENABLE_FEATURE_BUFFERS_GO_IN_BSS 0 -#define IF_FEATURE_BUFFERS_GO_IN_BSS(...) -#define IF_NOT_FEATURE_BUFFERS_GO_IN_BSS(...) __VA_ARGS__ +#define IF_FEATURE_BUFFERS_GO_IN_BSS(x) +#define IF_NOT_FEATURE_BUFFERS_GO_IN_BSS(x) x #define CONFIG_SHOW_USAGE 1 #define ENABLE_SHOW_USAGE 1 #ifdef MAKE_SUID -# define IF_SHOW_USAGE(...) __VA_ARGS__ "CONFIG_SHOW_USAGE" +# define IF_SHOW_USAGE(x) x "CONFIG_SHOW_USAGE" #else -# define IF_SHOW_USAGE(...) __VA_ARGS__ +# define IF_SHOW_USAGE(x) x #endif -#define IF_NOT_SHOW_USAGE(...) +#define IF_NOT_SHOW_USAGE(x) #define CONFIG_FEATURE_VERBOSE_USAGE 1 #define ENABLE_FEATURE_VERBOSE_USAGE 1 #ifdef MAKE_SUID -# define IF_FEATURE_VERBOSE_USAGE(...) __VA_ARGS__ "CONFIG_FEATURE_VERBOSE_USAGE" +# define IF_FEATURE_VERBOSE_USAGE(x) x "CONFIG_FEATURE_VERBOSE_USAGE" #else -# define IF_FEATURE_VERBOSE_USAGE(...) __VA_ARGS__ +# define IF_FEATURE_VERBOSE_USAGE(x) x #endif -#define IF_NOT_FEATURE_VERBOSE_USAGE(...) +#define IF_NOT_FEATURE_VERBOSE_USAGE(x) #undef CONFIG_FEATURE_COMPRESS_USAGE #define ENABLE_FEATURE_COMPRESS_USAGE 0 -#define IF_FEATURE_COMPRESS_USAGE(...) -#define IF_NOT_FEATURE_COMPRESS_USAGE(...) __VA_ARGS__ +#define IF_FEATURE_COMPRESS_USAGE(x) +#define IF_NOT_FEATURE_COMPRESS_USAGE(x) x #undef CONFIG_FEATURE_INSTALLER #define ENABLE_FEATURE_INSTALLER 0 -#define IF_FEATURE_INSTALLER(...) -#define IF_NOT_FEATURE_INSTALLER(...) __VA_ARGS__ +#define IF_FEATURE_INSTALLER(x) +#define IF_NOT_FEATURE_INSTALLER(x) x #undef CONFIG_INSTALL_NO_USR #define ENABLE_INSTALL_NO_USR 0 -#define IF_INSTALL_NO_USR(...) -#define IF_NOT_INSTALL_NO_USR(...) __VA_ARGS__ +#define IF_INSTALL_NO_USR(x) +#define IF_NOT_INSTALL_NO_USR(x) x #undef CONFIG_LOCALE_SUPPORT #define ENABLE_LOCALE_SUPPORT 0 -#define IF_LOCALE_SUPPORT(...) -#define IF_NOT_LOCALE_SUPPORT(...) __VA_ARGS__ +#define IF_LOCALE_SUPPORT(x) +#define IF_NOT_LOCALE_SUPPORT(x) x #define CONFIG_UNICODE_SUPPORT 1 #define ENABLE_UNICODE_SUPPORT 1 #ifdef MAKE_SUID -# define IF_UNICODE_SUPPORT(...) __VA_ARGS__ "CONFIG_UNICODE_SUPPORT" +# define IF_UNICODE_SUPPORT(x) x "CONFIG_UNICODE_SUPPORT" #else -# define IF_UNICODE_SUPPORT(...) __VA_ARGS__ +# define IF_UNICODE_SUPPORT(x) x #endif -#define IF_NOT_UNICODE_SUPPORT(...) +#define IF_NOT_UNICODE_SUPPORT(x) #undef CONFIG_UNICODE_USING_LOCALE #define ENABLE_UNICODE_USING_LOCALE 0 -#define IF_UNICODE_USING_LOCALE(...) -#define IF_NOT_UNICODE_USING_LOCALE(...) __VA_ARGS__ +#define IF_UNICODE_USING_LOCALE(x) +#define IF_NOT_UNICODE_USING_LOCALE(x) x #undef CONFIG_FEATURE_CHECK_UNICODE_IN_ENV #define ENABLE_FEATURE_CHECK_UNICODE_IN_ENV 0 -#define IF_FEATURE_CHECK_UNICODE_IN_ENV(...) -#define IF_NOT_FEATURE_CHECK_UNICODE_IN_ENV(...) __VA_ARGS__ +#define IF_FEATURE_CHECK_UNICODE_IN_ENV(x) +#define IF_NOT_FEATURE_CHECK_UNICODE_IN_ENV(x) x #define CONFIG_SUBST_WCHAR 63 #define ENABLE_SUBST_WCHAR 1 #ifdef MAKE_SUID -# define IF_SUBST_WCHAR(...) __VA_ARGS__ "CONFIG_SUBST_WCHAR" +# define IF_SUBST_WCHAR(x) x "CONFIG_SUBST_WCHAR" #else -# define IF_SUBST_WCHAR(...) __VA_ARGS__ +# define IF_SUBST_WCHAR(x) x #endif -#define IF_NOT_SUBST_WCHAR(...) +#define IF_NOT_SUBST_WCHAR(x) #define CONFIG_LAST_SUPPORTED_WCHAR 767 #define ENABLE_LAST_SUPPORTED_WCHAR 1 #ifdef MAKE_SUID -# define IF_LAST_SUPPORTED_WCHAR(...) __VA_ARGS__ "CONFIG_LAST_SUPPORTED_WCHAR" +# define IF_LAST_SUPPORTED_WCHAR(x) x "CONFIG_LAST_SUPPORTED_WCHAR" #else -# define IF_LAST_SUPPORTED_WCHAR(...) __VA_ARGS__ +# define IF_LAST_SUPPORTED_WCHAR(x) x #endif -#define IF_NOT_LAST_SUPPORTED_WCHAR(...) +#define IF_NOT_LAST_SUPPORTED_WCHAR(x) #undef CONFIG_UNICODE_COMBINING_WCHARS #define ENABLE_UNICODE_COMBINING_WCHARS 0 -#define IF_UNICODE_COMBINING_WCHARS(...) -#define IF_NOT_UNICODE_COMBINING_WCHARS(...) __VA_ARGS__ +#define IF_UNICODE_COMBINING_WCHARS(x) +#define IF_NOT_UNICODE_COMBINING_WCHARS(x) x #undef CONFIG_UNICODE_WIDE_WCHARS #define ENABLE_UNICODE_WIDE_WCHARS 0 -#define IF_UNICODE_WIDE_WCHARS(...) -#define IF_NOT_UNICODE_WIDE_WCHARS(...) __VA_ARGS__ +#define IF_UNICODE_WIDE_WCHARS(x) +#define IF_NOT_UNICODE_WIDE_WCHARS(x) x #undef CONFIG_UNICODE_BIDI_SUPPORT #define ENABLE_UNICODE_BIDI_SUPPORT 0 -#define IF_UNICODE_BIDI_SUPPORT(...) -#define IF_NOT_UNICODE_BIDI_SUPPORT(...) __VA_ARGS__ +#define IF_UNICODE_BIDI_SUPPORT(x) +#define IF_NOT_UNICODE_BIDI_SUPPORT(x) x #undef CONFIG_UNICODE_NEUTRAL_TABLE #define ENABLE_UNICODE_NEUTRAL_TABLE 0 -#define IF_UNICODE_NEUTRAL_TABLE(...) -#define IF_NOT_UNICODE_NEUTRAL_TABLE(...) __VA_ARGS__ +#define IF_UNICODE_NEUTRAL_TABLE(x) +#define IF_NOT_UNICODE_NEUTRAL_TABLE(x) x #undef CONFIG_UNICODE_PRESERVE_BROKEN #define ENABLE_UNICODE_PRESERVE_BROKEN 0 -#define IF_UNICODE_PRESERVE_BROKEN(...) -#define IF_NOT_UNICODE_PRESERVE_BROKEN(...) __VA_ARGS__ +#define IF_UNICODE_PRESERVE_BROKEN(x) +#define IF_NOT_UNICODE_PRESERVE_BROKEN(x) x #define CONFIG_LONG_OPTS 1 #define ENABLE_LONG_OPTS 1 #ifdef MAKE_SUID -# define IF_LONG_OPTS(...) __VA_ARGS__ "CONFIG_LONG_OPTS" +# define IF_LONG_OPTS(x) x "CONFIG_LONG_OPTS" #else -# define IF_LONG_OPTS(...) __VA_ARGS__ +# define IF_LONG_OPTS(x) x #endif -#define IF_NOT_LONG_OPTS(...) +#define IF_NOT_LONG_OPTS(x) #define CONFIG_FEATURE_DEVPTS 1 #define ENABLE_FEATURE_DEVPTS 1 #ifdef MAKE_SUID -# define IF_FEATURE_DEVPTS(...) __VA_ARGS__ "CONFIG_FEATURE_DEVPTS" +# define IF_FEATURE_DEVPTS(x) x "CONFIG_FEATURE_DEVPTS" #else -# define IF_FEATURE_DEVPTS(...) __VA_ARGS__ +# define IF_FEATURE_DEVPTS(x) x #endif -#define IF_NOT_FEATURE_DEVPTS(...) +#define IF_NOT_FEATURE_DEVPTS(x) #undef CONFIG_FEATURE_CLEAN_UP #define ENABLE_FEATURE_CLEAN_UP 0 -#define IF_FEATURE_CLEAN_UP(...) -#define IF_NOT_FEATURE_CLEAN_UP(...) __VA_ARGS__ +#define IF_FEATURE_CLEAN_UP(x) +#define IF_NOT_FEATURE_CLEAN_UP(x) x #define CONFIG_FEATURE_UTMP 1 #define ENABLE_FEATURE_UTMP 1 #ifdef MAKE_SUID -# define IF_FEATURE_UTMP(...) __VA_ARGS__ "CONFIG_FEATURE_UTMP" +# define IF_FEATURE_UTMP(x) x "CONFIG_FEATURE_UTMP" #else -# define IF_FEATURE_UTMP(...) __VA_ARGS__ +# define IF_FEATURE_UTMP(x) x #endif -#define IF_NOT_FEATURE_UTMP(...) +#define IF_NOT_FEATURE_UTMP(x) #define CONFIG_FEATURE_WTMP 1 #define ENABLE_FEATURE_WTMP 1 #ifdef MAKE_SUID -# define IF_FEATURE_WTMP(...) __VA_ARGS__ "CONFIG_FEATURE_WTMP" +# define IF_FEATURE_WTMP(x) x "CONFIG_FEATURE_WTMP" #else -# define IF_FEATURE_WTMP(...) __VA_ARGS__ +# define IF_FEATURE_WTMP(x) x #endif -#define IF_NOT_FEATURE_WTMP(...) +#define IF_NOT_FEATURE_WTMP(x) #define CONFIG_FEATURE_PIDFILE 1 #define ENABLE_FEATURE_PIDFILE 1 #ifdef MAKE_SUID -# define IF_FEATURE_PIDFILE(...) __VA_ARGS__ "CONFIG_FEATURE_PIDFILE" +# define IF_FEATURE_PIDFILE(x) x "CONFIG_FEATURE_PIDFILE" #else -# define IF_FEATURE_PIDFILE(...) __VA_ARGS__ +# define IF_FEATURE_PIDFILE(x) x #endif -#define IF_NOT_FEATURE_PIDFILE(...) +#define IF_NOT_FEATURE_PIDFILE(x) #define CONFIG_PID_FILE_PATH "/var/run" #define ENABLE_PID_FILE_PATH 1 #ifdef MAKE_SUID -# define IF_PID_FILE_PATH(...) __VA_ARGS__ "CONFIG_PID_FILE_PATH" +# define IF_PID_FILE_PATH(x) x "CONFIG_PID_FILE_PATH" #else -# define IF_PID_FILE_PATH(...) __VA_ARGS__ +# define IF_PID_FILE_PATH(x) x #endif -#define IF_NOT_PID_FILE_PATH(...) +#define IF_NOT_PID_FILE_PATH(x) #define CONFIG_FEATURE_SUID 1 #define ENABLE_FEATURE_SUID 1 #ifdef MAKE_SUID -# define IF_FEATURE_SUID(...) __VA_ARGS__ "CONFIG_FEATURE_SUID" +# define IF_FEATURE_SUID(x) x "CONFIG_FEATURE_SUID" #else -# define IF_FEATURE_SUID(...) __VA_ARGS__ +# define IF_FEATURE_SUID(x) x #endif -#define IF_NOT_FEATURE_SUID(...) +#define IF_NOT_FEATURE_SUID(x) #define CONFIG_FEATURE_SUID_CONFIG 1 #define ENABLE_FEATURE_SUID_CONFIG 1 #ifdef MAKE_SUID -# define IF_FEATURE_SUID_CONFIG(...) __VA_ARGS__ "CONFIG_FEATURE_SUID_CONFIG" +# define IF_FEATURE_SUID_CONFIG(x) x "CONFIG_FEATURE_SUID_CONFIG" #else -# define IF_FEATURE_SUID_CONFIG(...) __VA_ARGS__ +# define IF_FEATURE_SUID_CONFIG(x) x #endif -#define IF_NOT_FEATURE_SUID_CONFIG(...) +#define IF_NOT_FEATURE_SUID_CONFIG(x) #define CONFIG_FEATURE_SUID_CONFIG_QUIET 1 #define ENABLE_FEATURE_SUID_CONFIG_QUIET 1 #ifdef MAKE_SUID -# define IF_FEATURE_SUID_CONFIG_QUIET(...) __VA_ARGS__ "CONFIG_FEATURE_SUID_CONFIG_QUIET" +# define IF_FEATURE_SUID_CONFIG_QUIET(x) x "CONFIG_FEATURE_SUID_CONFIG_QUIET" #else -# define IF_FEATURE_SUID_CONFIG_QUIET(...) __VA_ARGS__ +# define IF_FEATURE_SUID_CONFIG_QUIET(x) x #endif -#define IF_NOT_FEATURE_SUID_CONFIG_QUIET(...) +#define IF_NOT_FEATURE_SUID_CONFIG_QUIET(x) #undef CONFIG_SELINUX #define ENABLE_SELINUX 0 -#define IF_SELINUX(...) -#define IF_NOT_SELINUX(...) __VA_ARGS__ +#define IF_SELINUX(x) +#define IF_NOT_SELINUX(x) x #undef CONFIG_FEATURE_PREFER_APPLETS #define ENABLE_FEATURE_PREFER_APPLETS 0 -#define IF_FEATURE_PREFER_APPLETS(...) -#define IF_NOT_FEATURE_PREFER_APPLETS(...) __VA_ARGS__ +#define IF_FEATURE_PREFER_APPLETS(x) +#define IF_NOT_FEATURE_PREFER_APPLETS(x) x #define CONFIG_BUSYBOX_EXEC_PATH "/proc/self/exe" #define ENABLE_BUSYBOX_EXEC_PATH 1 #ifdef MAKE_SUID -# define IF_BUSYBOX_EXEC_PATH(...) __VA_ARGS__ "CONFIG_BUSYBOX_EXEC_PATH" +# define IF_BUSYBOX_EXEC_PATH(x) x "CONFIG_BUSYBOX_EXEC_PATH" #else -# define IF_BUSYBOX_EXEC_PATH(...) __VA_ARGS__ +# define IF_BUSYBOX_EXEC_PATH(x) x #endif -#define IF_NOT_BUSYBOX_EXEC_PATH(...) +#define IF_NOT_BUSYBOX_EXEC_PATH(x) #undef CONFIG_FEATURE_SYSLOG #define ENABLE_FEATURE_SYSLOG 0 -#define IF_FEATURE_SYSLOG(...) -#define IF_NOT_FEATURE_SYSLOG(...) __VA_ARGS__ +#define IF_FEATURE_SYSLOG(x) +#define IF_NOT_FEATURE_SYSLOG(x) x #undef CONFIG_FEATURE_HAVE_RPC #define ENABLE_FEATURE_HAVE_RPC 0 -#define IF_FEATURE_HAVE_RPC(...) -#define IF_NOT_FEATURE_HAVE_RPC(...) __VA_ARGS__ +#define IF_FEATURE_HAVE_RPC(x) +#define IF_NOT_FEATURE_HAVE_RPC(x) x /* * Build Options */ #undef CONFIG_STATIC #define ENABLE_STATIC 0 -#define IF_STATIC(...) -#define IF_NOT_STATIC(...) __VA_ARGS__ +#define IF_STATIC(x) +#define IF_NOT_STATIC(x) x #undef CONFIG_PIE #define ENABLE_PIE 0 -#define IF_PIE(...) -#define IF_NOT_PIE(...) __VA_ARGS__ +#define IF_PIE(x) +#define IF_NOT_PIE(x) x #define CONFIG_NOMMU 1 #define ENABLE_NOMMU 1 #ifdef MAKE_SUID -# define IF_NOMMU(...) __VA_ARGS__ "CONFIG_NOMMU" +# define IF_NOMMU(x) x "CONFIG_NOMMU" #else -# define IF_NOMMU(...) __VA_ARGS__ +# define IF_NOMMU(x) x #endif -#define IF_NOT_NOMMU(...) +#define IF_NOT_NOMMU(x) #undef CONFIG_BUILD_LIBBUSYBOX #define ENABLE_BUILD_LIBBUSYBOX 0 -#define IF_BUILD_LIBBUSYBOX(...) -#define IF_NOT_BUILD_LIBBUSYBOX(...) __VA_ARGS__ +#define IF_BUILD_LIBBUSYBOX(x) +#define IF_NOT_BUILD_LIBBUSYBOX(x) x #undef CONFIG_FEATURE_INDIVIDUAL #define ENABLE_FEATURE_INDIVIDUAL 0 -#define IF_FEATURE_INDIVIDUAL(...) -#define IF_NOT_FEATURE_INDIVIDUAL(...) __VA_ARGS__ +#define IF_FEATURE_INDIVIDUAL(x) +#define IF_NOT_FEATURE_INDIVIDUAL(x) x #undef CONFIG_FEATURE_SHARED_BUSYBOX #define ENABLE_FEATURE_SHARED_BUSYBOX 0 -#define IF_FEATURE_SHARED_BUSYBOX(...) -#define IF_NOT_FEATURE_SHARED_BUSYBOX(...) __VA_ARGS__ +#define IF_FEATURE_SHARED_BUSYBOX(x) +#define IF_NOT_FEATURE_SHARED_BUSYBOX(x) x #undef CONFIG_LFS #define ENABLE_LFS 0 -#define IF_LFS(...) -#define IF_NOT_LFS(...) __VA_ARGS__ +#define IF_LFS(x) +#define IF_NOT_LFS(x) x #define CONFIG_CROSS_COMPILER_PREFIX "" #define ENABLE_CROSS_COMPILER_PREFIX 1 #ifdef MAKE_SUID -# define IF_CROSS_COMPILER_PREFIX(...) __VA_ARGS__ "CONFIG_CROSS_COMPILER_PREFIX" +# define IF_CROSS_COMPILER_PREFIX(x) x "CONFIG_CROSS_COMPILER_PREFIX" #else -# define IF_CROSS_COMPILER_PREFIX(...) __VA_ARGS__ +# define IF_CROSS_COMPILER_PREFIX(x) x #endif -#define IF_NOT_CROSS_COMPILER_PREFIX(...) +#define IF_NOT_CROSS_COMPILER_PREFIX(x) #define CONFIG_SYSROOT "" #define ENABLE_SYSROOT 1 #ifdef MAKE_SUID -# define IF_SYSROOT(...) __VA_ARGS__ "CONFIG_SYSROOT" +# define IF_SYSROOT(x) x "CONFIG_SYSROOT" #else -# define IF_SYSROOT(...) __VA_ARGS__ +# define IF_SYSROOT(x) x #endif -#define IF_NOT_SYSROOT(...) +#define IF_NOT_SYSROOT(x) #define CONFIG_EXTRA_CFLAGS "" #define ENABLE_EXTRA_CFLAGS 1 #ifdef MAKE_SUID -# define IF_EXTRA_CFLAGS(...) __VA_ARGS__ "CONFIG_EXTRA_CFLAGS" +# define IF_EXTRA_CFLAGS(x) x "CONFIG_EXTRA_CFLAGS" #else -# define IF_EXTRA_CFLAGS(...) __VA_ARGS__ +# define IF_EXTRA_CFLAGS(x) x #endif -#define IF_NOT_EXTRA_CFLAGS(...) +#define IF_NOT_EXTRA_CFLAGS(x) #define CONFIG_EXTRA_LDFLAGS "" #define ENABLE_EXTRA_LDFLAGS 1 #ifdef MAKE_SUID -# define IF_EXTRA_LDFLAGS(...) __VA_ARGS__ "CONFIG_EXTRA_LDFLAGS" +# define IF_EXTRA_LDFLAGS(x) x "CONFIG_EXTRA_LDFLAGS" #else -# define IF_EXTRA_LDFLAGS(...) __VA_ARGS__ +# define IF_EXTRA_LDFLAGS(x) x #endif -#define IF_NOT_EXTRA_LDFLAGS(...) +#define IF_NOT_EXTRA_LDFLAGS(x) #define CONFIG_EXTRA_LDLIBS "" #define ENABLE_EXTRA_LDLIBS 1 #ifdef MAKE_SUID -# define IF_EXTRA_LDLIBS(...) __VA_ARGS__ "CONFIG_EXTRA_LDLIBS" +# define IF_EXTRA_LDLIBS(x) x "CONFIG_EXTRA_LDLIBS" #else -# define IF_EXTRA_LDLIBS(...) __VA_ARGS__ +# define IF_EXTRA_LDLIBS(x) x #endif -#define IF_NOT_EXTRA_LDLIBS(...) +#define IF_NOT_EXTRA_LDLIBS(x) /* * Debugging Options */ #undef CONFIG_DEBUG #define ENABLE_DEBUG 0 -#define IF_DEBUG(...) -#define IF_NOT_DEBUG(...) __VA_ARGS__ +#define IF_DEBUG(x) +#define IF_NOT_DEBUG(x) x #undef CONFIG_DEBUG_PESSIMIZE #define ENABLE_DEBUG_PESSIMIZE 0 -#define IF_DEBUG_PESSIMIZE(...) -#define IF_NOT_DEBUG_PESSIMIZE(...) __VA_ARGS__ +#define IF_DEBUG_PESSIMIZE(x) +#define IF_NOT_DEBUG_PESSIMIZE(x) x #undef CONFIG_WERROR #define ENABLE_WERROR 0 -#define IF_WERROR(...) -#define IF_NOT_WERROR(...) __VA_ARGS__ +#define IF_WERROR(x) +#define IF_NOT_WERROR(x) x #define CONFIG_NO_DEBUG_LIB 1 #define ENABLE_NO_DEBUG_LIB 1 #ifdef MAKE_SUID -# define IF_NO_DEBUG_LIB(...) __VA_ARGS__ "CONFIG_NO_DEBUG_LIB" +# define IF_NO_DEBUG_LIB(x) x "CONFIG_NO_DEBUG_LIB" #else -# define IF_NO_DEBUG_LIB(...) __VA_ARGS__ +# define IF_NO_DEBUG_LIB(x) x #endif -#define IF_NOT_NO_DEBUG_LIB(...) +#define IF_NOT_NO_DEBUG_LIB(x) #undef CONFIG_DMALLOC #define ENABLE_DMALLOC 0 -#define IF_DMALLOC(...) -#define IF_NOT_DMALLOC(...) __VA_ARGS__ +#define IF_DMALLOC(x) +#define IF_NOT_DMALLOC(x) x #undef CONFIG_EFENCE #define ENABLE_EFENCE 0 -#define IF_EFENCE(...) -#define IF_NOT_EFENCE(...) __VA_ARGS__ +#define IF_EFENCE(x) +#define IF_NOT_EFENCE(x) x /* * Busybox Library Tuning */ #undef CONFIG_FEATURE_ETC_NETWORKS #define ENABLE_FEATURE_ETC_NETWORKS 0 -#define IF_FEATURE_ETC_NETWORKS(...) -#define IF_NOT_FEATURE_ETC_NETWORKS(...) __VA_ARGS__ +#define IF_FEATURE_ETC_NETWORKS(x) +#define IF_NOT_FEATURE_ETC_NETWORKS(x) x #undef CONFIG_FEATURE_USE_TERMIOS #define ENABLE_FEATURE_USE_TERMIOS 0 -#define IF_FEATURE_USE_TERMIOS(...) -#define IF_NOT_FEATURE_USE_TERMIOS(...) __VA_ARGS__ +#define IF_FEATURE_USE_TERMIOS(x) +#define IF_NOT_FEATURE_USE_TERMIOS(x) x #define CONFIG_FEATURE_EDITING 1 #define ENABLE_FEATURE_EDITING 1 #ifdef MAKE_SUID -# define IF_FEATURE_EDITING(...) __VA_ARGS__ "CONFIG_FEATURE_EDITING" +# define IF_FEATURE_EDITING(x) x "CONFIG_FEATURE_EDITING" #else -# define IF_FEATURE_EDITING(...) __VA_ARGS__ +# define IF_FEATURE_EDITING(x) x #endif -#define IF_NOT_FEATURE_EDITING(...) +#define IF_NOT_FEATURE_EDITING(x) #define CONFIG_FEATURE_EDITING_MAX_LEN 1024 #define ENABLE_FEATURE_EDITING_MAX_LEN 1 #ifdef MAKE_SUID -# define IF_FEATURE_EDITING_MAX_LEN(...) __VA_ARGS__ "CONFIG_FEATURE_EDITING_MAX_LEN" +# define IF_FEATURE_EDITING_MAX_LEN(x) x "CONFIG_FEATURE_EDITING_MAX_LEN" #else -# define IF_FEATURE_EDITING_MAX_LEN(...) __VA_ARGS__ +# define IF_FEATURE_EDITING_MAX_LEN(x) x #endif -#define IF_NOT_FEATURE_EDITING_MAX_LEN(...) +#define IF_NOT_FEATURE_EDITING_MAX_LEN(x) #undef CONFIG_FEATURE_EDITING_VI #define ENABLE_FEATURE_EDITING_VI 0 -#define IF_FEATURE_EDITING_VI(...) -#define IF_NOT_FEATURE_EDITING_VI(...) __VA_ARGS__ +#define IF_FEATURE_EDITING_VI(x) +#define IF_NOT_FEATURE_EDITING_VI(x) x #define CONFIG_FEATURE_EDITING_HISTORY 255 #define ENABLE_FEATURE_EDITING_HISTORY 1 #ifdef MAKE_SUID -# define IF_FEATURE_EDITING_HISTORY(...) __VA_ARGS__ "CONFIG_FEATURE_EDITING_HISTORY" +# define IF_FEATURE_EDITING_HISTORY(x) x "CONFIG_FEATURE_EDITING_HISTORY" #else -# define IF_FEATURE_EDITING_HISTORY(...) __VA_ARGS__ +# define IF_FEATURE_EDITING_HISTORY(x) x #endif -#define IF_NOT_FEATURE_EDITING_HISTORY(...) +#define IF_NOT_FEATURE_EDITING_HISTORY(x) #define CONFIG_FEATURE_EDITING_SAVEHISTORY 1 #define ENABLE_FEATURE_EDITING_SAVEHISTORY 1 #ifdef MAKE_SUID -# define IF_FEATURE_EDITING_SAVEHISTORY(...) __VA_ARGS__ "CONFIG_FEATURE_EDITING_SAVEHISTORY" +# define IF_FEATURE_EDITING_SAVEHISTORY(x) x "CONFIG_FEATURE_EDITING_SAVEHISTORY" #else -# define IF_FEATURE_EDITING_SAVEHISTORY(...) __VA_ARGS__ +# define IF_FEATURE_EDITING_SAVEHISTORY(x) x #endif -#define IF_NOT_FEATURE_EDITING_SAVEHISTORY(...) +#define IF_NOT_FEATURE_EDITING_SAVEHISTORY(x) #undef CONFIG_FEATURE_EDITING_SAVE_ON_EXIT #define ENABLE_FEATURE_EDITING_SAVE_ON_EXIT 0 -#define IF_FEATURE_EDITING_SAVE_ON_EXIT(...) -#define IF_NOT_FEATURE_EDITING_SAVE_ON_EXIT(...) __VA_ARGS__ +#define IF_FEATURE_EDITING_SAVE_ON_EXIT(x) +#define IF_NOT_FEATURE_EDITING_SAVE_ON_EXIT(x) x #define CONFIG_FEATURE_REVERSE_SEARCH 1 #define ENABLE_FEATURE_REVERSE_SEARCH 1 #ifdef MAKE_SUID -# define IF_FEATURE_REVERSE_SEARCH(...) __VA_ARGS__ "CONFIG_FEATURE_REVERSE_SEARCH" +# define IF_FEATURE_REVERSE_SEARCH(x) x "CONFIG_FEATURE_REVERSE_SEARCH" #else -# define IF_FEATURE_REVERSE_SEARCH(...) __VA_ARGS__ +# define IF_FEATURE_REVERSE_SEARCH(x) x #endif -#define IF_NOT_FEATURE_REVERSE_SEARCH(...) +#define IF_NOT_FEATURE_REVERSE_SEARCH(x) #define CONFIG_FEATURE_TAB_COMPLETION 1 #define ENABLE_FEATURE_TAB_COMPLETION 1 #ifdef MAKE_SUID -# define IF_FEATURE_TAB_COMPLETION(...) __VA_ARGS__ "CONFIG_FEATURE_TAB_COMPLETION" +# define IF_FEATURE_TAB_COMPLETION(x) x "CONFIG_FEATURE_TAB_COMPLETION" #else -# define IF_FEATURE_TAB_COMPLETION(...) __VA_ARGS__ +# define IF_FEATURE_TAB_COMPLETION(x) x #endif -#define IF_NOT_FEATURE_TAB_COMPLETION(...) +#define IF_NOT_FEATURE_TAB_COMPLETION(x) #undef CONFIG_FEATURE_USERNAME_COMPLETION #define ENABLE_FEATURE_USERNAME_COMPLETION 0 -#define IF_FEATURE_USERNAME_COMPLETION(...) -#define IF_NOT_FEATURE_USERNAME_COMPLETION(...) __VA_ARGS__ +#define IF_FEATURE_USERNAME_COMPLETION(x) +#define IF_NOT_FEATURE_USERNAME_COMPLETION(x) x #define CONFIG_FEATURE_EDITING_FANCY_PROMPT 1 #define ENABLE_FEATURE_EDITING_FANCY_PROMPT 1 #ifdef MAKE_SUID -# define IF_FEATURE_EDITING_FANCY_PROMPT(...) __VA_ARGS__ "CONFIG_FEATURE_EDITING_FANCY_PROMPT" +# define IF_FEATURE_EDITING_FANCY_PROMPT(x) x "CONFIG_FEATURE_EDITING_FANCY_PROMPT" #else -# define IF_FEATURE_EDITING_FANCY_PROMPT(...) __VA_ARGS__ +# define IF_FEATURE_EDITING_FANCY_PROMPT(x) x #endif -#define IF_NOT_FEATURE_EDITING_FANCY_PROMPT(...) +#define IF_NOT_FEATURE_EDITING_FANCY_PROMPT(x) #undef CONFIG_FEATURE_EDITING_ASK_TERMINAL #define ENABLE_FEATURE_EDITING_ASK_TERMINAL 0 -#define IF_FEATURE_EDITING_ASK_TERMINAL(...) -#define IF_NOT_FEATURE_EDITING_ASK_TERMINAL(...) __VA_ARGS__ +#define IF_FEATURE_EDITING_ASK_TERMINAL(x) +#define IF_NOT_FEATURE_EDITING_ASK_TERMINAL(x) x #define CONFIG_FEATURE_NON_POSIX_CP 1 #define ENABLE_FEATURE_NON_POSIX_CP 1 #ifdef MAKE_SUID -# define IF_FEATURE_NON_POSIX_CP(...) __VA_ARGS__ "CONFIG_FEATURE_NON_POSIX_CP" +# define IF_FEATURE_NON_POSIX_CP(x) x "CONFIG_FEATURE_NON_POSIX_CP" #else -# define IF_FEATURE_NON_POSIX_CP(...) __VA_ARGS__ +# define IF_FEATURE_NON_POSIX_CP(x) x #endif -#define IF_NOT_FEATURE_NON_POSIX_CP(...) +#define IF_NOT_FEATURE_NON_POSIX_CP(x) #undef CONFIG_FEATURE_VERBOSE_CP_MESSAGE #define ENABLE_FEATURE_VERBOSE_CP_MESSAGE 0 -#define IF_FEATURE_VERBOSE_CP_MESSAGE(...) -#define IF_NOT_FEATURE_VERBOSE_CP_MESSAGE(...) __VA_ARGS__ +#define IF_FEATURE_VERBOSE_CP_MESSAGE(x) +#define IF_NOT_FEATURE_VERBOSE_CP_MESSAGE(x) x #define CONFIG_FEATURE_COPYBUF_KB 4 #define ENABLE_FEATURE_COPYBUF_KB 1 #ifdef MAKE_SUID -# define IF_FEATURE_COPYBUF_KB(...) __VA_ARGS__ "CONFIG_FEATURE_COPYBUF_KB" +# define IF_FEATURE_COPYBUF_KB(x) x "CONFIG_FEATURE_COPYBUF_KB" #else -# define IF_FEATURE_COPYBUF_KB(...) __VA_ARGS__ +# define IF_FEATURE_COPYBUF_KB(x) x #endif -#define IF_NOT_FEATURE_COPYBUF_KB(...) +#define IF_NOT_FEATURE_COPYBUF_KB(x) #define CONFIG_FEATURE_SKIP_ROOTFS 1 #define ENABLE_FEATURE_SKIP_ROOTFS 1 #ifdef MAKE_SUID -# define IF_FEATURE_SKIP_ROOTFS(...) __VA_ARGS__ "CONFIG_FEATURE_SKIP_ROOTFS" +# define IF_FEATURE_SKIP_ROOTFS(x) x "CONFIG_FEATURE_SKIP_ROOTFS" #else -# define IF_FEATURE_SKIP_ROOTFS(...) __VA_ARGS__ +# define IF_FEATURE_SKIP_ROOTFS(x) x #endif -#define IF_NOT_FEATURE_SKIP_ROOTFS(...) +#define IF_NOT_FEATURE_SKIP_ROOTFS(x) #undef CONFIG_MONOTONIC_SYSCALL #define ENABLE_MONOTONIC_SYSCALL 0 -#define IF_MONOTONIC_SYSCALL(...) -#define IF_NOT_MONOTONIC_SYSCALL(...) __VA_ARGS__ +#define IF_MONOTONIC_SYSCALL(x) +#define IF_NOT_MONOTONIC_SYSCALL(x) x #define CONFIG_IOCTL_HEX2STR_ERROR 1 #define ENABLE_IOCTL_HEX2STR_ERROR 1 #ifdef MAKE_SUID -# define IF_IOCTL_HEX2STR_ERROR(...) __VA_ARGS__ "CONFIG_IOCTL_HEX2STR_ERROR" +# define IF_IOCTL_HEX2STR_ERROR(x) x "CONFIG_IOCTL_HEX2STR_ERROR" #else -# define IF_IOCTL_HEX2STR_ERROR(...) __VA_ARGS__ +# define IF_IOCTL_HEX2STR_ERROR(x) x #endif -#define IF_NOT_IOCTL_HEX2STR_ERROR(...) +#define IF_NOT_IOCTL_HEX2STR_ERROR(x) #define CONFIG_FEATURE_HWIB 1 #define ENABLE_FEATURE_HWIB 1 #ifdef MAKE_SUID -# define IF_FEATURE_HWIB(...) __VA_ARGS__ "CONFIG_FEATURE_HWIB" +# define IF_FEATURE_HWIB(x) x "CONFIG_FEATURE_HWIB" #else -# define IF_FEATURE_HWIB(...) __VA_ARGS__ +# define IF_FEATURE_HWIB(x) x #endif -#define IF_NOT_FEATURE_HWIB(...) +#define IF_NOT_FEATURE_HWIB(x) /* * Applets @@ -499,36 +499,36 @@ #undef CONFIG_TEST #define ENABLE_TEST 0 -#define IF_TEST(...) -#define IF_NOT_TEST(...) __VA_ARGS__ +#define IF_TEST(x) +#define IF_NOT_TEST(x) x #undef CONFIG_FEATURE_TEST_64 #define ENABLE_FEATURE_TEST_64 0 -#define IF_FEATURE_TEST_64(...) -#define IF_NOT_FEATURE_TEST_64(...) __VA_ARGS__ +#define IF_FEATURE_TEST_64(x) +#define IF_NOT_FEATURE_TEST_64(x) x #undef CONFIG_CHOWN #define ENABLE_CHOWN 0 -#define IF_CHOWN(...) -#define IF_NOT_CHOWN(...) __VA_ARGS__ +#define IF_CHOWN(x) +#define IF_NOT_CHOWN(x) x #undef CONFIG_ECHO #define ENABLE_ECHO 0 -#define IF_ECHO(...) -#define IF_NOT_ECHO(...) __VA_ARGS__ +#define IF_ECHO(x) +#define IF_NOT_ECHO(x) x #undef CONFIG_FEATURE_FANCY_ECHO #define ENABLE_FEATURE_FANCY_ECHO 0 -#define IF_FEATURE_FANCY_ECHO(...) -#define IF_NOT_FEATURE_FANCY_ECHO(...) __VA_ARGS__ +#define IF_FEATURE_FANCY_ECHO(x) +#define IF_NOT_FEATURE_FANCY_ECHO(x) x #undef CONFIG_LS #define ENABLE_LS 0 -#define IF_LS(...) -#define IF_NOT_LS(...) __VA_ARGS__ +#define IF_LS(x) +#define IF_NOT_LS(x) x #undef CONFIG_PRINTF #define ENABLE_PRINTF 0 -#define IF_PRINTF(...) -#define IF_NOT_PRINTF(...) __VA_ARGS__ +#define IF_PRINTF(x) +#define IF_NOT_PRINTF(x) x /* @@ -536,399 +536,399 @@ */ #undef CONFIG_FEATURE_VI_ASK_TERMINAL #define ENABLE_FEATURE_VI_ASK_TERMINAL 0 -#define IF_FEATURE_VI_ASK_TERMINAL(...) -#define IF_NOT_FEATURE_VI_ASK_TERMINAL(...) __VA_ARGS__ +#define IF_FEATURE_VI_ASK_TERMINAL(x) +#define IF_NOT_FEATURE_VI_ASK_TERMINAL(x) x /* * Miscellaneous Utilities */ #undef CONFIG_FEATURE_LESS_ASK_TERMINAL #define ENABLE_FEATURE_LESS_ASK_TERMINAL 0 -#define IF_FEATURE_LESS_ASK_TERMINAL(...) -#define IF_NOT_FEATURE_LESS_ASK_TERMINAL(...) __VA_ARGS__ +#define IF_FEATURE_LESS_ASK_TERMINAL(x) +#define IF_NOT_FEATURE_LESS_ASK_TERMINAL(x) x #undef CONFIG_FEATURE_CROND_D #define ENABLE_FEATURE_CROND_D 0 -#define IF_FEATURE_CROND_D(...) -#define IF_NOT_FEATURE_CROND_D(...) __VA_ARGS__ +#define IF_FEATURE_CROND_D(x) +#define IF_NOT_FEATURE_CROND_D(x) x /* * Process Utilities */ #undef CONFIG_IOSTAT #define ENABLE_IOSTAT 0 -#define IF_IOSTAT(...) -#define IF_NOT_IOSTAT(...) __VA_ARGS__ +#define IF_IOSTAT(x) +#define IF_NOT_IOSTAT(x) x #undef CONFIG_LSOF #define ENABLE_LSOF 0 -#define IF_LSOF(...) -#define IF_NOT_LSOF(...) __VA_ARGS__ +#define IF_LSOF(x) +#define IF_NOT_LSOF(x) x #undef CONFIG_MPSTAT #define ENABLE_MPSTAT 0 -#define IF_MPSTAT(...) -#define IF_NOT_MPSTAT(...) __VA_ARGS__ +#define IF_MPSTAT(x) +#define IF_NOT_MPSTAT(x) x #undef CONFIG_NMETER #define ENABLE_NMETER 0 -#define IF_NMETER(...) -#define IF_NOT_NMETER(...) __VA_ARGS__ +#define IF_NMETER(x) +#define IF_NOT_NMETER(x) x #undef CONFIG_PMAP #define ENABLE_PMAP 0 -#define IF_PMAP(...) -#define IF_NOT_PMAP(...) __VA_ARGS__ +#define IF_PMAP(x) +#define IF_NOT_PMAP(x) x #undef CONFIG_POWERTOP #define ENABLE_POWERTOP 0 -#define IF_POWERTOP(...) -#define IF_NOT_POWERTOP(...) __VA_ARGS__ +#define IF_POWERTOP(x) +#define IF_NOT_POWERTOP(x) x #undef CONFIG_PSTREE #define ENABLE_PSTREE 0 -#define IF_PSTREE(...) -#define IF_NOT_PSTREE(...) __VA_ARGS__ +#define IF_PSTREE(x) +#define IF_NOT_PSTREE(x) x #undef CONFIG_PWDX #define ENABLE_PWDX 0 -#define IF_PWDX(...) -#define IF_NOT_PWDX(...) __VA_ARGS__ +#define IF_PWDX(x) +#define IF_NOT_PWDX(x) x #undef CONFIG_SMEMCAP #define ENABLE_SMEMCAP 0 -#define IF_SMEMCAP(...) -#define IF_NOT_SMEMCAP(...) __VA_ARGS__ +#define IF_SMEMCAP(x) +#define IF_NOT_SMEMCAP(x) x #undef CONFIG_TOP #define ENABLE_TOP 0 -#define IF_TOP(...) -#define IF_NOT_TOP(...) __VA_ARGS__ +#define IF_TOP(x) +#define IF_NOT_TOP(x) x #undef CONFIG_FEATURE_TOP_CPU_USAGE_PERCENTAGE #define ENABLE_FEATURE_TOP_CPU_USAGE_PERCENTAGE 0 -#define IF_FEATURE_TOP_CPU_USAGE_PERCENTAGE(...) -#define IF_NOT_FEATURE_TOP_CPU_USAGE_PERCENTAGE(...) __VA_ARGS__ +#define IF_FEATURE_TOP_CPU_USAGE_PERCENTAGE(x) +#define IF_NOT_FEATURE_TOP_CPU_USAGE_PERCENTAGE(x) x #undef CONFIG_FEATURE_TOP_CPU_GLOBAL_PERCENTS #define ENABLE_FEATURE_TOP_CPU_GLOBAL_PERCENTS 0 -#define IF_FEATURE_TOP_CPU_GLOBAL_PERCENTS(...) -#define IF_NOT_FEATURE_TOP_CPU_GLOBAL_PERCENTS(...) __VA_ARGS__ +#define IF_FEATURE_TOP_CPU_GLOBAL_PERCENTS(x) +#define IF_NOT_FEATURE_TOP_CPU_GLOBAL_PERCENTS(x) x #undef CONFIG_FEATURE_TOP_SMP_CPU #define ENABLE_FEATURE_TOP_SMP_CPU 0 -#define IF_FEATURE_TOP_SMP_CPU(...) -#define IF_NOT_FEATURE_TOP_SMP_CPU(...) __VA_ARGS__ +#define IF_FEATURE_TOP_SMP_CPU(x) +#define IF_NOT_FEATURE_TOP_SMP_CPU(x) x #undef CONFIG_FEATURE_TOP_DECIMALS #define ENABLE_FEATURE_TOP_DECIMALS 0 -#define IF_FEATURE_TOP_DECIMALS(...) -#define IF_NOT_FEATURE_TOP_DECIMALS(...) __VA_ARGS__ +#define IF_FEATURE_TOP_DECIMALS(x) +#define IF_NOT_FEATURE_TOP_DECIMALS(x) x #undef CONFIG_FEATURE_TOP_SMP_PROCESS #define ENABLE_FEATURE_TOP_SMP_PROCESS 0 -#define IF_FEATURE_TOP_SMP_PROCESS(...) -#define IF_NOT_FEATURE_TOP_SMP_PROCESS(...) __VA_ARGS__ +#define IF_FEATURE_TOP_SMP_PROCESS(x) +#define IF_NOT_FEATURE_TOP_SMP_PROCESS(x) x #undef CONFIG_FEATURE_TOPMEM #define ENABLE_FEATURE_TOPMEM 0 -#define IF_FEATURE_TOPMEM(...) -#define IF_NOT_FEATURE_TOPMEM(...) __VA_ARGS__ +#define IF_FEATURE_TOPMEM(x) +#define IF_NOT_FEATURE_TOPMEM(x) x #undef CONFIG_UPTIME #define ENABLE_UPTIME 0 -#define IF_UPTIME(...) -#define IF_NOT_UPTIME(...) __VA_ARGS__ +#define IF_UPTIME(x) +#define IF_NOT_UPTIME(x) x #undef CONFIG_FEATURE_UPTIME_UTMP_SUPPORT #define ENABLE_FEATURE_UPTIME_UTMP_SUPPORT 0 -#define IF_FEATURE_UPTIME_UTMP_SUPPORT(...) -#define IF_NOT_FEATURE_UPTIME_UTMP_SUPPORT(...) __VA_ARGS__ +#define IF_FEATURE_UPTIME_UTMP_SUPPORT(x) +#define IF_NOT_FEATURE_UPTIME_UTMP_SUPPORT(x) x #undef CONFIG_FREE #define ENABLE_FREE 0 -#define IF_FREE(...) -#define IF_NOT_FREE(...) __VA_ARGS__ +#define IF_FREE(x) +#define IF_NOT_FREE(x) x #undef CONFIG_FUSER #define ENABLE_FUSER 0 -#define IF_FUSER(...) -#define IF_NOT_FUSER(...) __VA_ARGS__ +#define IF_FUSER(x) +#define IF_NOT_FUSER(x) x #undef CONFIG_KILL #define ENABLE_KILL 0 -#define IF_KILL(...) -#define IF_NOT_KILL(...) __VA_ARGS__ +#define IF_KILL(x) +#define IF_NOT_KILL(x) x #undef CONFIG_KILLALL #define ENABLE_KILLALL 0 -#define IF_KILLALL(...) -#define IF_NOT_KILLALL(...) __VA_ARGS__ +#define IF_KILLALL(x) +#define IF_NOT_KILLALL(x) x #undef CONFIG_KILLALL5 #define ENABLE_KILLALL5 0 -#define IF_KILLALL5(...) -#define IF_NOT_KILLALL5(...) __VA_ARGS__ +#define IF_KILLALL5(x) +#define IF_NOT_KILLALL5(x) x #undef CONFIG_PGREP #define ENABLE_PGREP 0 -#define IF_PGREP(...) -#define IF_NOT_PGREP(...) __VA_ARGS__ +#define IF_PGREP(x) +#define IF_NOT_PGREP(x) x #undef CONFIG_PIDOF #define ENABLE_PIDOF 0 -#define IF_PIDOF(...) -#define IF_NOT_PIDOF(...) __VA_ARGS__ +#define IF_PIDOF(x) +#define IF_NOT_PIDOF(x) x #undef CONFIG_FEATURE_PIDOF_SINGLE #define ENABLE_FEATURE_PIDOF_SINGLE 0 -#define IF_FEATURE_PIDOF_SINGLE(...) -#define IF_NOT_FEATURE_PIDOF_SINGLE(...) __VA_ARGS__ +#define IF_FEATURE_PIDOF_SINGLE(x) +#define IF_NOT_FEATURE_PIDOF_SINGLE(x) x #undef CONFIG_FEATURE_PIDOF_OMIT #define ENABLE_FEATURE_PIDOF_OMIT 0 -#define IF_FEATURE_PIDOF_OMIT(...) -#define IF_NOT_FEATURE_PIDOF_OMIT(...) __VA_ARGS__ +#define IF_FEATURE_PIDOF_OMIT(x) +#define IF_NOT_FEATURE_PIDOF_OMIT(x) x #undef CONFIG_PKILL #define ENABLE_PKILL 0 -#define IF_PKILL(...) -#define IF_NOT_PKILL(...) __VA_ARGS__ +#define IF_PKILL(x) +#define IF_NOT_PKILL(x) x #undef CONFIG_PS #define ENABLE_PS 0 -#define IF_PS(...) -#define IF_NOT_PS(...) __VA_ARGS__ +#define IF_PS(x) +#define IF_NOT_PS(x) x #undef CONFIG_FEATURE_PS_WIDE #define ENABLE_FEATURE_PS_WIDE 0 -#define IF_FEATURE_PS_WIDE(...) -#define IF_NOT_FEATURE_PS_WIDE(...) __VA_ARGS__ +#define IF_FEATURE_PS_WIDE(x) +#define IF_NOT_FEATURE_PS_WIDE(x) x #undef CONFIG_FEATURE_PS_LONG #define ENABLE_FEATURE_PS_LONG 0 -#define IF_FEATURE_PS_LONG(...) -#define IF_NOT_FEATURE_PS_LONG(...) __VA_ARGS__ +#define IF_FEATURE_PS_LONG(x) +#define IF_NOT_FEATURE_PS_LONG(x) x #undef CONFIG_FEATURE_PS_TIME #define ENABLE_FEATURE_PS_TIME 0 -#define IF_FEATURE_PS_TIME(...) -#define IF_NOT_FEATURE_PS_TIME(...) __VA_ARGS__ +#define IF_FEATURE_PS_TIME(x) +#define IF_NOT_FEATURE_PS_TIME(x) x #undef CONFIG_FEATURE_PS_ADDITIONAL_COLUMNS #define ENABLE_FEATURE_PS_ADDITIONAL_COLUMNS 0 -#define IF_FEATURE_PS_ADDITIONAL_COLUMNS(...) -#define IF_NOT_FEATURE_PS_ADDITIONAL_COLUMNS(...) __VA_ARGS__ +#define IF_FEATURE_PS_ADDITIONAL_COLUMNS(x) +#define IF_NOT_FEATURE_PS_ADDITIONAL_COLUMNS(x) x #undef CONFIG_FEATURE_PS_UNUSUAL_SYSTEMS #define ENABLE_FEATURE_PS_UNUSUAL_SYSTEMS 0 -#define IF_FEATURE_PS_UNUSUAL_SYSTEMS(...) -#define IF_NOT_FEATURE_PS_UNUSUAL_SYSTEMS(...) __VA_ARGS__ +#define IF_FEATURE_PS_UNUSUAL_SYSTEMS(x) +#define IF_NOT_FEATURE_PS_UNUSUAL_SYSTEMS(x) x #undef CONFIG_RENICE #define ENABLE_RENICE 0 -#define IF_RENICE(...) -#define IF_NOT_RENICE(...) __VA_ARGS__ +#define IF_RENICE(x) +#define IF_NOT_RENICE(x) x #undef CONFIG_BB_SYSCTL #define ENABLE_BB_SYSCTL 0 -#define IF_BB_SYSCTL(...) -#define IF_NOT_BB_SYSCTL(...) __VA_ARGS__ +#define IF_BB_SYSCTL(x) +#define IF_NOT_BB_SYSCTL(x) x #undef CONFIG_FEATURE_SHOW_THREADS #define ENABLE_FEATURE_SHOW_THREADS 0 -#define IF_FEATURE_SHOW_THREADS(...) -#define IF_NOT_FEATURE_SHOW_THREADS(...) __VA_ARGS__ +#define IF_FEATURE_SHOW_THREADS(x) +#define IF_NOT_FEATURE_SHOW_THREADS(x) x #undef CONFIG_WATCH #define ENABLE_WATCH 0 -#define IF_WATCH(...) -#define IF_NOT_WATCH(...) __VA_ARGS__ +#define IF_WATCH(x) +#define IF_NOT_WATCH(x) x /* * Runit Utilities */ #undef CONFIG_SESTATUS #define ENABLE_SESTATUS 0 -#define IF_SESTATUS(...) -#define IF_NOT_SESTATUS(...) __VA_ARGS__ +#define IF_SESTATUS(x) +#define IF_NOT_SESTATUS(x) x /* * Shells */ #ifdef MAKE_SUID -# define IF_CTTYHACK(...) __VA_ARGS__ "CONFIG_CTTYHACK" +# define IF_CTTYHACK(x) x "CONFIG_CTTYHACK" #else -# define IF_CTTYHACK(...) __VA_ARGS__ +# define IF_CTTYHACK(x) x #endif -#define IF_NOT_CTTYHACK(...) +#define IF_NOT_CTTYHACK(x) #define CONFIG_HUSH 1 #define ENABLE_HUSH 1 #ifdef MAKE_SUID -# define IF_HUSH(...) __VA_ARGS__ "CONFIG_HUSH" +# define IF_HUSH(x) x "CONFIG_HUSH" #else -# define IF_HUSH(...) __VA_ARGS__ +# define IF_HUSH(x) x #endif -#define IF_NOT_HUSH(...) +#define IF_NOT_HUSH(x) #define CONFIG_HUSH_BASH_COMPAT 1 #define ENABLE_HUSH_BASH_COMPAT 1 #ifdef MAKE_SUID -# define IF_HUSH_BASH_COMPAT(...) __VA_ARGS__ "CONFIG_HUSH_BASH_COMPAT" +# define IF_HUSH_BASH_COMPAT(x) x "CONFIG_HUSH_BASH_COMPAT" #else -# define IF_HUSH_BASH_COMPAT(...) __VA_ARGS__ +# define IF_HUSH_BASH_COMPAT(x) x #endif -#define IF_NOT_HUSH_BASH_COMPAT(...) +#define IF_NOT_HUSH_BASH_COMPAT(x) #define CONFIG_HUSH_BRACE_EXPANSION 1 #define ENABLE_HUSH_BRACE_EXPANSION 1 #ifdef MAKE_SUID -# define IF_HUSH_BRACE_EXPANSION(...) __VA_ARGS__ "CONFIG_HUSH_BRACE_EXPANSION" +# define IF_HUSH_BRACE_EXPANSION(x) x "CONFIG_HUSH_BRACE_EXPANSION" #else -# define IF_HUSH_BRACE_EXPANSION(...) __VA_ARGS__ +# define IF_HUSH_BRACE_EXPANSION(x) x #endif -#define IF_NOT_HUSH_BRACE_EXPANSION(...) +#define IF_NOT_HUSH_BRACE_EXPANSION(x) #define CONFIG_HUSH_HELP 1 #define ENABLE_HUSH_HELP 1 #ifdef MAKE_SUID -# define IF_HUSH_HELP(...) __VA_ARGS__ "CONFIG_HUSH_HELP" +# define IF_HUSH_HELP(x) x "CONFIG_HUSH_HELP" #else -# define IF_HUSH_HELP(...) __VA_ARGS__ +# define IF_HUSH_HELP(x) x #endif -#define IF_NOT_HUSH_HELP(...) +#define IF_NOT_HUSH_HELP(x) #define CONFIG_HUSH_INTERACTIVE 1 #define ENABLE_HUSH_INTERACTIVE 1 #ifdef MAKE_SUID -# define IF_HUSH_INTERACTIVE(...) __VA_ARGS__ "CONFIG_HUSH_INTERACTIVE" +# define IF_HUSH_INTERACTIVE(x) x "CONFIG_HUSH_INTERACTIVE" #else -# define IF_HUSH_INTERACTIVE(...) __VA_ARGS__ +# define IF_HUSH_INTERACTIVE(x) x #endif -#define IF_NOT_HUSH_INTERACTIVE(...) +#define IF_NOT_HUSH_INTERACTIVE(x) #define CONFIG_HUSH_SAVEHISTORY 1 #define ENABLE_HUSH_SAVEHISTORY 1 #ifdef MAKE_SUID -# define IF_HUSH_SAVEHISTORY(...) __VA_ARGS__ "CONFIG_HUSH_SAVEHISTORY" +# define IF_HUSH_SAVEHISTORY(x) x "CONFIG_HUSH_SAVEHISTORY" #else -# define IF_HUSH_SAVEHISTORY(...) __VA_ARGS__ +# define IF_HUSH_SAVEHISTORY(x) x #endif -#define IF_NOT_HUSH_SAVEHISTORY(...) +#define IF_NOT_HUSH_SAVEHISTORY(x) #define CONFIG_HUSH_JOB 1 #define ENABLE_HUSH_JOB 1 #ifdef MAKE_SUID -# define IF_HUSH_JOB(...) __VA_ARGS__ "CONFIG_HUSH_JOB" +# define IF_HUSH_JOB(x) x "CONFIG_HUSH_JOB" #else -# define IF_HUSH_JOB(...) __VA_ARGS__ +# define IF_HUSH_JOB(x) x #endif -#define IF_NOT_HUSH_JOB(...) +#define IF_NOT_HUSH_JOB(x) #define CONFIG_HUSH_TICK 1 #define ENABLE_HUSH_TICK 1 #ifdef MAKE_SUID -# define IF_HUSH_TICK(...) __VA_ARGS__ "CONFIG_HUSH_TICK" +# define IF_HUSH_TICK(x) x "CONFIG_HUSH_TICK" #else -# define IF_HUSH_TICK(...) __VA_ARGS__ +# define IF_HUSH_TICK(x) x #endif -#define IF_NOT_HUSH_TICK(...) +#define IF_NOT_HUSH_TICK(x) #define CONFIG_HUSH_IF 1 #define ENABLE_HUSH_IF 1 #ifdef MAKE_SUID -# define IF_HUSH_IF(...) __VA_ARGS__ "CONFIG_HUSH_IF" +# define IF_HUSH_IF(x) x "CONFIG_HUSH_IF" #else -# define IF_HUSH_IF(...) __VA_ARGS__ +# define IF_HUSH_IF(x) x #endif -#define IF_NOT_HUSH_IF(...) +#define IF_NOT_HUSH_IF(x) #define CONFIG_HUSH_LOOPS 1 #define ENABLE_HUSH_LOOPS 1 #ifdef MAKE_SUID -# define IF_HUSH_LOOPS(...) __VA_ARGS__ "CONFIG_HUSH_LOOPS" +# define IF_HUSH_LOOPS(x) x "CONFIG_HUSH_LOOPS" #else -# define IF_HUSH_LOOPS(...) __VA_ARGS__ +# define IF_HUSH_LOOPS(x) x #endif -#define IF_NOT_HUSH_LOOPS(...) +#define IF_NOT_HUSH_LOOPS(x) #define CONFIG_HUSH_CASE 1 #define ENABLE_HUSH_CASE 1 #ifdef MAKE_SUID -# define IF_HUSH_CASE(...) __VA_ARGS__ "CONFIG_HUSH_CASE" +# define IF_HUSH_CASE(x) x "CONFIG_HUSH_CASE" #else -# define IF_HUSH_CASE(...) __VA_ARGS__ +# define IF_HUSH_CASE(x) x #endif -#define IF_NOT_HUSH_CASE(...) +#define IF_NOT_HUSH_CASE(x) #define CONFIG_HUSH_FUNCTIONS 1 #define ENABLE_HUSH_FUNCTIONS 1 #ifdef MAKE_SUID -# define IF_HUSH_FUNCTIONS(...) __VA_ARGS__ "CONFIG_HUSH_FUNCTIONS" +# define IF_HUSH_FUNCTIONS(x) x "CONFIG_HUSH_FUNCTIONS" #else -# define IF_HUSH_FUNCTIONS(...) __VA_ARGS__ +# define IF_HUSH_FUNCTIONS(x) x #endif -#define IF_NOT_HUSH_FUNCTIONS(...) +#define IF_NOT_HUSH_FUNCTIONS(x) #define CONFIG_HUSH_LOCAL 1 #define ENABLE_HUSH_LOCAL 1 #ifdef MAKE_SUID -# define IF_HUSH_LOCAL(...) __VA_ARGS__ "CONFIG_HUSH_LOCAL" +# define IF_HUSH_LOCAL(x) x "CONFIG_HUSH_LOCAL" #else -# define IF_HUSH_LOCAL(...) __VA_ARGS__ +# define IF_HUSH_LOCAL(x) x #endif -#define IF_NOT_HUSH_LOCAL(...) +#define IF_NOT_HUSH_LOCAL(x) #define CONFIG_HUSH_RANDOM_SUPPORT 1 #define ENABLE_HUSH_RANDOM_SUPPORT 1 #ifdef MAKE_SUID -# define IF_HUSH_RANDOM_SUPPORT(...) __VA_ARGS__ "CONFIG_HUSH_RANDOM_SUPPORT" +# define IF_HUSH_RANDOM_SUPPORT(x) x "CONFIG_HUSH_RANDOM_SUPPORT" #else -# define IF_HUSH_RANDOM_SUPPORT(...) __VA_ARGS__ +# define IF_HUSH_RANDOM_SUPPORT(x) x #endif -#define IF_NOT_HUSH_RANDOM_SUPPORT(...) +#define IF_NOT_HUSH_RANDOM_SUPPORT(x) #define CONFIG_HUSH_EXPORT_N 1 #define ENABLE_HUSH_EXPORT_N 1 #ifdef MAKE_SUID -# define IF_HUSH_EXPORT_N(...) __VA_ARGS__ "CONFIG_HUSH_EXPORT_N" +# define IF_HUSH_EXPORT_N(x) x "CONFIG_HUSH_EXPORT_N" #else -# define IF_HUSH_EXPORT_N(...) __VA_ARGS__ +# define IF_HUSH_EXPORT_N(x) x #endif -#define IF_NOT_HUSH_EXPORT_N(...) +#define IF_NOT_HUSH_EXPORT_N(x) #define CONFIG_HUSH_MODE_X 1 #define ENABLE_HUSH_MODE_X 1 #ifdef MAKE_SUID -# define IF_HUSH_MODE_X(...) __VA_ARGS__ "CONFIG_HUSH_MODE_X" +# define IF_HUSH_MODE_X(x) x "CONFIG_HUSH_MODE_X" #else -# define IF_HUSH_MODE_X(...) __VA_ARGS__ +# define IF_HUSH_MODE_X(x) x #endif -#define IF_NOT_HUSH_MODE_X(...) +#define IF_NOT_HUSH_MODE_X(x) #undef CONFIG_MSH #define ENABLE_MSH 0 -#define IF_MSH(...) -#define IF_NOT_MSH(...) __VA_ARGS__ +#define IF_MSH(x) +#define IF_NOT_MSH(x) x #undef CONFIG_FEATURE_SH_IS_ASH #define ENABLE_FEATURE_SH_IS_ASH 0 -#define IF_FEATURE_SH_IS_ASH(...) -#define IF_NOT_FEATURE_SH_IS_ASH(...) __VA_ARGS__ +#define IF_FEATURE_SH_IS_ASH(x) +#define IF_NOT_FEATURE_SH_IS_ASH(x) x #define CONFIG_FEATURE_SH_IS_HUSH 1 #define ENABLE_FEATURE_SH_IS_HUSH 1 #ifdef MAKE_SUID -# define IF_FEATURE_SH_IS_HUSH(...) __VA_ARGS__ "CONFIG_FEATURE_SH_IS_HUSH" +# define IF_FEATURE_SH_IS_HUSH(x) x "CONFIG_FEATURE_SH_IS_HUSH" #else -# define IF_FEATURE_SH_IS_HUSH(...) __VA_ARGS__ +# define IF_FEATURE_SH_IS_HUSH(x) x #endif -#define IF_NOT_FEATURE_SH_IS_HUSH(...) +#define IF_NOT_FEATURE_SH_IS_HUSH(x) #undef CONFIG_FEATURE_SH_IS_NONE #define ENABLE_FEATURE_SH_IS_NONE 0 -#define IF_FEATURE_SH_IS_NONE(...) -#define IF_NOT_FEATURE_SH_IS_NONE(...) __VA_ARGS__ +#define IF_FEATURE_SH_IS_NONE(x) +#define IF_NOT_FEATURE_SH_IS_NONE(x) x #undef CONFIG_FEATURE_BASH_IS_ASH #define ENABLE_FEATURE_BASH_IS_ASH 0 -#define IF_FEATURE_BASH_IS_ASH(...) -#define IF_NOT_FEATURE_BASH_IS_ASH(...) __VA_ARGS__ +#define IF_FEATURE_BASH_IS_ASH(x) +#define IF_NOT_FEATURE_BASH_IS_ASH(x) x #undef CONFIG_FEATURE_BASH_IS_HUSH #define ENABLE_FEATURE_BASH_IS_HUSH 0 -#define IF_FEATURE_BASH_IS_HUSH(...) -#define IF_NOT_FEATURE_BASH_IS_HUSH(...) __VA_ARGS__ +#define IF_FEATURE_BASH_IS_HUSH(x) +#define IF_NOT_FEATURE_BASH_IS_HUSH(x) x #define CONFIG_FEATURE_BASH_IS_NONE 1 #define ENABLE_FEATURE_BASH_IS_NONE 1 #ifdef MAKE_SUID -# define IF_FEATURE_BASH_IS_NONE(...) __VA_ARGS__ "CONFIG_FEATURE_BASH_IS_NONE" +# define IF_FEATURE_BASH_IS_NONE(x) x "CONFIG_FEATURE_BASH_IS_NONE" #else -# define IF_FEATURE_BASH_IS_NONE(...) __VA_ARGS__ +# define IF_FEATURE_BASH_IS_NONE(x) x #endif -#define IF_NOT_FEATURE_BASH_IS_NONE(...) +#define IF_NOT_FEATURE_BASH_IS_NONE(x) #define CONFIG_SH_MATH_SUPPORT 1 #define ENABLE_SH_MATH_SUPPORT 1 #ifdef MAKE_SUID -# define IF_SH_MATH_SUPPORT(...) __VA_ARGS__ "CONFIG_SH_MATH_SUPPORT" +# define IF_SH_MATH_SUPPORT(x) x "CONFIG_SH_MATH_SUPPORT" #else -# define IF_SH_MATH_SUPPORT(...) __VA_ARGS__ +# define IF_SH_MATH_SUPPORT(x) x #endif -#define IF_NOT_SH_MATH_SUPPORT(...) +#define IF_NOT_SH_MATH_SUPPORT(x) #undef CONFIG_SH_MATH_SUPPORT_64 #define ENABLE_SH_MATH_SUPPORT_64 0 #ifdef MAKE_SUID -# define IF_SH_MATH_SUPPORT_64(...) +# define IF_SH_MATH_SUPPORT_64(x) #else -# define IF_SH_MATH_SUPPORT_64(...) +# define IF_SH_MATH_SUPPORT_64(x) #endif -#define IF_NOT_SH_MATH_SUPPORT_64(...) __VA_ARGS__ +#define IF_NOT_SH_MATH_SUPPORT_64(x) x #define CONFIG_FEATURE_SH_EXTRA_QUIET 1 #define ENABLE_FEATURE_SH_EXTRA_QUIET 1 #ifdef MAKE_SUID -# define IF_FEATURE_SH_EXTRA_QUIET(...) __VA_ARGS__ "CONFIG_FEATURE_SH_EXTRA_QUIET" +# define IF_FEATURE_SH_EXTRA_QUIET(x) x "CONFIG_FEATURE_SH_EXTRA_QUIET" #else -# define IF_FEATURE_SH_EXTRA_QUIET(...) __VA_ARGS__ +# define IF_FEATURE_SH_EXTRA_QUIET(x) x #endif -#define IF_NOT_FEATURE_SH_EXTRA_QUIET(...) +#define IF_NOT_FEATURE_SH_EXTRA_QUIET(x) #undef CONFIG_FEATURE_SH_STANDALONE #define ENABLE_FEATURE_SH_STANDALONE 0 -#define IF_FEATURE_SH_STANDALONE(...) -#define IF_NOT_FEATURE_SH_STANDALONE(...) __VA_ARGS__ +#define IF_FEATURE_SH_STANDALONE(x) +#define IF_NOT_FEATURE_SH_STANDALONE(x) x #undef CONFIG_FEATURE_SH_NOFORK #define ENABLE_FEATURE_SH_NOFORK 0 -#define IF_FEATURE_SH_NOFORK(...) -#define IF_NOT_FEATURE_SH_NOFORK(...) __VA_ARGS__ +#define IF_FEATURE_SH_NOFORK(x) +#define IF_NOT_FEATURE_SH_NOFORK(x) x #define CONFIG_FEATURE_SH_HISTFILESIZE 1 #define ENABLE_FEATURE_SH_HISTFILESIZE 1 #ifdef MAKE_SUID -# define IF_FEATURE_SH_HISTFILESIZE(...) __VA_ARGS__ "CONFIG_FEATURE_SH_HISTFILESIZE" +# define IF_FEATURE_SH_HISTFILESIZE(x) x "CONFIG_FEATURE_SH_HISTFILESIZE" #else -# define IF_FEATURE_SH_HISTFILESIZE(...) __VA_ARGS__ +# define IF_FEATURE_SH_HISTFILESIZE(x) x #endif -#define IF_NOT_FEATURE_SH_HISTFILESIZE(...) +#define IF_NOT_FEATURE_SH_HISTFILESIZE(x) #define ENABLE_FEATURE_VERBOSE 0 diff --git a/include/libbb.h b/include/libbb.h index 4f4d5537d..28a6a2837 100644 --- a/include/libbb.h +++ b/include/libbb.h @@ -16,7 +16,6 @@ #include #include #include -#include #include #include #include @@ -26,7 +25,6 @@ # define sigemptyset(s) __sigemptyset(s) # define sigisemptyset(s) __sigisemptyset(s) #endif -#include #include #include #include @@ -34,12 +32,14 @@ #include /* There are two incompatible basename's, let's not use them! */ /* See the dirname/basename man page for details */ -#include /* dirname,basename */ #undef basename #define basename dont_use_basename -#include +#ifndef __GNO__ +# include +#else +//TODO Deal with lack of poll in GNO +#endif #include -#include #include #include #include @@ -65,12 +65,6 @@ # define endpwent() ((void)0) # define endgrent() ((void)0) #endif -#ifdef HAVE_MNTENT_H -# include -#endif -#ifdef HAVE_SYS_STATFS_H -# include -#endif /* Don't do this here: * #include * Some linux/ includes pull in conflicting definition @@ -298,11 +292,6 @@ extern int *const bb_errno; #define errno (*bb_errno) #endif -#if !(ULONG_MAX > 0xffffffff) -/* Only 32-bit CPUs need this, 64-bit ones use inlined version */ -uint64_t bb_bswap_64(uint64_t x) FAST_FUNC; -#endif - unsigned long monotonic_sec(void) FAST_FUNC; extern void chomp(char *s) FAST_FUNC; @@ -330,9 +319,7 @@ enum { /* DO NOT CHANGE THESE VALUES! cp.c, mv.c, install.c depend on them. */ FILEUTILS_PRESERVE_SECURITY_CONTEXT = 1 << 9, /* -c */ FILEUTILS_SET_SECURITY_CONTEXT = 1 << 10, #endif - FILEUTILS_IGNORE_CHMOD_ERR = 1 << 11, - /* -v */ - FILEUTILS_VERBOSE = (1 << 12) * ENABLE_FEATURE_VERBOSE, + FILEUTILS_IGNORE_CHMOD_ERR = 1 << 11 }; #define FILEUTILS_CP_OPTSTR "pdRfilsLH" IF_SELINUX("c") extern int remove_file(const char *path, int flags) FAST_FUNC; @@ -349,7 +336,7 @@ enum { ACTION_DEPTHFIRST = (1 << 3), /*ACTION_REVERSE = (1 << 4), - unused */ ACTION_QUIET = (1 << 5), - ACTION_DANGLING_OK = (1 << 6), + ACTION_DANGLING_OK = (1 << 6) }; typedef uint8_t recurse_flags_t; extern int recursive_action(const char *fileName, unsigned flags, @@ -436,7 +423,7 @@ enum { + (1LL << SIGXFSZ) // File size limit exceeded + (1LL << SIGUSR1) // Yes kids, these are also fatal! + (1LL << SIGUSR2) - + 0), + + 0) }; void bb_signals(int sigs, void (*f)(int)) FAST_FUNC; /* Unlike signal() and bb_signals, sets handler with sigaction() @@ -497,33 +484,6 @@ struct fd_pair { int rd; int wr; }; #define piped_pair(pair) pipe(&((pair).rd)) #define xpiped_pair(pair) xpipe(&((pair).rd)) -/* Useful for having small structure members/global variables */ -typedef int8_t socktype_t; -typedef int8_t family_t; -struct BUG_too_small { - char BUG_socktype_t_too_small[(0 - | SOCK_STREAM - | SOCK_DGRAM - | SOCK_RDM - | SOCK_SEQPACKET - | SOCK_RAW - ) <= 127 ? 1 : -1]; - char BUG_family_t_too_small[(0 - | AF_UNSPEC - | AF_INET - | AF_INET6 - | AF_UNIX -#ifdef AF_PACKET - | AF_PACKET -#endif -#ifdef AF_NETLINK - | AF_NETLINK -#endif - /* | AF_DECnet */ - /* | AF_IPX */ - ) <= 127 ? 1 : -1]; -}; - void parse_datestr(const char *date_str, struct tm *ptm) FAST_FUNC; time_t validate_tm_time(const char *date_str, struct tm *ptm) FAST_FUNC; @@ -557,18 +517,7 @@ typedef struct len_and_sockaddr { #endif } u; } len_and_sockaddr; -enum { - LSA_LEN_SIZE = offsetof(len_and_sockaddr, u), - LSA_SIZEOF_SA = sizeof( - union { - struct sockaddr sa; - struct sockaddr_in sin; -#if ENABLE_FEATURE_IPV6 - struct sockaddr_in6 sin6; -#endif - } - ) -}; + /* Create stream socket, and allocate suitable lsa. * (lsa of correct size and lsa->sa.sa_family (AF_INET/AF_INET6)) * af == AF_UNSPEC will result in trying to create IPv6 socket, @@ -688,7 +637,7 @@ void fputc_printable(int ch, FILE *file) FAST_FUNC; * Buffer must hold at least four characters. */ enum { VISIBLE_ENDLINE = 1 << 0, - VISIBLE_SHOW_TABS = 1 << 1, + VISIBLE_SHOW_TABS = 1 << 1 }; void visible(unsigned ch, char *buf, int flags) FAST_FUNC; @@ -746,17 +695,6 @@ unsigned bb_clk_tck(void) FAST_FUNC; || ENABLE_FEATURE_SEAMLESS_GZ \ || ENABLE_FEATURE_SEAMLESS_Z) -#if SEAMLESS_COMPRESSION -/* Autodetects gzip/bzip2 formats. fd may be in the middle of the file! */ -extern int setup_unzip_on_fd(int fd, int fail_if_not_compressed) FAST_FUNC; -/* Autodetects .gz etc */ -extern int open_zipped(const char *fname, int fail_if_not_compressed) FAST_FUNC; -#else -# define setup_unzip_on_fd(...) (0) -# define open_zipped(fname, fail_if_not_compressed) open((fname), O_RDONLY); -#endif -extern void *xmalloc_open_zipped_read_close(const char *fname, size_t *maxsz_p) FAST_FUNC RETURNS_MALLOC; - extern ssize_t safe_write(int fd, const void *buf, size_t count) FAST_FUNC; // NB: will return short write on error, not -1, // if some data was written before error occurred @@ -817,7 +755,11 @@ void qsort_string_vector(char **sv, unsigned count) FAST_FUNC; * On other errors complains [perror("poll")] and returns. * Warning! May take (much) longer than timeout_ms to return! * If this is a problem, use bare poll and open-code EINTR/ENOMEM handling */ +#ifndef __GNO__ int safe_poll(struct pollfd *ufds, nfds_t nfds, int timeout_ms) FAST_FUNC; +#else +//TODO Deal with lack of poll in GNO +#endif char *safe_gethostname(void) FAST_FUNC; @@ -933,7 +875,6 @@ int BB_EXECVP(const char *file, char *const argv[]) FAST_FUNC; } while (0) #else #define BB_EXECVP(prog,cmd) execvp(prog,cmd) -#define BB_EXECLP(prog,cmd,...) execlp(prog,cmd,__VA_ARGS__) #endif int BB_EXECVP_or_die(char **argv) NORETURN FAST_FUNC; @@ -998,7 +939,7 @@ enum { DAEMON_DEVNULL_STDIO = 2, DAEMON_CLOSE_EXTRA_FDS = 4, DAEMON_ONLY_SANITIZE = 8, /* internal use */ - DAEMON_DOUBLE_FORK = 16, /* double fork to avoid controlling tty */ + DAEMON_DOUBLE_FORK = 16 /* double fork to avoid controlling tty */ }; #if BB_MMU enum { re_execed = 0 }; @@ -1010,7 +951,6 @@ enum { /* Note: re_exec() and fork_or_rexec() do argv[0][0] |= 0x80 on NOMMU! * _Parent_ needs to undo it if it doesn't want to have argv[0] mangled. */ - void re_exec(char **argv) NORETURN FAST_FUNC; pid_t fork_or_rexec(char **argv) FAST_FUNC; int BUG_fork_is_unavailable_on_nommu(void) FAST_FUNC; int BUG_daemon_is_unavailable_on_nommu(void) FAST_FUNC; @@ -1077,9 +1017,7 @@ enum { wrote_pidfile = 0 }; enum { LOGMODE_NONE = 0, - LOGMODE_STDIO = (1 << 0), - LOGMODE_SYSLOG = (1 << 1) * ENABLE_FEATURE_SYSLOG, - LOGMODE_BOTH = LOGMODE_SYSLOG + LOGMODE_STDIO, + LOGMODE_STDIO = (1 << 0) }; extern const char *msg_eol; extern smallint syslog_level; @@ -1115,14 +1053,14 @@ extern void bb_verror_msg(const char *s, va_list p, const char *strerr) FAST_FUN /* Applets which are useful from another applets */ int bb_cat(char** argv); /* If shell needs them, they exist even if not enabled as applets */ -int echo_main(int argc, char** argv) IF_ECHO(MAIN_EXTERNALLY_VISIBLE); -int printf_main(int argc, char **argv) IF_PRINTF(MAIN_EXTERNALLY_VISIBLE); -int test_main(int argc, char **argv) IF_TEST(MAIN_EXTERNALLY_VISIBLE); -int kill_main(int argc, char **argv) IF_KILL(MAIN_EXTERNALLY_VISIBLE); +int echo_main(int argc, char** argv); +int printf_main(int argc, char **argv); +int test_main(int argc, char **argv); +int kill_main(int argc, char **argv); /* Similar, but used by chgrp, not shell */ -int chown_main(int argc, char **argv) IF_CHOWN(MAIN_EXTERNALLY_VISIBLE); +int chown_main(int argc, char **argv); /* Used by ftpd */ -int ls_main(int argc, char **argv) IF_LS(MAIN_EXTERNALLY_VISIBLE); +int ls_main(int argc, char **argv); /* Don't need IF_xxx() guard for these */ int gunzip_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; int bunzip2_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; @@ -1208,23 +1146,6 @@ int bb_parse_mode(const char* s, mode_t* theMode) FAST_FUNC; /* * Config file parser */ -enum { - PARSE_COLLAPSE = 0x00010000, // treat consecutive delimiters as one - PARSE_TRIM = 0x00020000, // trim leading and trailing delimiters -// TODO: COLLAPSE and TRIM seem to always go in pair - PARSE_GREEDY = 0x00040000, // last token takes entire remainder of the line - PARSE_MIN_DIE = 0x00100000, // die if < min tokens found - // keep a copy of current line - PARSE_KEEP_COPY = 0x00200000 * ENABLE_FEATURE_CROND_D, - PARSE_EOL_COMMENTS = 0x00400000, // comments are recognized even if they aren't the first char - // NORMAL is: - // * remove leading and trailing delimiters and collapse - // multiple delimiters into one - // * warn and continue if less than mintokens delimiters found - // * grab everything into last token - // * comments are recognized even if they aren't the first char - PARSE_NORMAL = PARSE_COLLAPSE | PARSE_TRIM | PARSE_GREEDY | PARSE_EOL_COMMENTS, -}; typedef struct parser_t { FILE *fp; char *data; @@ -1449,7 +1370,7 @@ enum { * -1: poll(-1) (i.e. block); * >=0: poll for TIMEOUT milliseconds, return -1/EAGAIN on timeout */ -int64_t read_key(int fd, char *buffer, int timeout) FAST_FUNC; +int32_t read_key(int fd, char *buffer, int timeout) FAST_FUNC; void read_key_ungets(char *buffer, const char *str, unsigned len) FAST_FUNC; @@ -1487,7 +1408,7 @@ enum { USERNAME_COMPLETION = 4 * ENABLE_FEATURE_USERNAME_COMPLETION, VI_MODE = 8 * ENABLE_FEATURE_EDITING_VI, WITH_PATH_LOOKUP = 0x10, - FOR_SHELL = DO_HISTORY | TAB_COMPLETION | USERNAME_COMPLETION, + FOR_SHELL = DO_HISTORY | TAB_COMPLETION | USERNAME_COMPLETION }; line_input_t *new_line_input_t(int flags) FAST_FUNC; /* So far static: void free_line_input_t(line_input_t *n) FAST_FUNC; */ @@ -1542,82 +1463,7 @@ struct smaprec { int FAST_FUNC procps_read_smaps(pid_t pid, struct smaprec *total, void (*cb)(struct smaprec *, void *), void *data); -typedef struct procps_status_t { - DIR *dir; - IF_FEATURE_SHOW_THREADS(DIR *task_dir;) - uint8_t shift_pages_to_bytes; - uint8_t shift_pages_to_kb; -/* Fields are set to 0/NULL if failed to determine (or not requested) */ - uint16_t argv_len; - char *argv0; - char *exe; - IF_SELINUX(char *context;) - IF_FEATURE_SHOW_THREADS(unsigned main_thread_pid;) - /* Everything below must contain no ptrs to malloc'ed data: - * it is memset(0) for each process in procps_scan() */ - unsigned long vsz, rss; /* we round it to kbytes */ - unsigned long stime, utime; - unsigned long start_time; - unsigned pid; - unsigned ppid; - unsigned pgid; - unsigned sid; - unsigned uid; - unsigned gid; -#if ENABLE_FEATURE_PS_ADDITIONAL_COLUMNS - unsigned ruid; - unsigned rgid; - int niceness; -#endif - unsigned tty_major,tty_minor; -#if ENABLE_FEATURE_TOPMEM - struct smaprec smaps; -#endif - char state[4]; - /* basename of executable in exec(2), read from /proc/N/stat - * (if executable is symlink or script, it is NOT replaced - * by link target or interpreter name) */ - char comm[COMM_LEN]; - /* user/group? - use passwd/group parsing functions */ -#if ENABLE_FEATURE_TOP_SMP_PROCESS - int last_seen_on_cpu; -#endif -} procps_status_t; -/* flag bits for procps_scan(xx, flags) calls */ -enum { - PSSCAN_PID = 1 << 0, - PSSCAN_PPID = 1 << 1, - PSSCAN_PGID = 1 << 2, - PSSCAN_SID = 1 << 3, - PSSCAN_UIDGID = 1 << 4, - PSSCAN_COMM = 1 << 5, - /* PSSCAN_CMD = 1 << 6, - use read_cmdline instead */ - PSSCAN_ARGV0 = 1 << 7, - PSSCAN_EXE = 1 << 8, - PSSCAN_STATE = 1 << 9, - PSSCAN_VSZ = 1 << 10, - PSSCAN_RSS = 1 << 11, - PSSCAN_STIME = 1 << 12, - PSSCAN_UTIME = 1 << 13, - PSSCAN_TTY = 1 << 14, - PSSCAN_SMAPS = (1 << 15) * ENABLE_FEATURE_TOPMEM, - /* NB: used by find_pid_by_name(). Any applet using it - * needs to be mentioned here. */ - PSSCAN_ARGVN = (1 << 16) * (ENABLE_KILLALL - || ENABLE_PGREP || ENABLE_PKILL - || ENABLE_PIDOF - || ENABLE_SESTATUS - ), - PSSCAN_CONTEXT = (1 << 17) * ENABLE_SELINUX, - PSSCAN_START_TIME = 1 << 18, - PSSCAN_CPU = (1 << 19) * ENABLE_FEATURE_TOP_SMP_PROCESS, - PSSCAN_NICE = (1 << 20) * ENABLE_FEATURE_PS_ADDITIONAL_COLUMNS, - PSSCAN_RUIDGID = (1 << 21) * ENABLE_FEATURE_PS_ADDITIONAL_COLUMNS, - PSSCAN_TASKS = (1 << 22) * ENABLE_FEATURE_SHOW_THREADS, -}; -//procps_status_t* alloc_procps_scan(void) FAST_FUNC; -void free_procps_scan(procps_status_t* sp) FAST_FUNC; -procps_status_t* procps_scan(procps_status_t* sp, int flags) FAST_FUNC; + /* Format cmdline (up to col chars) into char buf[size] */ /* Puts [comm] if cmdline is empty (-> process is a kernel thread) */ void read_cmdline(char *buf, int size, unsigned pid, const char *comm) FAST_FUNC; @@ -1636,50 +1482,6 @@ unsigned get_cpu_count(void) FAST_FUNC; char *percent_decode_in_place(char *str, int strict) FAST_FUNC; -extern const char bb_uuenc_tbl_base64[] ALIGN1; -extern const char bb_uuenc_tbl_std[] ALIGN1; -void bb_uuencode(char *store, const void *s, int length, const char *tbl) FAST_FUNC; -enum { - BASE64_FLAG_UU_STOP = 0x100, - /* Sign-extends to a value which never matches fgetc result: */ - BASE64_FLAG_NO_STOP_CHAR = 0x80, -}; -const char *decode_base64(char **pp_dst, const char *src) FAST_FUNC; -void read_base64(FILE *src_stream, FILE *dst_stream, int flags) FAST_FUNC; - -typedef struct md5_ctx_t { - uint8_t wbuffer[64]; /* always correctly aligned for uint64_t */ - void (*process_block)(struct md5_ctx_t*) FAST_FUNC; - uint64_t total64; /* must be directly before hash[] */ - uint32_t hash[8]; /* 4 elements for md5, 5 for sha1, 8 for sha256 */ -} md5_ctx_t; -typedef struct md5_ctx_t sha1_ctx_t; -typedef struct md5_ctx_t sha256_ctx_t; -typedef struct sha512_ctx_t { - uint64_t total64[2]; /* must be directly before hash[] */ - uint64_t hash[8]; - uint8_t wbuffer[128]; /* always correctly aligned for uint64_t */ -} sha512_ctx_t; -typedef struct sha3_ctx_t { - uint64_t state[25]; - unsigned bytes_queued; -} sha3_ctx_t; -void md5_begin(md5_ctx_t *ctx) FAST_FUNC; -void md5_hash(md5_ctx_t *ctx, const void *buffer, size_t len) FAST_FUNC; -void md5_end(md5_ctx_t *ctx, void *resbuf) FAST_FUNC; -void sha1_begin(sha1_ctx_t *ctx) FAST_FUNC; -#define sha1_hash md5_hash -void sha1_end(sha1_ctx_t *ctx, void *resbuf) FAST_FUNC; -void sha256_begin(sha256_ctx_t *ctx) FAST_FUNC; -#define sha256_hash md5_hash -#define sha256_end sha1_end -void sha512_begin(sha512_ctx_t *ctx) FAST_FUNC; -void sha512_hash(sha512_ctx_t *ctx, const void *buffer, size_t len) FAST_FUNC; -void sha512_end(sha512_ctx_t *ctx, void *resbuf) FAST_FUNC; -void sha3_begin(sha3_ctx_t *ctx) FAST_FUNC; -void sha3_hash(sha3_ctx_t *ctx, const void *buffer, size_t len) FAST_FUNC; -void sha3_end(sha3_ctx_t *ctx, void *resbuf) FAST_FUNC; - extern uint32_t *global_crc32_table; uint32_t *crc32_filltable(uint32_t *tbl256, int endian) FAST_FUNC; uint32_t crc32_block_endian1(uint32_t val, const void *buf, unsigned len, uint32_t *crc_table) FAST_FUNC; diff --git a/include/platform.h b/include/platform.h index 6ed7506fb..84e55b5d6 100644 --- a/include/platform.h +++ b/include/platform.h @@ -7,6 +7,7 @@ #ifndef BB_PLATFORM_H #define BB_PLATFORM_H 1 +#include "autoconf.h" /* Convenience macros to test the version of gcc. */ #undef __GNUC_PREREQ @@ -70,7 +71,11 @@ # define UNUSED_PARAM_RESULT # endif #else -# define ALWAYS_INLINE inline +# ifdef __ORCAC__ +# define ALWAYS_INLINE +# else +# define ALWAYS_INLINE inline +# endif # define NOINLINE # define DEPRECATED # define UNUSED_PARAM_RESULT @@ -136,108 +141,20 @@ #endif -/* ---- Endian Detection ------------------------------------ */ - -#include -#if defined(__digital__) && defined(__unix__) -# include -#elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) \ - || defined(__APPLE__) -# include /* rlimit */ -# include -# define bswap_64 __bswap64 -# define bswap_32 __bswap32 -# define bswap_16 __bswap16 +#ifndef __ORCAC__ +# include #else -# include -# include -#endif - -#if defined(__BYTE_ORDER) && __BYTE_ORDER == __BIG_ENDIAN -# define BB_BIG_ENDIAN 1 -# define BB_LITTLE_ENDIAN 0 -#elif defined(__BYTE_ORDER) && __BYTE_ORDER == __LITTLE_ENDIAN -# define BB_BIG_ENDIAN 0 -# define BB_LITTLE_ENDIAN 1 -#elif defined(_BYTE_ORDER) && _BYTE_ORDER == _BIG_ENDIAN -# define BB_BIG_ENDIAN 1 -# define BB_LITTLE_ENDIAN 0 -#elif defined(_BYTE_ORDER) && _BYTE_ORDER == _LITTLE_ENDIAN -# define BB_BIG_ENDIAN 0 -# define BB_LITTLE_ENDIAN 1 -#elif defined(BYTE_ORDER) && BYTE_ORDER == BIG_ENDIAN -# define BB_BIG_ENDIAN 1 -# define BB_LITTLE_ENDIAN 0 -#elif defined(BYTE_ORDER) && BYTE_ORDER == LITTLE_ENDIAN -# define BB_BIG_ENDIAN 0 -# define BB_LITTLE_ENDIAN 1 -#elif defined(__386__) -# define BB_BIG_ENDIAN 0 -# define BB_LITTLE_ENDIAN 1 -#else -# error "Can't determine endianness" -#endif - -#if ULONG_MAX > 0xffffffff -# define bb_bswap_64(x) bswap_64(x) -#endif - -/* SWAP_LEnn means "convert CPU<->little_endian by swapping bytes" */ -#if BB_BIG_ENDIAN -# define SWAP_BE16(x) (x) -# define SWAP_BE32(x) (x) -# define SWAP_BE64(x) (x) -# define SWAP_LE16(x) bswap_16(x) -# define SWAP_LE32(x) bswap_32(x) -# define SWAP_LE64(x) bb_bswap_64(x) -# define IF_BIG_ENDIAN(...) __VA_ARGS__ -# define IF_LITTLE_ENDIAN(...) -#else -# define SWAP_BE16(x) bswap_16(x) -# define SWAP_BE32(x) bswap_32(x) -# define SWAP_BE64(x) bb_bswap_64(x) -# define SWAP_LE16(x) (x) -# define SWAP_LE32(x) (x) -# define SWAP_LE64(x) (x) -# define IF_BIG_ENDIAN(...) -# define IF_LITTLE_ENDIAN(...) __VA_ARGS__ -#endif - - -/* ---- Unaligned access ------------------------------------ */ - -#include -typedef int bb__aliased_int FIX_ALIASING; -typedef long bb__aliased_long FIX_ALIASING; -typedef uint16_t bb__aliased_uint16_t FIX_ALIASING; -typedef uint32_t bb__aliased_uint32_t FIX_ALIASING; -typedef uint64_t bb__aliased_uint64_t FIX_ALIASING; - -/* NB: unaligned parameter should be a pointer, aligned one - - * a lvalue. This makes it more likely to not swap them by mistake - */ -#if defined(i386) || defined(__x86_64__) || defined(__powerpc__) -# define move_from_unaligned_int(v, intp) ((v) = *(bb__aliased_int*)(intp)) -# define move_from_unaligned_long(v, longp) ((v) = *(bb__aliased_long*)(longp)) -# define move_from_unaligned16(v, u16p) ((v) = *(bb__aliased_uint16_t*)(u16p)) -# define move_from_unaligned32(v, u32p) ((v) = *(bb__aliased_uint32_t*)(u32p)) -# define move_to_unaligned16(u16p, v) (*(bb__aliased_uint16_t*)(u16p) = (v)) -# define move_to_unaligned32(u32p, v) (*(bb__aliased_uint32_t*)(u32p) = (v)) -/* #elif ... - add your favorite arch today! */ -#else -/* performs reasonably well (gcc usually inlines memcpy here) */ -# define move_from_unaligned_int(v, intp) (memcpy(&(v), (intp), sizeof(int))) -# define move_from_unaligned_long(v, longp) (memcpy(&(v), (longp), sizeof(long))) -# define move_from_unaligned16(v, u16p) (memcpy(&(v), (u16p), 2)) -# define move_from_unaligned32(v, u32p) (memcpy(&(v), (u32p), 4)) -# define move_to_unaligned16(u16p, v) do { \ - uint16_t __t = (v); \ - memcpy((u16p), &__t, 2); \ -} while (0) -# define move_to_unaligned32(u32p, v) do { \ - uint32_t __t = (v); \ - memcpy((u32p), &__t, 4); \ -} while (0) +typedef signed char int8_t; +typedef unsigned char uint8_t; +typedef short int16_t; +typedef unsigned short uint16_t; +typedef long int32_t; +typedef unsigned long uint32_t; +typedef long intmax_t; +typedef unsigned long uintmax_t; +# define PRIxMAX "lx" +# define PRIdMAX "ld" +typedef unsigned long uintptr_t; #endif @@ -254,7 +171,7 @@ typedef unsigned smalluint; #endif /* ISO C Standard: 7.16 Boolean type and values */ -#if (defined __digital__ && defined __unix__) +#if (defined __digital__ && defined __unix__) || defined(__ORCAC__) /* old system without (proper) C99 support */ # define bool smalluint #else @@ -319,12 +236,12 @@ typedef unsigned smalluint; UCLIBC_VERSION > KERNEL_VERSION(0, 9, 28) && \ !defined __ARCH_USE_MMU__) # define BB_MMU 0 -# define USE_FOR_NOMMU(...) __VA_ARGS__ -# define USE_FOR_MMU(...) +# define USE_FOR_NOMMU(x) x +# define USE_FOR_MMU(x) #else # define BB_MMU 1 -# define USE_FOR_NOMMU(...) -# define USE_FOR_MMU(...) __VA_ARGS__ +# define USE_FOR_NOMMU(x) +# define USE_FOR_MMU(x) x #endif #if defined(__digital__) && defined(__unix__) diff --git a/include/unicode.h b/include/unicode.h index 0317a2151..83f15b366 100644 --- a/include/unicode.h +++ b/include/unicode.h @@ -15,7 +15,7 @@ PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN enum { UNICODE_UNKNOWN = 0, UNICODE_OFF = 1, - UNICODE_ON = 2, + UNICODE_ON = 2 }; #define unicode_bidi_isrtl(wc) 0 @@ -56,7 +56,7 @@ size_t FAST_FUNC unicode_strlen(const char *string); /* Width on terminal */ size_t FAST_FUNC unicode_strwidth(const char *string); enum { - UNI_FLAG_PAD = (1 << 0), + UNI_FLAG_PAD = (1 << 0) }; //UNUSED: unsigned FAST_FUNC unicode_padding_to_width(unsigned width, const char *src); //UNUSED: char* FAST_FUNC unicode_conv_to_printable2(uni_stat_t *stats, const char *src, unsigned width, int flags); diff --git a/include/xatonum.h b/include/xatonum.h index 45ebbfc00..b512fc599 100644 --- a/include/xatonum.h +++ b/include/xatonum.h @@ -28,9 +28,6 @@ type xato##T##_range(const char *str, type l, type u) FAST_FUNC; \ type xato##T##_sfx(const char *str, const struct suffix_mult *sfx) FAST_FUNC; \ type xato##T(const char *str) FAST_FUNC; \ -/* Unsigned long long functions always exist */ -DECLARE_STR_CONV(long long, ll, ull) - /* Provides inline definitions of functions */ /* (useful for mapping them to the type of the same width) */ @@ -82,18 +79,10 @@ static ALWAYS_INLINE \ narrow xato##N(const char *str) \ { return xato##W(str); } \ -/* If long == long long, then just map them one-to-one */ -#if ULONG_MAX == ULLONG_MAX -DEFINE_EQUIV_STR_CONV(long, l, ll, ul, ull) -#else -/* Else provide extern defs */ DECLARE_STR_CONV(long, l, ul) -#endif /* Same for int -> [long] long */ -#if UINT_MAX == ULLONG_MAX -DEFINE_EQUIV_STR_CONV(int, i, ll, u, ull) -#elif UINT_MAX == ULONG_MAX +#if UINT_MAX == ULONG_MAX DEFINE_EQUIV_STR_CONV(int, i, l, u, ul) #else DECLARE_STR_CONV(int, i, u) @@ -101,16 +90,6 @@ DECLARE_STR_CONV(int, i, u) /* Specialized */ -uint32_t BUG_xatou32_unimplemented(void); -static ALWAYS_INLINE uint32_t xatou32(const char *numstr) -{ - if (UINT_MAX == 0xffffffff) - return xatou(numstr); - if (ULONG_MAX == 0xffffffff) - return xatoul(numstr); - return BUG_xatou32_unimplemented(); -} - /* Non-aborting kind of convertors: bb_strto[u][l]l */ /* On exit: errno = 0 only if there was non-empty, '\0' terminated value @@ -124,29 +103,11 @@ static ALWAYS_INLINE uint32_t xatou32(const char *numstr) * return value is all-ones in this case. */ -unsigned long long bb_strtoull(const char *arg, char **endp, int base) FAST_FUNC; -long long bb_strtoll(const char *arg, char **endp, int base) FAST_FUNC; -#if ULONG_MAX == ULLONG_MAX -static ALWAYS_INLINE -unsigned long bb_strtoul(const char *arg, char **endp, int base) -{ return bb_strtoull(arg, endp, base); } -static ALWAYS_INLINE -long bb_strtol(const char *arg, char **endp, int base) -{ return bb_strtoll(arg, endp, base); } -#else unsigned long bb_strtoul(const char *arg, char **endp, int base) FAST_FUNC; long bb_strtol(const char *arg, char **endp, int base) FAST_FUNC; -#endif -#if UINT_MAX == ULLONG_MAX -static ALWAYS_INLINE -unsigned bb_strtou(const char *arg, char **endp, int base) -{ return bb_strtoull(arg, endp, base); } -static ALWAYS_INLINE -int bb_strtoi(const char *arg, char **endp, int base) -{ return bb_strtoll(arg, endp, base); } -#elif UINT_MAX == ULONG_MAX +#if UINT_MAX == ULONG_MAX static ALWAYS_INLINE unsigned bb_strtou(const char *arg, char **endp, int base) { return bb_strtoul(arg, endp, base); } diff --git a/libbb/bb_strtonum.c b/libbb/bb_strtonum.c index 949f26bee..603806a13 100644 --- a/libbb/bb_strtonum.c +++ b/libbb/bb_strtonum.c @@ -51,46 +51,6 @@ static unsigned long long handle_errors(unsigned long long v, char **endp) return v; } - -unsigned long long FAST_FUNC bb_strtoull(const char *arg, char **endp, int base) -{ - unsigned long long v; - char *endptr; - - if (!endp) endp = &endptr; - *endp = (char*) arg; - - /* strtoul(" -4200000000") returns 94967296, errno 0 (!) */ - /* I don't think that this is right. Preventing this... */ - if (!isalnum(arg[0])) return ret_ERANGE(); - - /* not 100% correct for lib func, but convenient for the caller */ - errno = 0; - v = strtoull(arg, endp, base); - return handle_errors(v, endp); -} - -long long FAST_FUNC bb_strtoll(const char *arg, char **endp, int base) -{ - unsigned long long v; - char *endptr; - char first; - - if (!endp) endp = &endptr; - *endp = (char*) arg; - - /* Check for the weird "feature": - * a "-" string is apparently a valid "number" for strto[u]l[l]! - * It returns zero and errno is 0! :( */ - first = (arg[0] != '-' ? arg[0] : arg[1]); - if (!isalnum(first)) return ret_ERANGE(); - - errno = 0; - v = strtoll(arg, endp, base); - return handle_errors(v, endp); -} - -#if ULONG_MAX != ULLONG_MAX unsigned long FAST_FUNC bb_strtoul(const char *arg, char **endp, int base) { unsigned long v; @@ -121,7 +81,6 @@ long FAST_FUNC bb_strtol(const char *arg, char **endp, int base) v = strtol(arg, endp, base); return handle_errors(v, endp); } -#endif #if UINT_MAX != ULONG_MAX unsigned FAST_FUNC bb_strtou(const char *arg, char **endp, int base) diff --git a/libbb/getopt32.c b/libbb/getopt32.c index d0e83d88e..ff3c8ce95 100644 --- a/libbb/getopt32.c +++ b/libbb/getopt32.c @@ -7,6 +7,8 @@ * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +#include "autoconf.h" + #if ENABLE_LONG_OPTS || ENABLE_FEATURE_GETOPT_LONG # include #endif diff --git a/libbb/read_key.c b/libbb/read_key.c index ace23defb..239f834f7 100644 --- a/libbb/read_key.c +++ b/libbb/read_key.c @@ -9,7 +9,7 @@ */ #include "libbb.h" -int64_t FAST_FUNC read_key(int fd, char *buffer, int timeout) +int32_t FAST_FUNC read_key(int fd, char *buffer, int timeout) { struct pollfd pfd; const char *seq; @@ -224,6 +224,8 @@ int64_t FAST_FUNC read_key(int fd, char *buffer, int timeout) } n++; /* Try to decipher "ESC [ NNN ; NNN R" sequence */ +#if (ENABLE_FEATURE_EDITING_ASK_TERMINAL || ENABLE_FEATURE_VI_ASK_TERMINAL || ENABLE_FEATURE_LESS_ASK_TERMINAL) +# error "read_key's return value would have to be 64-bit to support this" if ((ENABLE_FEATURE_EDITING_ASK_TERMINAL || ENABLE_FEATURE_VI_ASK_TERMINAL || ENABLE_FEATURE_LESS_ASK_TERMINAL @@ -251,6 +253,7 @@ int64_t FAST_FUNC read_key(int fd, char *buffer, int timeout) /* Return it in high-order word */ return ((int64_t) col << 32) | (uint32_t)KEYCODE_CURSOR_POS; } +#endif } got_all: diff --git a/libbb/xatonum.c b/libbb/xatonum.c index 6f4e023bb..332586f0b 100644 --- a/libbb/xatonum.c +++ b/libbb/xatonum.c @@ -9,18 +9,6 @@ #include "libbb.h" -#define type long long -#define xstrtou(rest) xstrtoull##rest -#define xstrto(rest) xstrtoll##rest -#define xatou(rest) xatoull##rest -#define xato(rest) xatoll##rest -#define XSTR_UTYPE_MAX ULLONG_MAX -#define XSTR_TYPE_MAX LLONG_MAX -#define XSTR_TYPE_MIN LLONG_MIN -#define XSTR_STRTOU strtoull -#include "xatonum_template.c" - -#if ULONG_MAX != ULLONG_MAX #define type long #define xstrtou(rest) xstrtoul##rest #define xstrto(rest) xstrtol##rest @@ -31,7 +19,6 @@ #define XSTR_TYPE_MIN LONG_MIN #define XSTR_STRTOU strtoul #include "xatonum_template.c" -#endif #if UINT_MAX != ULONG_MAX static ALWAYS_INLINE diff --git a/shell/hush.c b/shell/hush.c index ca7f30df9..eb6c927a5 100644 --- a/shell/hush.c +++ b/shell/hush.c @@ -81,8 +81,10 @@ * $ "export" i=`echo 'aaa bbb'`; echo "$i" * aaa */ +#include "autoconf.h" + #if !(defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) \ - || defined(__APPLE__) \ + || defined(__APPLE__) || defined(__GNO__) \ ) # include /* for malloc_trim */ #endif @@ -300,8 +302,8 @@ # undef USE_FOR_NOMMU # undef USE_FOR_MMU # define BB_MMU 0 -# define USE_FOR_NOMMU(...) __VA_ARGS__ -# define USE_FOR_MMU(...) +# define USE_FOR_NOMMU(x) x +# define USE_FOR_MMU(x) #endif #include "NUM_APPLETS.h" @@ -312,8 +314,8 @@ # undef IF_FEATURE_SH_STANDALONE # undef IF_NOT_FEATURE_SH_STANDALONE # define ENABLE_FEATURE_SH_STANDALONE 0 -# define IF_FEATURE_SH_STANDALONE(...) -# define IF_NOT_FEATURE_SH_STANDALONE(...) __VA_ARGS__ +# define IF_FEATURE_SH_STANDALONE(x) +# define IF_NOT_FEATURE_SH_STANDALONE(x) x #endif #if !ENABLE_HUSH_INTERACTIVE @@ -328,12 +330,12 @@ /* Do we support ANY keywords? */ #if ENABLE_HUSH_IF || ENABLE_HUSH_LOOPS || ENABLE_HUSH_CASE # define HAS_KEYWORDS 1 -# define IF_HAS_KEYWORDS(...) __VA_ARGS__ -# define IF_HAS_NO_KEYWORDS(...) +# define IF_HAS_KEYWORDS(x) x +# define IF_HAS_NO_KEYWORDS(x) #else # define HAS_KEYWORDS 0 -# define IF_HAS_KEYWORDS(...) -# define IF_HAS_NO_KEYWORDS(...) __VA_ARGS__ +# define IF_HAS_KEYWORDS(x) +# define IF_HAS_NO_KEYWORDS(x) x #endif /* If you comment out one of these below, it will be #defined later @@ -636,7 +638,7 @@ struct parse_context { * Neither of these (de)allocates the strings. * setenv allocates new strings in malloc space and does putenv, * and thus setenv is unusable (leaky) for shell's purposes */ -#define setenv(...) setenv_is_leaky_dont_use() +#define setenv(x) setenv_is_leaky_dont_use() struct variable { struct variable *next; char *varstr; /* points to "name=" portion */ @@ -5670,7 +5672,9 @@ static void re_execute_shell(char ***to_free, const char *s, , (unsigned) G.last_exitcode , cnt , empty_trap_mask - IF_HUSH_LOOPS(, G.depth_of_loop) +# if ENABLE_HUSH_LOOPS + , G.depth_of_loop +# endif ); # undef NOMMU_HACK_FMT /* 1:hush 2:-$::: @@ -8008,7 +8012,7 @@ int hush_main(int argc, char **argv) optarg++; builtin_argc = bb_strtou(optarg, &optarg, 16); optarg++; - empty_trap_mask = bb_strtoull(optarg, &optarg, 16); + empty_trap_mask = bb_strtoul(optarg, &optarg, 16); if (empty_trap_mask != 0) { int sig; install_special_sighandlers(); diff --git a/shell/match.h b/shell/match.h index aa393ed1a..073dcb545 100644 --- a/shell/match.h +++ b/shell/match.h @@ -11,7 +11,7 @@ enum { SCAN_MOVE_FROM_LEFT = (1 << 0), SCAN_MOVE_FROM_RIGHT = (1 << 1), SCAN_MATCH_LEFT_HALF = (1 << 2), - SCAN_MATCH_RIGHT_HALF = (1 << 3), + SCAN_MATCH_RIGHT_HALF = (1 << 3) }; char* FAST_FUNC scan_and_match(char *string, const char *pattern, unsigned flags); diff --git a/shell/shell_common.c b/shell/shell_common.c index aaf0a0673..d691fe3c2 100644 --- a/shell/shell_common.c +++ b/shell/shell_common.c @@ -459,10 +459,8 @@ shell_builtin_ulimit(char **argv) else { if (sizeof(val) == sizeof(int)) val = bb_strtou(val_str, NULL, 10); - else if (sizeof(val) == sizeof(long)) - val = bb_strtoul(val_str, NULL, 10); else - val = bb_strtoull(val_str, NULL, 10); + val = bb_strtoul(val_str, NULL, 10); if (errno) { bb_error_msg("invalid number '%s'", val_str); return EXIT_FAILURE; diff --git a/shell/shell_common.h b/shell/shell_common.h index 993ed5951..47fdbeb62 100644 --- a/shell/shell_common.h +++ b/shell/shell_common.h @@ -30,7 +30,7 @@ int FAST_FUNC is_well_formed_var_name(const char *s, char terminator); enum { BUILTIN_READ_SILENT = 1 << 0, - BUILTIN_READ_RAW = 1 << 1, + BUILTIN_READ_RAW = 1 << 1 }; const char* FAST_FUNC shell_builtin_read(void FAST_FUNC (*setvar)(const char *name, const char *val),