Func Protos with K&R Func Defs

usenet news poster usenet at nlm.nih.gov
Fri Mar 1 14:07:39 AEST 1991


In article <11614 at jpl-devvax.JPL.NASA.GOV> david at jpl-devvax.JPL.NASA.GOV (David E. Smyth) writes:
>I do this all the time:
>in WcCreate.h:
>    #ifdef _FUNCTION_PROTOTYPES
>    ...
>    extern void WcWidgetCreation ( Widget root );
>    ...
>    #else
>    ...
>    extern void WcWidgetCreation();
>    ...
>    #endif

Better still:

#ifdef _FUNCTION_PROTOTYPES
#define PROTO(x) x
#else
#define PROTO(x)
#endif

extern void WcWidgetCreation PROTO((Widget root));
extern void WcWidgetCompaction PROTO((Widget leaves));
extern void WcWidgetDestruction PROTO((Widget branches));
extern void WcWidgetDemolition PROTO((Widget knots, Widget tegdiw, ...));
extern void WcWidgetEmulation PROTO((Widget worms));


  Warren Gish                           phone:  (301) 496-2475
  National Center                       FAX: (301) 480-9241
     for Biotechnology Information      Internet:  gish at ncbi.nlm.nih.gov
  National Library of Medicine
  Building 38A, Room 8S-806
  8600 Rockville Pike
  Bethesda, MD 20894-0001



More information about the Comp.lang.c mailing list