B
Blue Ocean
Hey all, I'm a newbie and just learning C. I've been teaching it to
myself since I got home from school for the summer. I've also been
reading some code and I've been seeing a lot of this:
#define FDECL(functionname,params) functionname(params)
And then declarations like this (from include/extern.h, nethack):
E int NDECL(dojump);
E int FDECL(jump, (int));
E int NDECL(number_leashed);
E void FDECL(o_unleash, (struct obj *));
E void FDECL(m_unleash, (struct monst *,BOOLEAN_P));
E void NDECL(unleash_all);
E boolean NDECL(next_to_u);
etc.
Why? Is there any compelling reason not to type out the prototype?
This doesn't even save characters. Am I missing something?
Thanks in advance for any advice.
James
myself since I got home from school for the summer. I've also been
reading some code and I've been seeing a lot of this:
#define FDECL(functionname,params) functionname(params)
And then declarations like this (from include/extern.h, nethack):
E int NDECL(dojump);
E int FDECL(jump, (int));
E int NDECL(number_leashed);
E void FDECL(o_unleash, (struct obj *));
E void FDECL(m_unleash, (struct monst *,BOOLEAN_P));
E void NDECL(unleash_all);
E boolean NDECL(next_to_u);
etc.
Why? Is there any compelling reason not to type out the prototype?
This doesn't even save characters. Am I missing something?
Thanks in advance for any advice.
James