sha1-includes.diff 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. From: Michael Tokarev <mjt@tls.msk.ru>
  2. Subject: do not #include ansidecl.h from sha1.h, use system headers
  3. In 3.2.5 version of mdadm, new sha1 implementation has been included
  4. which tries to include ansidecl.h header which is internal to some
  5. other project. But this #include isn't really necessary, since this
  6. implementation does not actually use any defines from ansidecl.h. So
  7. just remove the #include, instead of adding a new external dependency.
  8. References: http://www.spinics.net/lists/raid/msg38859.html
  9. While at it, unconditionally include system headers like limits.h and
  10. stdint.h, since on a Linux system these headers are available, and
  11. these contains definitive information about real system types than
  12. any guesses.
  13. --- a/sha1.h
  14. +++ b/sha1.h
  15. @@ -22,7 +22,7 @@
  16. #include <stdio.h>
  17. -#if defined HAVE_LIMITS_H || _LIBC
  18. +#if 1 /* defined HAVE_LIMITS_H || _LIBC */
  19. # include <limits.h>
  20. #endif
  21. @@ -33,9 +33,9 @@
  22. the resulting executable. Locally running cross-compiled executables
  23. is usually not possible. */
  24. -#ifdef _LIBC
  25. -# include <sys/types.h>
  26. -typedef u_int32_t sha1_uint32;
  27. +#if 1 /* def _LIBC */
  28. +# include <stdint.h>
  29. +typedef uint32_t sha1_uint32;
  30. typedef uintptr_t sha1_uintptr;
  31. #else
  32. # define INT_MAX_32_BITS 2147483647