From 45018a216348271b9bda448d13d6f55e6e4b3f0b Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Sun, 6 Aug 2023 20:45:08 -0500 Subject: [PATCH] Generate JSON5 when available Fixes lp: #2029482 / GitHub #92 --- documentation/release_notes.dox | 2 ++ src/factory/printer.cpp | 3 +++ 2 files changed, 5 insertions(+) diff --git a/documentation/release_notes.dox b/documentation/release_notes.dox index 27bc1aa6..6e2927f0 100644 --- a/documentation/release_notes.dox +++ b/documentation/release_notes.dox @@ -5,6 +5,8 @@ Release 8.0.6 (UNRELEASED) ======================== +- Compatible changes + - Actually enable JSON-5 output in PVStructure::Formatter::JSON when available. Release 8.0.5 (Sep 2022) ======================== diff --git a/src/factory/printer.cpp b/src/factory/printer.cpp index 55fb01c3..846f2def 100644 --- a/src/factory/printer.cpp +++ b/src/factory/printer.cpp @@ -404,6 +404,9 @@ std::ostream& operator<<(std::ostream& strm, const PVStructure::Formatter& forma if(format.xfmt==PVStructure::Formatter::JSON) { JSONPrintOptions opts; opts.multiLine = false; +#if EPICS_VERSION_INT>=VERSION_INT(7,0,6,1) + opts.json5 = true; +#endif printJSON(strm, format.xtop, format.xshow ? *format.xshow : BitSet().set(0), opts); strm<<'\n'; return strm;