summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Pratt2025-06-24 19:35:33 +0000
committerRobert Marko2025-07-26 12:38:07 +0000
commit346872e7201b79a1f353e2846ab93a71d2357946 (patch)
treef81c7ed237645d9b7816aad5f552bfb12009ad28
parent46506776e6d28263e21540c99575ea5c5de1c7af (diff)
downloadopenwrt-346872e7201b79a1f353e2846ab93a71d2357946.tar.gz
tools/bc: let getopt() prototype be defined normally
Add a patch in order to remove an obsolete workaround that is currently causing issues on some macOS systems. Add patch: - 000-getopt-prototype.patch Tested-by: Georgi Valkov <gvalkov@gmail.com> # macOS Signed-off-by: Michael Pratt <mcpratt@pm.me> Link: https://github.com/openwrt/openwrt/pull/16522 Signed-off-by: Robert Marko <robimarko@gmail.com>
-rw-r--r--tools/bc/patches/000-getopt-prototype.patch18
1 files changed, 18 insertions, 0 deletions
diff --git a/tools/bc/patches/000-getopt-prototype.patch b/tools/bc/patches/000-getopt-prototype.patch
new file mode 100644
index 0000000000..ca6246963b
--- /dev/null
+++ b/tools/bc/patches/000-getopt-prototype.patch
@@ -0,0 +1,18 @@
+--- a/h/getopt.h
++++ b/h/getopt.h
+@@ -135,15 +135,7 @@ struct option
+ arguments to the option '\0'. This behavior is specific to the GNU
+ `getopt'. */
+
+-#ifdef __GNU_LIBRARY__
+-/* Many other libraries have conflicting prototypes for getopt, with
+- differences in the consts, in stdlib.h. To avoid compilation
+- errors, only prototype getopt for the GNU C library. */
+ extern int getopt (int ___argc, char *const *___argv, const char *__shortopts);
+-#else /* not __GNU_LIBRARY__ */
+-extern int getopt ();
+-#endif /* __GNU_LIBRARY__ */
+-
+ #ifndef __need_getopt
+ extern int getopt_long (int ___argc, char *const *___argv,
+ const char *__shortopts,