diff options
author | Loïc Collignon <ctxnop@gmail.com> | 2022-08-03 11:42:28 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2022-08-03 15:41:07 +0200 |
commit | 00852912edc69e652f4932fa536da60528f08ed3 (patch) | |
tree | 2f146ada3c6ca096b6308b15a74b4896fd03d091 /src/systemd/_sd-common.h | |
parent | 2d2efed2eeebad6860e9fa4880d02286175dcffa (diff) | |
download | systemd-00852912edc69e652f4932fa536da60528f08ed3.tar.gz |
Fix 24172: __STDC_VERSION__ may be defined in C++
According to the C++ ISO standard, a conformant compiler is allowed to
define this macro to any value for any reason as it is implementation
defined: https://timsong-cpp.github.io/cppwp/cpp.predefined#2.3
This mean that it cannot be assumed that it is not defined in a C++.
Change the condition to reflect that.
Diffstat (limited to 'src/systemd/_sd-common.h')
-rw-r--r-- | src/systemd/_sd-common.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/systemd/_sd-common.h b/src/systemd/_sd-common.h index 38449463e2..6f657c2254 100644 --- a/src/systemd/_sd-common.h +++ b/src/systemd/_sd-common.h @@ -85,7 +85,7 @@ typedef void (*_sd_destroy_t)(void *userdata); #endif #ifndef _SD_ARRAY_STATIC -# if __STDC_VERSION__ >= 199901L +# if __STDC_VERSION__ >= 199901L && !defined(__cplusplus) # define _SD_ARRAY_STATIC static # else # define _SD_ARRAY_STATIC |