1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-24 09:27:52 +03:00

Add support for optional_argument to our own getopt_long() implementation.

07c8651dd9 currently causes compilation errors on mscv (and
probably some other) compilers because our getopt_long()
implementation doesn't have support for optional_argument.

Thus implement optional_argument in our fallback implemenation. It's
quite possibly also useful in other cases.

Arguably this needs a configure check for optional_argument, but it
has existed pretty much since getopt_long() was introduced and thus
doesn't seem worth the configure runtime.

Normally I'd would not push a patch this fast, but this allows msvc to
build again and has low risk as only optional_argument behaviour has
changed.

Author: Michael Paquier and Andres Freund

Discussion: CAB7nPqS5VeedSCxrK=QouokbawgGKLpyc1Q++RRFCa_sjcSVrg@mail.gmail.com
This commit is contained in:
Andres Freund
2014-09-10 17:21:50 +02:00
parent b4c28d1b92
commit 311da16439
2 changed files with 13 additions and 4 deletions

View File

@@ -23,6 +23,7 @@ struct option
#define no_argument 0
#define required_argument 1
#define optional_argument 2
#endif
#ifndef HAVE_GETOPT_LONG