Subject: Re: Porting question: __P
To: Ken Nakata <kenn@synap.ne.jp>
From: David A. Gatwood <marsmail@globegate.utm.edu>
List: port-mac68k
Date: 08/22/1998 20:04:15
On Sun, 23 Aug 1998, Ken Nakata wrote:

> On Sat, 22 Aug 1998 16:17:59 -0500 (CDT), David A. Gatwood wrote:
> > 
> > In attempting to port the sbc driver to the Mach Kernel (heaven help me),
> > and I've run into something that I'm not familiar with, and which I can't
> > find anywhere in Mach's sources except a commented out chunk of headers
> > from FreeBSD in the ata driver, specifically, __P.
> 
> A snippet from src/sys/sys/cdefs.h:
> 
> #if defined(__STDC__) || defined(__cplusplus)
> #define __P(protos)     protos          /* full-blown ANSI C */
> [snip snip]
> #else   /* !(__STDC__ || __cplusplus) */
> #define __P(protos)     ()              /* traditional C preprocessor */
> [snip snip]
> #endif
> 
> Basically, __P() is used to control type of function declarations; if
> your compiler understands prototype, "void foo __P((int));" will be
> "void foo (int);" and if not, it will be "void foo ();" instead.
> The white space between the function name and the left paren is legal,
> if you are worried about it.

Thanks.  Colin Wood said something similar in private email.  Strange, but
interesting.  :-)


Later,
David

David A. Gatwood                         Visit globegate's internet
dgatwood@globegate.utm.edu                  talker, Deep Space 36
http://globegate.utm.edu                telnet globegate.utm.edu:9624

-----BEGIN GEEK CODE BLOCK-----
Version 3.1
GCS/CC/FA/H/L/MC/M/MU/PA/TW d-@ s:>- a-- C++ ++>$ UBLAS*++ ++>$
P+?>$ L++ +>$ !E--- W++ +>$ N++(++ +)>++ +$ !o? K-? !w--- !O
M++>$ !V-- PS+>$ !PE- Y+>$ PGP+>$ t++ +>$ 5+>++ ++$ !X- !R tv+>$
b++>$ !DI !D- G++(++ +)>$ e>++ ++ h--! r--- !y-

------END GEEK CODE BLOCK------