Skip to content

Commit

Permalink
pw_assert/libc_assert: Correct macro typo
Browse files Browse the repository at this point in the history
Corrects a typo which meant the define check was looking for
__STDC_VERSION to be defined instead of __STDC_VERSION__.

Also cleans up the use of defined for legibility.

Change-Id: I3fde1222ff5d7c5893472b72bf593db4cae72cf8
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/131792
Pigweed-Auto-Submit: Ewout van Bekkum <ewout@google.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
  • Loading branch information
Ewout van Bekkum authored and CQ Bot Account committed Mar 3, 2023
1 parent 1bb6ace commit 5068fb5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pw_assert/public/pw_assert/internal/libc_assert.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@ extern "C++" {
#endif // __cplusplus

// Provide static_assert() on >=C11
#if (defined __USE_ISOC11 || \
defined __STDC_VERSION && __STDC_VERSION__ >= 201112L) && \
!defined __cplusplus
#if (defined(__USE_ISOC11) || \
defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)) && \
!defined(__cplusplus)
#define static_assert _Static_assert
#endif // C11 or newer

// Provide assert()
#undef assert
#if defined NDEBUG // Required by ANSI C standard.
#if defined(NDEBUG) // Required by ANSI C standard.
#define assert(condition) ((void)0)
#else
#define assert(condition) PW_ASSERT(condition)
#endif // defined NDEBUG
#endif // defined(NDEBUG)

0 comments on commit 5068fb5

Please sign in to comment.