Skip to content

Commit

Permalink
lib: Fix LYD_NEW_PATH_OUTPUT issue to support libyang v3.x
Browse files Browse the repository at this point in the history
Fix the LYD_NEW_PATH_OUTPUT undeclared error to support the latest libyang v3.x version,
and also compatible with old version.

Signed-off-by: Lu Mao <[email protected]>
  • Loading branch information
oplklum committed Aug 1, 2024
1 parent 3b3fff4 commit 8fa9a8e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/yang.c
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,13 @@ void yang_dnode_rpc_output_add(struct lyd_node *output, const char *xpath,
LY_ERR err;

err = lyd_new_path(output, ly_native_ctx, xpath, value,
LYD_NEW_PATH_OUTPUT | LYD_NEW_PATH_UPDATE, NULL);
#if (LY_VERSION_MAJOR < 3)
LYD_NEW_PATH_OUTPUT
#else
LYD_NEW_VAL_OUTPUT
#endif
| LYD_NEW_PATH_UPDATE,
NULL);
assert(err == LY_SUCCESS);
}

Expand Down

0 comments on commit 8fa9a8e

Please sign in to comment.