summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2019-03-06 19:05:10 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-03-06 22:42:14 (GMT)
commit33aa579a5568451a34ea08d1ecf336480ba846a3 (patch)
treeb46fce8d88c5c2892f56dd42db60c7bc9e505719
parent0d0ac3826a3bbb9247e39e12623bbcfdd722f24c (diff)
downloadgit-33aa579a5568451a34ea08d1ecf336480ba846a3.zip
git-33aa579a5568451a34ea08d1ecf336480ba846a3.tar.gz
git-33aa579a5568451a34ea08d1ecf336480ba846a3.tar.bz2
compat/bswap: add include header guards
Our compat/bswap.h lacks the usual preprocessor guards against multiple inclusion. This usually isn't an issue since it only gets included from git-compat-util.h, which has its own guards. But it would produce redeclaration errors if any file included it separately. Our hdr-check target would complain about this, except that it currently skips items in compat/ entirely. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--compat/bswap.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/compat/bswap.h b/compat/bswap.h
index 5078ce5..e4e2573 100644
--- a/compat/bswap.h
+++ b/compat/bswap.h
@@ -1,3 +1,6 @@
+#ifndef COMPAT_BSWAP_H
+#define COMPAT_BSWAP_H
+
/*
* Let's make sure we always have a sane definition for ntohl()/htonl().
* Some libraries define those as a function call, just to perform byte
@@ -210,3 +213,5 @@ static inline void put_be64(void *ptr, uint64_t value)
}
#endif
+
+#endif /* COMPAT_BSWAP_H */