Fixes to get libbb/getopt32.c to compile.

This disables long argument support, since that requires getopt_long(), which isn't included in GNO. There is a separate library available for it, but it's simpler to avoid depending on that.
This commit is contained in:
Stephen Heumann 2014-11-03 12:58:57 -06:00
parent 488a238ad7
commit bdafda3f97
2 changed files with 10 additions and 10 deletions

View File

@ -148,14 +148,10 @@
#define ENABLE_UNICODE_PRESERVE_BROKEN 0 #define ENABLE_UNICODE_PRESERVE_BROKEN 0
#define IF_UNICODE_PRESERVE_BROKEN(x) #define IF_UNICODE_PRESERVE_BROKEN(x)
#define IF_NOT_UNICODE_PRESERVE_BROKEN(x) x #define IF_NOT_UNICODE_PRESERVE_BROKEN(x) x
#define CONFIG_LONG_OPTS 1 #undef CONFIG_LONG_OPTS
#define ENABLE_LONG_OPTS 1 #define ENABLE_LONG_OPTS 0
#ifdef MAKE_SUID #define IF_LONG_OPTS(x)
# define IF_LONG_OPTS(x) x "CONFIG_LONG_OPTS" #define IF_NOT_LONG_OPTS(x) x
#else
# define IF_LONG_OPTS(x) x
#endif
#define IF_NOT_LONG_OPTS(x)
#define CONFIG_FEATURE_DEVPTS 1 #define CONFIG_FEATURE_DEVPTS 1
#define ENABLE_FEATURE_DEVPTS 1 #define ENABLE_FEATURE_DEVPTS 1
#ifdef MAKE_SUID #ifdef MAKE_SUID

View File

@ -10,7 +10,11 @@
#include "autoconf.h" #include "autoconf.h"
#if ENABLE_LONG_OPTS || ENABLE_FEATURE_GETOPT_LONG #if ENABLE_LONG_OPTS || ENABLE_FEATURE_GETOPT_LONG
# ifndef __GNO__
# include <getopt.h> # include <getopt.h>
# else
# include <stdlib.h>
# endif
#endif #endif
#include "libbb.h" #include "libbb.h"
@ -303,7 +307,7 @@ const char *opt_complementary;
enum { enum {
PARAM_STRING, PARAM_STRING,
PARAM_LIST, PARAM_LIST,
PARAM_INT, PARAM_INT
}; };
typedef struct { typedef struct {