]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'nd/diff-parseopt'
authorJunio C Hamano <gitster@pobox.com>
Mon, 9 Sep 2019 19:26:38 +0000 (12:26 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 9 Sep 2019 19:26:38 +0000 (12:26 -0700)
Compilation fix.

* nd/diff-parseopt:
  parseopt: move definition of enum parse_opt_result up

1  2 
parse-options.h

diff --cc parse-options.h
index a4bd40bb6acf90fdafefa0983fb523dca4e8b11c,c4713a06c6fec30293d3de13f0ecdb2c93961d98..38a33a087ec2aa783be7e2276d669247bd9f8d10
@@@ -228,28 -231,8 +237,19 @@@ const char *optname(const struct optio
                BUG("option callback does not expect an argument"); \
  } while (0)
  
 +/*
 + * Similar to the assertions above, but checks that "arg" is always non-NULL.
 + * This assertion also implies BUG_ON_OPT_NEG(), letting you declare both
 + * assertions in a single line.
 + */
 +#define BUG_ON_OPT_NEG_NOARG(unset, arg) do { \
 +      BUG_ON_OPT_NEG(unset); \
 +      if(!(arg)) \
 +              BUG("option callback expects an argument"); \
 +} while(0)
 +
  /*----- incremental advanced APIs -----*/
  
- enum parse_opt_result {
-       PARSE_OPT_COMPLETE = -3,
-       PARSE_OPT_HELP = -2,
-       PARSE_OPT_ERROR = -1,   /* must be the same as error() */
-       PARSE_OPT_DONE = 0,     /* fixed so that "return 0" works */
-       PARSE_OPT_NON_OPTION,
-       PARSE_OPT_UNKNOWN
- };
  /*
   * It's okay for the caller to consume argv/argc in the usual way.
   * Other fields of that structure are private to parse-options and should not