From 1e5e0c9fe2bed8d55cc6d113410c0fdea07f5373 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sat, 4 Jul 2015 14:56:07 -0700 Subject: Make jq.h usable from C++ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously, with clang++: jq.h:46:37: error: typedef redefinition with different types ('struct jq_util_input_state *' vs 'jq_util_input_state') With g++: jq.h:46:37: error: conflicting declaration ‘typedef struct jq_util_input_state* jq_util_input_state’ This typedef was added to libjq by commit 0d41447 which was after the 1.4 release, so although it is a public API, this is not a backcompat break because it has never been in a release. Specifying the "*" at all uses of jq_util_input_state is slightly tedious, but jq_state already works that way, so at least it will be consistent. --- main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'main.c') diff --git a/main.c b/main.c index 168aa431..0ac5d62b 100644 --- a/main.c +++ b/main.c @@ -207,7 +207,7 @@ int main(int argc, char* argv[]) { int dumpopts = JV_PRINT_INDENT_FLAGS(2); const char* program = 0; - jq_util_input_state input_state = jq_util_input_init(NULL, NULL); // XXX add err_cb + jq_util_input_state *input_state = jq_util_input_init(NULL, NULL); // XXX add err_cb int further_args_are_files = 0; int jq_flags = 0; -- cgit v1.2.3