diff options
author | Thomas E. Dickey <dickey@invisible-island.net> | 2019-04-19 05:29:53 -0400 |
---|---|---|
committer | Thomas E. Dickey <dickey@invisible-island.net> | 2019-04-21 18:27:03 -0400 |
commit | d2df1c47e7f0511c2f1c269bec25a0c4b519fe88 (patch) | |
tree | eeae4f0b17122ae77d69e40b7474cae5bd44f8b9 /specs | |
parent | 52999015089e38705454d0f6f2ea7b544c993bf3 (diff) |
fill in background for wide-prototypes
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
Diffstat (limited to 'specs')
-rw-r--r-- | specs/CH13.xml | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/specs/CH13.xml b/specs/CH13.xml index 2ce5824..b9d8e59 100644 --- a/specs/CH13.xml +++ b/specs/CH13.xml @@ -991,6 +991,52 @@ typedef char *String; */ #define _XtString char* </programlisting> +That is, the developers were providing for some workaround to allow +C++ applications to use the stricter compiler checking +associated with <code>const</code>. +</para> +</listitem> +<listitem> +<para> +The <code>String</code> type is not the only type used in the +prototypes for the X Toolkit library. +Its developers were also concerned with porting the library +to platforms with different size-constraints. +They defined different types (used in the function prototypes) +depending on whether a “wide” parameter type was appropriate: +<programlisting> +/* _Xt names are private to Xt implementation, do not use in client code */ +#if NeedWidePrototypes +#define _XtBoolean int +#define _XtDimension unsigned int +#define _XtKeyCode unsigned int +#define _XtPosition int +#define _XtXtEnum unsigned int +#else +#define _XtBoolean Boolean +#define _XtDimension Dimension +#define _XtKeyCode KeyCode +#define _XtPosition Position +#define _XtXtEnum XtEnum +#endif /* NeedWidePrototypes */ +</programlisting> +and +<programlisting> +#ifdef CRAY +typedef long Boolean; +typedef char* XtArgVal; +typedef long XtEnum; +#else +typedef char Boolean; +typedef long XtArgVal; +typedef unsigned char XtEnum; +#endif +</programlisting> +In practice, wide-prototypes are rarely used, not well supported. +The specification did not clarify the distinction +between <code>Bool</code> (mentioned as a resource type) +and <code>Boolean</code> (used in all of the data structures). +The implementation used both, predominantly the latter. </para> </listitem> </itemizedlist> |