Subject: Re: __P???
To: Tony Tam <ttam@nortel.ca>
From: Peter Seebach <seebs@herd.plethora.net>
List: netbsd-help
Date: 11/08/1997 21:35:02
In message <199711090322.VAA22799@herd.plethora.net>, "Tony Tam" writes:
>Can someone please explain to me the significance of

>__P in the source code of NetBSD

Almost certainly.

>one example is in the function declarations of Netinet/tcp_var.h at the 
>bottom of the file:

>struct tcpiphdr *
>	 tcp_template __P((struct tcpcb *));

>What is the __P?

There are those who believe that, one day, in the future, we will need
to compile significant portions of the NetBSD tree on machines without
C compilers.  :)

Seriously, back when 4.4 happened, there were plenty of new compilers,
and plenty of old ones, so, rather than give up completely on the extra
type-checking provided by prototypes, The Implementors chose to develop
a little macro to use for function declarations.

With a C compiler, they'll have something like
	#define __P(x)	x
with a pre-C compiler, they'll have something like
	#define __P(x) ()
to produce an "old-style declaration".

-s