mirror of
https://github.com/haiwen/libsearpc.git
synced 2025-09-04 22:30:54 +00:00
Fix traivis ci, which has an older version of libjansson.
This commit is contained in:
@@ -66,7 +66,7 @@ inline static const json_t *json_array_get_json_or_null_element (json_t *array,
|
|||||||
inline static void json_array_add_json_or_null_element (json_t *array, const json_t *value)
|
inline static void json_array_add_json_or_null_element (json_t *array, const json_t *value)
|
||||||
{
|
{
|
||||||
if (value) {
|
if (value) {
|
||||||
json_t *obj = json_deep_copy(value);
|
json_t *obj = json_deep_copy((json_t*)value);
|
||||||
json_array_append_new (array, obj);
|
json_array_append_new (array, obj);
|
||||||
} else {
|
} else {
|
||||||
json_array_append_new (array, json_null ());
|
json_array_append_new (array, json_null ());
|
||||||
|
@@ -336,6 +336,15 @@ test_searpc__json_return_type (void)
|
|||||||
json_decref(result);
|
json_decref(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The macro `json_object_foreach` is not defined in older versions of
|
||||||
|
// libjansson.
|
||||||
|
#ifndef json_object_foreach
|
||||||
|
#define json_object_foreach(object, key, value) \
|
||||||
|
for(key = json_object_iter_key(json_object_iter(object)); \
|
||||||
|
key && (value = json_object_iter_value(json_object_key_to_iter(key))); \
|
||||||
|
key = json_object_iter_key(json_object_iter_next(object, json_object_key_to_iter(key))))
|
||||||
|
#endif
|
||||||
|
|
||||||
json_t *
|
json_t *
|
||||||
count_json_kvs (const json_t *obj, GError **error)
|
count_json_kvs (const json_t *obj, GError **error)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user