aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2023-06-05 11:10:22 +0100
committerRon Yorston <rmy@pobox.com>2023-06-05 11:10:22 +0100
commit374b4e872a8981ec01707812d8822c9fb9a52d20 (patch)
treebab4ea4d9726d5e3ca98cefb1f6db873af8a4876 /include
parent0b6aed138649cb843cbbdfe2ca5ff5e56f3a0825 (diff)
downloadbusybox-w32-374b4e872a8981ec01707812d8822c9fb9a52d20.tar.gz
busybox-w32-374b4e872a8981ec01707812d8822c9fb9a52d20.tar.bz2
busybox-w32-374b4e872a8981ec01707812d8822c9fb9a52d20.zip
win32: code shrink applet look-up
- Remove find_preferred_applet_by_name(). Instead add a reference to is_applet_preferred() in find_applet_by_name(). - Remove the global variable ash_path. Use a static instead, accessed by calling get_ash_path(). - Mark ash_applet_by_name() as NOINLINE. Saves 64-96 bytes. (GitHub issue #329)
Diffstat (limited to 'include')
-rw-r--r--include/libbb.h9
1 files changed, 3 insertions, 6 deletions
diff --git a/include/libbb.h b/include/libbb.h
index 1200e636a..5c4a01e8d 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -1326,16 +1326,13 @@ void run_noexec_applet_and_exit(int a, const char *name, char **argv) NORETURN F
1326#ifndef BUILD_INDIVIDUAL 1326#ifndef BUILD_INDIVIDUAL
1327int find_applet_by_name(const char *name) FAST_FUNC; 1327int find_applet_by_name(const char *name) FAST_FUNC;
1328void run_applet_no_and_exit(int a, const char *name, char **argv) NORETURN FAST_FUNC; 1328void run_applet_no_and_exit(int a, const char *name, char **argv) NORETURN FAST_FUNC;
1329int find_preferred_applet_by_name(const char *name) FAST_FUNC;
1330int is_applet_preferred(const char *name) FAST_FUNC;
1331# if ENABLE_PLATFORM_MINGW32 && \ 1329# if ENABLE_PLATFORM_MINGW32 && \
1332 (ENABLE_FEATURE_PREFER_APPLETS || ENABLE_FEATURE_SH_STANDALONE) 1330 (ENABLE_FEATURE_PREFER_APPLETS || ENABLE_FEATURE_SH_STANDALONE)
1333# if ENABLE_ASH 1331int is_applet_preferred(const char *name) FAST_FUNC;
1334extern const char *ash_path; 1332const char *get_ash_path(void);
1335# endif
1336# define find_applet_by_name(n) find_preferred_applet_by_name(n)
1337# else 1333# else
1338# define is_applet_preferred(n) (1) 1334# define is_applet_preferred(n) (1)
1335# define get_ash_path() (NULL)
1339# endif 1336# endif
1340#endif 1337#endif
1341void show_usage_if_dash_dash_help(int applet_no, char **argv) FAST_FUNC; 1338void show_usage_if_dash_dash_help(int applet_no, char **argv) FAST_FUNC;