| ▲ | omoikane 7 hours ago | ||||||||||||||||||||||
> (assert) doesn't follow the usual SCREAMING_SNAKE_CASE convention we associate with macros There are a few things like that, for example: https://en.cppreference.com/w/c/numeric/math/isnan - isnan is an implementation defined macro. https://en.cppreference.com/w/c/io/fgetc - `getc` may be implemented as a macro, but often it's a function. | |||||||||||||||||||||||
| ▲ | nealabq 6 hours ago | parent [-] | ||||||||||||||||||||||
In C++ you should probably #include <cstdio> instead of <stdio.h> unless you have a good reason. And especially avoid #including both. <cstdio> provides the function std::getc(..) while <stdio.h> usually provides getc(..) as a macro. htons(..) and related socket-utility names are also often macros, but I'm pretty sure there is not a std::htons(..) in the C++ standard, partly because 'htons' is not an attractive name. Since it's (sometimes) a macro don't qualify its namespace like ::htons(..). A long time ago in the Microsoft C (and later C++) dev envs there were macros named "min" and "max", which I thought were terrible names for macros. | |||||||||||||||||||||||
| |||||||||||||||||||||||