Skip to content

Commit

Permalink
compat/bswap: add include header guards
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
  • Loading branch information
peff authored and gitster committed Mar 6, 2019
1 parent 0d0ac38 commit 33aa579
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions compat/bswap.h
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -210,3 +213,5 @@ static inline void put_be64(void *ptr, uint64_t value)
}

#endif

#endif /* COMPAT_BSWAP_H */

0 comments on commit 33aa579

Please sign in to comment.