Disable the getopt argument permutation on Android

On Android operating systems, the getopt() function is posix compliant
and thus the option processing stops when the first non-option is found.
But the getopt_long() function permutes the argument vector, just like
the GNU implementation.

Using a leading '+' character in the option string disables the
permutation again.
This commit is contained in:
Jef Driesen 2023-04-06 19:45:21 +02:00
parent 86fd58c8c6
commit cf221de9b7

View File

@ -50,7 +50,7 @@
#define RESET 1 #define RESET 1
#endif #endif
#if defined(__GLIBC__) || defined(__MINGW32__) || defined(BSD) #if defined(__GLIBC__) || defined(__MINGW32__) || defined(BSD) || defined(__ANDROID__)
#define NOPERMUTATION "+" #define NOPERMUTATION "+"
#else #else
#define NOPERMUTATION "" #define NOPERMUTATION ""