make sure byte swapping is optimal for git

We rely on ntohl() and htonl() to perform byte swapping in many places.
However, some platforms have libraries providing really poor
implementations of those which might cause significant performance
issues, especially with the block-sha1 code.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Nicolas Pitre
2009-08-18 15:26:55 -04:00
committed by Junio C Hamano
parent d5f6a96fa4
commit 51ea55190b
3 changed files with 40 additions and 2 deletions

View File

@ -176,6 +176,8 @@ extern char *gitbasename(char *);
#endif
#endif
#include "compat/bswap.h"
/* General helper functions */
extern void usage(const char *err) NORETURN;
extern void die(const char *err, ...) NORETURN __attribute__((format (printf, 1, 2)));