This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: __P


>>>>> 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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]