c - How do you call functions with __P in the prototype? -
i have been going through header files , see there many function prototype this:
returntype some_name __p(arguments);
if call function how do it? use like
some_name(arguments);
excluding __p
, or there other way call such functions?
this kind of prototype uses macro __p
allow inclusion , compilation on old systems not support c90 prototypes (aka ansi prototypes).
on systems, argument __p
macro expands argument list, illustrated below:
#ifdef __using_stone_age_compiler__ #define __p(args) () #else #define __p(args) args int some_name __p((int argc, char *argv[]));
on obsolete systems, above declaration expands int some_name();
whereas expands full prototype otherwise: int some_name(int argc, char *argv[]);
just ignore __p
macro , use some_name(arguments);
syntax call function. note macro name __p
not significant, author of package have used name purpose.
Comments
Post a Comment