Util: Add to_bool() and use it for JSON, Pg & query encoding
To improve interop with legacy modules.
This commit is contained in:
parent
06e2f950fe
commit
c7a3415485
10 changed files with 141 additions and 37 deletions
|
|
@ -77,7 +77,8 @@ RECVFN(bool) {
|
|||
}
|
||||
|
||||
SENDFN(bool) {
|
||||
fustr_write_ch(out, SvTRUE(val) ? 1 : 0);
|
||||
int r = fu_2bool(val); /* So that we also recognize \0 and \1 */
|
||||
fustr_write_ch(out, r < 0 ? SvTRUE(val) : r);
|
||||
}
|
||||
|
||||
RECVFN(void) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue