In GCC and Clang you can use __attribute__((cleanup)) to achieve this. I think MSVC has a similar construct.
I'm pretty sure I've seen a portable "defer" library for C somewhere.
Microsoft rather focus in C++.
In GCC and Clang you can use __attribute__((cleanup)) to achieve this. I think MSVC has a similar construct.
I'm pretty sure I've seen a portable "defer" library for C somewhere.