Hacker News new | ask | show | jobs
by exDM69 2769 days ago
> Now, if C had something like Go's "defer"...

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.

1 comments

> I think MSVC has a similar construct.

Microsoft rather focus in C++.