While compiling xterm I came across a configure option named
--enable-narrowproto enable narrow prototypes for X libraries
(The negation of this option is required to make the scrollbar work under Cygwin, along with --disable-imake.)
I know that in K&R C prototypes didn't exist and all arguments smaller than int or double underwent promotions. Searching the ISO C99 Standard came up empty. What exactly is a narrow prototype? Is there a wide prototype for symmetry? What potential problem arises if I don't use a narrow prototype?
The NARROWPROTO macro is used in Xfuncproto.h to define another macro
#ifdef NARROWPROTO
#define NeedWidePrototypes 0
#else
#define NeedWidePrototypes 1 /* default to make interropt. easier */
#endif
NeedWidePrototypes which is in turn used in Xlib.h for example in the following way
extern XModifierKeymap *XInsertModifiermapEntry(
XModifierKeymap* /* modmap */,
#if NeedWidePrototypes
unsigned int /* keycode_entry */,
#else
KeyCode /* keycode_entry */,
#endif
int /* modifier */
);
KeyCode is a typedef from X.h
typedef unsigned char KeyCode;
so I guess narrow here, referes to the width of the type used for KeyCode.
The same construct for the same typedef can be found in other files, for example XKBlib.h
Besides being noted in INSTALL, it was also an FAQ, topical for a few years Why doesn't the scrollbar work? (also see the notes in the change-log during 2006)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With