Skip to content

Commit 81c6fb6

Browse files
committed
jansson: Disable format string validation if constexpr vector is not available
Signed-off-by: Philipp Jungkamp <philipp.jungkamp@rwth-aachen.de>
1 parent 1cf4acc commit 81c6fb6

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

common/include/villas/jansson.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,9 @@ enum class JanssonNestedStructure {
144144
template <typename... Args> class JanssonUnpackFormatString {
145145
public:
146146
consteval JanssonUnpackFormatString(char const *fmt) : fmt(fmt) {
147+
#ifdef __cpp_lib_constexpr_vector
147148
validate(fmt);
149+
#endif
148150
}
149151

150152
constexpr char const *c_str() const { return fmt; }
@@ -297,7 +299,9 @@ void janssonUnpack(::json_t *json,
297299
template <typename... Args> class JanssonPackFormatString {
298300
public:
299301
consteval JanssonPackFormatString(char const *fmt) : fmt(fmt) {
302+
#ifdef __cpp_lib_constexpr_vector
300303
validate(fmt);
304+
#endif
301305
}
302306

303307
constexpr char const *c_str() const { return fmt; }

0 commit comments

Comments
 (0)