CESNET / libyang-cpp

C++ bindings for the libyang library
https://gerrit.cesnet.cz/q/project:CzechLight/libyang-cpp
BSD 3-Clause "New" or "Revised" License
10 stars 3 forks source link

DuplicationOptions: Missing support for Bitwise-OR operator | #18

Closed rbu9fe closed 7 months ago

rbu9fe commented 7 months ago

In contrast to other enumeration types DuplicationOptions doesn't support bitwise-OR | even though it says it's supported: Wraps LY_DUP_* flags. Supports operator|. It's simply missing in the list where operators are defined.

Also please note the typo in the description, it should read LYD_DUP_* rather than LY_DUP_*.

jktjkt commented 7 months ago

Thanks, this patch series should fix that (please feel free to add feedback via Gerrit if you feel like doing that):

jktjkt commented 7 months ago

Fixed, merged, thanks for reporting this.

rbu9fe commented 7 months ago

Thanks for the quick fix!

rbu9fe commented 7 months ago

Sorry but now when building I receive this error: .../src/utils/enum.hpp:90:15: error: ‘LYD_DUP_WITH_PRIV’ was not declared in this scope; did you mean ‘LYD_DUP_WITH_PARENTS’?

And perhaps you may want to remove the trailing comma behind WithPriv = 0x20, as it's the last enum entry (to be consistent with the others).

jktjkt commented 7 months ago

You need the latest devel of libyang, I guess we forgot to bump the requirement in CMake. That trailing comma is there by design to minimize future diffing.

rbu9fe commented 7 months ago

CMake is referring to libyang>=2.1.124. I'm using 2.1.124. Do I need to bump to 2.1.128?

jktjkt commented 7 months ago

yes

jktjkt commented 7 months ago

actually, my recent build was against libyang 2.1.134, and the latest one upstream is 2.1.139

rbu9fe commented 7 months ago

That still fails with the same error. I don't know if I'm missing something but the master branch doesn't know LYD_DUP_WITH_PRIV: See https://github.com/CESNET/libyang/blob/master/src/tree_data.h#L1906C19-L1906C19

syyyr commented 7 months ago

libyang-cpp always tracks the devel branch of libyang (even for the master branch of libyang-cpp)

jktjkt commented 7 months ago

(fixed via CMake's minimal required version of libyang once again)