projects
/
lttng-ust.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix: allocating C++ compound literal on heap with Clang
[lttng-ust.git]
/
include
/
lttng
/
ust-compiler.h
diff --git
a/include/lttng/ust-compiler.h
b/include/lttng/ust-compiler.h
index 32fd1bb25ed9ddb3a984b3882969c5c72b348f20..eb201bdc93c791f142d2cbc0aa7a86fd90d2472d 100644
(file)
--- a/
include/lttng/ust-compiler.h
+++ b/
include/lttng/ust-compiler.h
@@
-32,8
+32,8
@@
* g++ 4.8 and prior do not support C99 compound literals. Therefore,
* force allocating those on the heap with these C++ compilers.
*/
* g++ 4.8 and prior do not support C99 compound literals. Therefore,
* force allocating those on the heap with these C++ compilers.
*/
-#if defined (__cplusplus) && defined (__GNUC__) && \
- (
__GNUC__ < 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ <= 8
))
+#if defined (__cplusplus) &&
!defined (__clang__) &&
defined (__GNUC__) && \
+ (
(__GNUC__ < 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ <= 8)
))
# ifndef LTTNG_UST_ALLOCATE_COMPOUND_LITERAL_ON_HEAP
# define LTTNG_UST_ALLOCATE_COMPOUND_LITERAL_ON_HEAP
# endif
# ifndef LTTNG_UST_ALLOCATE_COMPOUND_LITERAL_ON_HEAP
# define LTTNG_UST_ALLOCATE_COMPOUND_LITERAL_ON_HEAP
# endif
@@
-65,9
+65,12
@@
* static assertion. This parameter must be a valid C identifier as it will
* be used as a typedef name.
*/
* static assertion. This parameter must be a valid C identifier as it will
* be used as a typedef name.
*/
-#if
defined (__cplusplus) || __STDC_VERSION__ >= 201112L
+#if
def __cplusplus
#define lttng_ust_static_assert(predicate, msg, c_identifier_msg) \
static_assert(predicate, msg)
#define lttng_ust_static_assert(predicate, msg, c_identifier_msg) \
static_assert(predicate, msg)
+#elif __STDC_VERSION__ >= 201112L
+#define lttng_ust_static_assert(predicate, msg, c_identifier_msg) \
+ _Static_assert(predicate, msg)
#else
/*
* Evaluates the predicate and emit a compilation error on failure.
#else
/*
* Evaluates the predicate and emit a compilation error on failure.
This page took
0.025188 seconds
and
4
git commands to generate.