You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Postgres is full of C macros, for example, #define HeapTupleIsValid(tuple) PointerIsValid(tuple), which references #define PointerIsValid(pointer) ((const void*)(pointer) != NULL), which references #define NULL ((void *)0).
How do you deal with this in Rust? These macros can change from pg version to version, so you probably want to use them somehow, but I don't see any reference to them in pgx-pg-sys, and bindgen doesn't seem to do anything with them.
Just bypass them and do tuple.is_null()?
The text was updated successfully, but these errors were encountered:
Some have been wrapped as C functions. Others I’ve hand-ported to Rust.
In general tho, we don’t have a good solution here. I’ve often wondered how hard it would be to write something to programmatically convert the simple ones from C to Rust. Kinda a bindgen but for (simple) C macros.
This isn't "really" bindgen related... but it's also bindgen related (specifically regarding how bindgen is not quite enough for our needs). See #798 and #730 for other examples of that. So, tagging until a better tag comes up.
This is more of a question than an issue.
Postgres is full of C macros, for example,
#define HeapTupleIsValid(tuple) PointerIsValid(tuple)
, which references#define PointerIsValid(pointer) ((const void*)(pointer) != NULL)
, which references#define NULL ((void *)0)
.How do you deal with this in Rust? These macros can change from pg version to version, so you probably want to use them somehow, but I don't see any reference to them in pgx-pg-sys, and bindgen doesn't seem to do anything with them.
Just bypass them and do
tuple.is_null()
?The text was updated successfully, but these errors were encountered: