Skip to content

Commit

Permalink
Fix read errors for gcc 5.4.0: #104
Browse files Browse the repository at this point in the history
  • Loading branch information
ibireme committed Jan 25, 2023
1 parent e837557 commit f893f82
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/yyjson.h
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,8 @@

/** likely for compiler */
#ifndef yyjson_likely
# if yyjson_has_builtin(__builtin_expect) || YYJSON_GCC_VER >= 4
# if yyjson_has_builtin(__builtin_expect) || \
(YYJSON_GCC_VER >= 4 && YYJSON_GCC_VER != 5)
# define yyjson_likely(expr) __builtin_expect(!!(expr), 1)
# else
# define yyjson_likely(expr) (expr)
Expand All @@ -237,7 +238,8 @@

/** unlikely for compiler */
#ifndef yyjson_unlikely
# if yyjson_has_builtin(__builtin_expect) || YYJSON_GCC_VER >= 4
# if yyjson_has_builtin(__builtin_expect) || \
(YYJSON_GCC_VER >= 4 && YYJSON_GCC_VER != 5)
# define yyjson_unlikely(expr) __builtin_expect(!!(expr), 0)
# else
# define yyjson_unlikely(expr) (expr)
Expand Down

0 comments on commit f893f82

Please sign in to comment.