Skip to content

Commit d83de7b

Browse files
committed
Guard fallback getopt code by preprocessor macros
We should put #ifndef HAVE_GETOPT_H to make it more reliable.
1 parent 3ec1836 commit d83de7b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

utils/getopt.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
#include <config.h>
2626
#endif
2727

28+
#ifndef HAVE_GETOPT_H
29+
2830
#include <stdio.h>
2931
#include <stdlib.h>
3032
#include <string.h>
@@ -770,4 +772,6 @@ getopt_long(int argc, char *__getopt_argv_const *argv, const char *options,
770772
{
771773
return _getopt_internal(argc, (char **)argv, options, long_options,
772774
opt_index, 0, 0);
773-
}
775+
}
776+
777+
#endif

0 commit comments

Comments
 (0)