Sean M. Tucker wrote in
news:k1*******************@news4.srv.hcvlny.cv.net in comp.lang.c++:
Hi,
I've seen this in some code, "char* blah P((int))" or "Void* stuff
P((double))"
What does this mean? I've been looking all around and can't find an
answer. Search engions are no help 'cuz they ignore, "((" and "))".
P( X ) is a macro (#define) that either expands to X (ANSI/ISO mode) or
to () (K & R mode), it allows code to be compiled with a pre-standard
C (not C++ (*)) compiler or with a Standard C or C++ compiler.
*) C++ has never allowed prototypes without the paramiter list.
eg:
char *blah P((int));
With a pre-standard C compiler this will be expanded too:
char *blah ();
With a modern Standard conforming compiler this will be:
char *blah( int );
Whenever you see UPERCASENAME(( something )) there is a fair chance
that some kind of macro trickery is going on.
The double parens' are needed so that (possibly empty) comma
seperated list's can be passed to the macro.
void f P((int, char)); /* void f( int, char ); */
Rob.
--
http://www.victim-prime.dsl.pipex.com/