aboutsummaryrefslogtreecommitdiff
path: root/libbutl/sha1.c
diff options
context:
space:
mode:
Diffstat (limited to 'libbutl/sha1.c')
-rw-r--r--libbutl/sha1.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/libbutl/sha1.c b/libbutl/sha1.c
index 37e862e..98fce5e 100644
--- a/libbutl/sha1.c
+++ b/libbutl/sha1.c
@@ -121,11 +121,17 @@ main ()
#include <string.h>
+/* Assume if bzero/bcopy are defined as macros, then they do what we need. */
+
/* void bzero(void *s, size_t n); */
-#define bzero(s, n) memset((s), 0, (n))
+#ifndef bzero
+# define bzero(s, n) memset((s), 0, (n))
+#endif
/* void bcopy(const void *s1, void *s2, size_t n); */
-#define bcopy(s1, s2, n) memmove((s2), (s1), (n))
+#ifndef bcopy
+# define bcopy(s1, s2, n) memmove((s2), (s1), (n))
+#endif
/* The rest is the unmodified (except for adjusting function declarations and
adding a few explicit casts to make compilable in C++ without warnings)