[PATCH] block-sha1: Windows declares ntohl() in winsock2.h
- From
Johannes Sixt <j.sixt@viscovery.net>
- Date
- Aug 18, 2009, 07:15 UTC
- Message-ID
- <4A8A552D.6020407@viscovery.net>
From: Johannes Sixt <j6t@kdbg.org>
This is a minimal fix to compile block-sha1 on Windows. I did not do any benchmarks whether the implementation of ntohl() is actually faster than bytewise access and shifts.
Signed-off-by: Johannes Sixt <j6t@kdbg.org> --- I would appreciate if our Windows experts could tell whether the implementation of ntohl/htonl is worth its money or whether we should go with the generic byte access plus shifts.
the function call over block-sha1/sha1.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/block-sha1/sha1.c b/block-sha1/sha1.c index a1228cf..67c1ee8 100644 --- a/block-sha1/sha1.c +++ b/block-sha1/sha1.c @@ -7,7 +7,11 @@ */ #include <string.h> +#ifndef _WIN32 #include <arpa/inet.h> +#else +#include <winsock2.h> +#endif #include "sha1.h"
-- 1.6.4.1179.g9a91.dirty