diff options
author | Paul Pluzhnikov <ppluzhnikov@google.com> | 2023-02-10 20:40:56 +0000 |
---|---|---|
committer | Paul Pluzhnikov <ppluzhnikov@google.com> | 2023-02-10 20:40:56 +0000 |
commit | 2dda6eab5228f99a30c8102c697592a3901e069c (patch) | |
tree | 15bcbea774f66216621f024f2ef6e4efa463f260 /assert/assert.h | |
parent | 16ca0733a06f551aca8a5ecd38bcb719c4a56634 (diff) | |
download | glibc-2dda6eab5228f99a30c8102c697592a3901e069c.zip glibc-2dda6eab5228f99a30c8102c697592a3901e069c.tar.gz glibc-2dda6eab5228f99a30c8102c697592a3901e069c.tar.bz2 |
Apply upstream commit __builtin_FILE commit to GRTEv5.
https://sourceware.org/git/?p=glibc.git;a=commit;h=e42ec822190056895e55e5140ce2304e67e34445
Diffstat (limited to 'assert/assert.h')
-rw-r--r-- | assert/assert.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/assert/assert.h b/assert/assert.h index 5468c16..f48401c 100644 --- a/assert/assert.h +++ b/assert/assert.h @@ -86,10 +86,21 @@ __END_DECLS parentheses around EXPR. Otherwise, those added parentheses would suppress warnings we'd expect to be detected by gcc's -Wparentheses. */ # if defined __cplusplus +# if defined __has_builtin +# if __has_builtin (__builtin_FILE) +# define __ASSERT_FILE __builtin_FILE () +# define __ASSERT_LINE __builtin_LINE () +# endif +# endif +# if !defined __ASSERT_FILE +# define __ASSERT_FILE __FILE__ +# define __ASSERT_LINE __LINE__ +# endif # define assert(expr) \ (static_cast <bool> (expr) \ ? void (0) \ - : __assert_fail (#expr, __FILE__, __LINE__, __ASSERT_FUNCTION)) + : __assert_fail (#expr, __ASSERT_FILE, __ASSERT_LINE, \ + __ASSERT_FUNCTION)) # elif !defined __GNUC__ || defined __STRICT_ANSI__ # define assert(expr) \ ((expr) \ |