patch-lib_getopt_c 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. $OpenBSD: patch-lib_getopt_c,v 1.1.1.1 2005/01/25 23:32:22 fgsch Exp $
  2. --- lib/getopt.c.orig Mon Mar 11 03:31:47 2002
  3. +++ lib/getopt.c Sat Jan 22 21:51:01 2005
  4. @@ -55,11 +55,11 @@ extern int strncmp();
  5. /* This needs to come after some library #include
  6. to get __GNU_LIBRARY__ defined. */
  7. -#ifdef __GNU_LIBRARY__
  8. +#if defined(__GNU_LIBRARY__) || defined(__OpenBSD__)
  9. /* Don't include stdlib.h for non-GNU C libraries because some of them
  10. contain conflicting prototypes for getopt. */
  11. #include <stdlib.h>
  12. -#endif /* GNU C library. */
  13. +#endif /* GNU C library. || OpenBSD */
  14. /* This version of `getopt' appears to the caller like standard Unix `getopt'
  15. but it behaves differently for the user, since it allows the user
  16. @@ -157,7 +157,7 @@ static enum
  17. /* Value of POSIXLY_CORRECT environment variable. */
  18. static char *posixly_correct;
  19. -#ifdef __GNU_LIBRARY__
  20. +#if defined(__GNU_LIBRARY__) || defined(__OpenBSD__)
  21. /* We want to avoid inclusion of string.h with non-GNU libraries
  22. because there are many ways it can cause trouble.
  23. On some systems, it contains special magic macros that don't work
  24. @@ -197,7 +197,7 @@ extern int strlen (const char *);
  25. #endif /* not __STDC__ */
  26. #endif /* __GNUC__ */
  27. -#endif /* not __GNU_LIBRARY__ */
  28. +#endif /* not (__GNU_LIBRARY__) || (__OpenBSD__) */
  29. /* Handle permutation of arguments. */