Skip to content

Commit 33aa579

Browse files
peffgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 0d0ac38 commit 33aa579

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

compat/bswap.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#ifndef COMPAT_BSWAP_H
2+
#define COMPAT_BSWAP_H
3+
14
/*
25
* Let's make sure we always have a sane definition for ntohl()/htonl().
36
* 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)
210213
}
211214

212215
#endif
216+
217+
#endif /* COMPAT_BSWAP_H */

0 commit comments

Comments
 (0)