Skip to content

Commit

Permalink
drop -i386 avoid,
Browse files Browse the repository at this point in the history
tried with sizeof, it broke on i386, restore builtin_strlen.
  • Loading branch information
jimc committed Apr 12, 2023
1 parent 668330b commit bbf76be
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions lib/test_map_h.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,9 @@ enum client_categories { DRMx_CORE, DRMx_DRIVER, DRMx_KMS };

static STRVEC_FROM_ENUM_VALS_(debug_cats, DRMx_CORE, DRMx_DRIVER, DRMx_KMS);

#if defined(__i386__)
/* avoid a "__compiletime_assert_" error */
#define BUILD_BUG_STREQ(_var, ref) BUILD_BUG_ON(0)
#else
/* test w 2 exprs, for now */
#define BUILD_BUG_STREQ(_var, ref) do { \
BUILD_BUG_ON(__builtin_memcmp(_var, ref, __builtin_strlen(ref))); \
} while (0)
#endif
#define BUILD_BUG_STREQ(_var, ref) \
BUILD_BUG_ON(__builtin_memcmp(_var, ref, __builtin_strlen(ref)))

#define BUILD_BUG_STREQ_VI(_vec_, idx, ref) \
BUILD_BUG_STREQ(_vec_##_names[idx], ref)

Expand Down

0 comments on commit bbf76be

Please sign in to comment.