Skip to content

Commit

Permalink
includes: work around CLANG_PREREQ() double-definition
Browse files Browse the repository at this point in the history
Right now when doing test builds with clang, we wind up getting an error
from two different definitions of CLANG_PREREQ() in the headers.

It might be that we can just rip one of these out, but for now I'm just
making one of them conditional.

Signed-off-by: Peter Jones <[email protected]>
  • Loading branch information
vathpela committed Dec 17, 2024
1 parent 3cf0e09 commit 7b850f7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -205,13 +205,15 @@
#define GNUC_PREREQ(maj, min) 0
#endif

#if !defined(CLANG_PREREQ)
#if defined(__clang__) && defined(__clang_major__) && defined(__clang_minor__)
#define CLANG_PREREQ(maj, min) \
((__clang_major__ > (maj)) || \
(__clang_major__ == (maj) && __clang_minor__ >= (min)))
#else
#define CLANG_PREREQ(maj, min) 0
#endif
#endif /* CLANG_PREREQ */

#if GNUC_PREREQ(5, 1) || CLANG_PREREQ(3, 8)
#define checked_add(addend0, addend1, sum) \
Expand Down

0 comments on commit 7b850f7

Please sign in to comment.