Skip to content

Commit eed8aa4

Browse files
James Prestwoodthiagomacieira
authored andcommitted
Fixed duplicate definitions for targets with certain macros already defined
Signed-off-by: James Prestwood <[email protected]> Signed-off-by: Thiago Macieira <[email protected]>
1 parent 863a480 commit eed8aa4

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/compilersupport_p.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@
6161
# define inline CBOR_INLINE
6262
#endif
6363

64+
#ifndef STRINGIFY
6465
#define STRINGIFY(x) STRINGIFY2(x)
66+
#endif
6567
#define STRINGIFY2(x) #x
6668

6769
#if !defined(UINT32_MAX) || !defined(INT64_MAX)
@@ -151,8 +153,12 @@
151153
#endif
152154

153155
#ifdef __GNUC__
156+
#ifndef likely
154157
# define likely(x) __builtin_expect(!!(x), 1)
158+
#endif
159+
#ifndef unlikely
155160
# define unlikely(x) __builtin_expect(!!(x), 0)
161+
#endif
156162
# define unreachable() __builtin_unreachable()
157163
#elif defined(_MSC_VER)
158164
# define likely(x) (x)

0 commit comments

Comments
 (0)