Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Useful C Macros

Name: Anonymous 2010-01-12 15:24

Let's share the macros we use that make our C code really EXPERT!!

Right now I'm specifically interested in macros to add half-assed object orientation. Thanks!!

I'll contribute myself:
#define mainstart int main(int argc, char **argv) {

Name: Anonymous 2010-01-13 9:00


#ifdef DEBUG
# define ASSERT(e)    ( ((e) || assert(__FILE__, __LINE__) )
#else
# define ASSERT(e)    ( __assume(e) )
#endif


Used as an example in the reference: http://msdn.microsoft.com/en-us/library/1b3fsfxw.aspx

Having played with __assume a little (assuming some crazy shit and looking at the assembly listing) I can't begin to imagine disastrous effects this EXPERT PRACTICE would produce in a real code. Truly, this is a sanity destroyer worth being put in the Necronomicon.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List