diff options
author | Tyler Rockwood <rockwotj@users.noreply.github.com> | 2023-11-28 15:50:25 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-28 22:50:25 +0100 |
commit | 6b82dd3c47c5eee8a7fcca063c683caafd5cdd9a (patch) | |
tree | 142739645c417081499559771427d6f20a067e4c /src | |
parent | 460a5c12b47359d30a874dd6fcff11a3cb4c2f00 (diff) |
libjq: extern C for C++
If using libjq from C++ it would be nice to not need to do this at the
import site, so just extern "C" to the public headers for libjq
Signed-off-by: Tyler Rockwood <rockwood@redpanda.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/jq.h | 8 | ||||
-rw-r--r-- | src/jv.h | 7 |
2 files changed, 15 insertions, 0 deletions
@@ -4,6 +4,10 @@ #include <stdio.h> #include "jv.h" +#ifdef __cplusplus +extern "C" { +#endif + enum { JQ_DEBUG_TRACE = 1, JQ_DEBUG_TRACE_DETAIL = 2, @@ -69,4 +73,8 @@ jv jq_util_input_get_current_line(jq_state*); int jq_set_colors(const char *); +#ifdef __cplusplus +} +#endif + #endif /* !JQ_H */ @@ -5,6 +5,10 @@ #include <stdint.h> #include <stdio.h> +#ifdef __cplusplus +extern "C" { +#endif + #if (defined(__GNUC__) && __GNUC__ >= 7) || \ (defined(__clang__) && __clang_major__ >= 10) # define JQ_FALLTHROUGH __attribute__((fallthrough)) @@ -260,6 +264,9 @@ int jv_cmp(jv, jv); jv jv_group(jv, jv); jv jv_sort(jv, jv); +#ifdef __cplusplus +} +#endif #endif |