Skip to content

Commit d323be4

Browse files
khanayan123claude
andcommitted
fix: revert config-inversion changes, no longer needed with "" default
Since _DD_ROOT_CPP_SESSION_ID now defaults to "" (not nullptr), the config-inversion tool doesn't need the nullptr specialization. Revert to original to_string_any and fix implementation marker to "A". Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 25fb7ea commit d323be4

2 files changed

Lines changed: 3 additions & 8 deletions

File tree

supported-configurations.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@
283283
"_DD_ROOT_CPP_SESSION_ID": [
284284
{
285285
"default": "",
286-
"implementation": "B",
286+
"implementation": "A",
287287
"type": "STRING"
288288
}
289289
]

tools/config-inversion/main.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,12 @@ namespace fs = std::filesystem;
1111
namespace env = datadog::tracing::environment;
1212

1313
template <typename T>
14-
nlohmann::json to_json_default(const T& value) {
14+
std::string to_string_any(const T& value) {
1515
std::ostringstream oss;
1616
oss << value;
1717
return oss.str();
1818
}
1919

20-
template <>
21-
nlohmann::json to_json_default(std::nullptr_t const&) {
22-
return nullptr;
23-
}
24-
2520
nlohmann::json build_configuration() {
2621
nlohmann::json j;
2722
j["version"] = "2";
@@ -36,7 +31,7 @@ nlohmann::json build_configuration() {
3631
#define X(NAME, TYPE, DEFAULT_VALUE) \
3732
do { \
3833
auto obj = nlohmann::json::object(); \
39-
obj["default"] = to_json_default(DEFAULT_VALUE); \
34+
obj["default"] = to_string_any(DEFAULT_VALUE); \
4035
obj["implementation"] = "A"; \
4136
obj["type"] = QUOTED(TYPE); \
4237
supported_configurations[QUOTED(NAME)] = nlohmann::json::array({obj}); \

0 commit comments

Comments
 (0)