From f85cb9e049c53d0947fc29a70d5b05d2be7f302f Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 12 Aug 2026 18:16:37 +0000 Subject: [PATCH] Don't redefine _GNU_SOURCE in the C++ jsonpull port The `#define _GNU_SOURCE` carried over from jsonpull.c, where it was needed to get asprintf() declared. g++ already defines _GNU_SOURCE on the command line for C++ translation units, so redefining it warns: jsonpull/jsonpull.cpp:1: warning: "_GNU_SOURCE" redefined Guard the define rather than drop it, so platforms whose C++ driver does not predefine it still get asprintf() declared. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_017KNxyHKasyWrWcvre2yK4r --- jsonpull/jsonpull.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/jsonpull/jsonpull.cpp b/jsonpull/jsonpull.cpp index 8b23ba75..6ddbb943 100644 --- a/jsonpull/jsonpull.cpp +++ b/jsonpull/jsonpull.cpp @@ -1,4 +1,6 @@ +#ifndef _GNU_SOURCE #define _GNU_SOURCE // for asprintf() +#endif #include #include #include