That's pretty cool. It's been a while since I've done C, but couldn't you use a `for` loop instead of a while and perform any necessary cleanup in the "update" section? i.e. https://gcc.godbolt.org/z/jq84jondh
(The condition is optimized away by the big three: msvc, clang, and gcc)
I think in part because do … while expects a ; at the end so you are obliged to provide one, which makes the macro feel more like a “real” function call.
Good point, thank you. The while (0) demands the expected ; The trailing else hopes for the expected ; but would tolerate a wide range of nonsense instead.
https://github.com/libguestfs/libguestfs-common/blob/master/...
You can write:
to generate <memory unit="MiB">1024</memory>