From 81c6ba33875936f13109a17e41aa967668b6d2c3 Mon Sep 17 00:00:00 2001 From: Florian Albrechtskirchinger Date: Mon, 9 May 2022 19:45:17 +0200 Subject: [PATCH] Fix HP compiler detection in JSON meta --- include/nlohmann/json.hpp | 6 ++++-- single_include/nlohmann/json.hpp | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/include/nlohmann/json.hpp b/include/nlohmann/json.hpp index fcb3a9379..138ab78e7 100644 --- a/include/nlohmann/json.hpp +++ b/include/nlohmann/json.hpp @@ -281,8 +281,10 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec std::to_string(__GNUC_PATCHLEVEL__)) } }; -#elif defined(__HP_cc) || defined(__HP_aCC) - result["compiler"] = "hp" +#elif defined(__HP_aCC) + result["compiler"] = {{"family", "hp"}, {"version", __HP_aCC}}; +#elif defined(__HP_cc) + result["compiler"] = {{"family", "hp"}, {"version", __HP_cc}}; #elif defined(__IBMCPP__) result["compiler"] = {{"family", "ilecpp"}, {"version", __IBMCPP__}}; #elif defined(_MSC_VER) diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index cc7d6107f..51b06c874 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -19292,8 +19292,10 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec std::to_string(__GNUC_PATCHLEVEL__)) } }; -#elif defined(__HP_cc) || defined(__HP_aCC) - result["compiler"] = "hp" +#elif defined(__HP_aCC) + result["compiler"] = {{"family", "hp"}, {"version", __HP_aCC}}; +#elif defined(__HP_cc) + result["compiler"] = {{"family", "hp"}, {"version", __HP_cc}}; #elif defined(__IBMCPP__) result["compiler"] = {{"family", "ilecpp"}, {"version", __IBMCPP__}}; #elif defined(_MSC_VER)