mirror of
https://github.com/swaywm/sway.git
synced 2026-03-31 07:11:24 -04:00
Adaptions for API change in json-c v0.13
Lift restriction on json-c <= 0.12.1 ipc-server: Acquire ownership of referenced json_object properly When adding a referenced json_object with an unknown lifetime to another json_object, it must be done with a wrapped call to json_object_get() to acquire the ownership of that json_object.
This commit is contained in:
parent
d0bd0ed598
commit
c08c805ecd
17 changed files with 41 additions and 26 deletions
16
include/sway_json_helper.h
Normal file
16
include/sway_json_helper.h
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
#ifndef _SWAY_JSON_HELPER_H
|
||||
#define _SWAY_JSON_HELPER_H
|
||||
|
||||
#include <json-c/json.h>
|
||||
|
||||
// Macros for checking a specific version.
|
||||
#define JSON_C_VERSION_013 (13 << 8)
|
||||
|
||||
// json-c v0.13 uses size_t for array_list_length().
|
||||
#if defined(JSON_C_VERSION_NUM) && JSON_C_VERSION_NUM >= JSON_C_VERSION_013
|
||||
typedef size_t json_ar_len_t;
|
||||
#else
|
||||
typedef int json_ar_len_t;
|
||||
#endif
|
||||
|
||||
#endif // _SWAY_JSON_HELPER_H
|
||||
Loading…
Add table
Add a link
Reference in a new issue