Skip to content
Myr

libjq: extern C for C++

Before adoption: this commit came in with the history the project adopted, so no landing records it.

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

authored by Tyler Rockwood · committed by GitHub · parent 460a5c1 · Browse files · 2 files+15 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Trailers

  • Signed-off-by: Tyler Rockwood <rockwood@redpanda.com>

Diff stats

2 files+15 added−0 removed

  • other:+15 added−0 removed

2 files+15 added−0 removed

modified:src/jq.h+8 added
2 unmodified lines
34#include <stdio.h>5#include "jv.h"67#ifdef __cplusplus8extern "C" {9#endif1011enum {12 JQ_DEBUG_TRACE = 1,13 JQ_DEBUG_TRACE_DETAIL = 2,14 JQ_DEBUG_TRACE_ALL = JQ_DEBUG_TRACE | JQ_DEBUG_TRACE_DETAIL,
57 unmodified lines
72jv jq_util_input_get_current_line(jq_state*);7374int jq_set_colors(const char *);7576#ifdef __cplusplus77}78#endif7980#endif /* !JQ_H */
modified:src/jv.h+7 added
3 unmodified lines
4#include <stdarg.h>5#include <stdint.h>6#include <stdio.h>78#ifdef __cplusplus9extern "C" {10#endif1112#if (defined(__GNUC__) && __GNUC__ >= 7) || \13 (defined(__clang__) && __clang_major__ >= 10)14# define JQ_FALLTHROUGH __attribute__((fallthrough))15#else
247 unmodified lines
263int jv_cmp(jv, jv);264jv jv_group(jv, jv);265jv jv_sort(jv, jv);266267#ifdef __cplusplus268}269#endif270271#endif272273
20 unmodified lines