__P

Andreas Jaeger aj@suse.de
Tue Jun 13 00:21:00 GMT 2000


>>>>> Geoff Marshall writes:

 > Am trying to compile some threads on Red Had Linux and see that all the
 > routines in pthreads.h are prefixed with __P for example:

 > extern int pthread_create __P ((pthread_t *__thread,
 >                 __const pthread_attr_t *__attr,
 >                 void *(*__start_routine) (void *),
 >                 void *__arg));

 > Questions:

 > What does __P mean?
It helps with compilers that don't understand prototypes:

Check <sys/cdefs.h>:
/* GCC can always grok prototypes.  For C++ programs we add throw()
   to help it optimize the function calls.  But this works only with
   gcc 2.8.x and egcs.  */
# if defined __cplusplus && (__GNUC__ >= 3 || __GNUC_MINOR__ >= 8)
#  define __THROW       throw ()
# else
#  define __THROW
# endif
# define __P(args)      args __THROW
/* This macro will be used for functions which might take C++ callback
   functions.  */
# define __PMT(args)    args
# define __DOTS         , ...
[...]

Andreas
-- 
 Andreas Jaeger
  SuSE Labs aj@suse.de
   private aj@arthur.inka.de


More information about the Gcc mailing list