From 965bc251c1d8391e672f277686254299627d4e3c Mon Sep 17 00:00:00 2001 From: "Thomas E. Dickey" Date: Tue, 19 Mar 2019 20:31:29 -0400 Subject: Referring to the xterm FAQ https://invisible-island.net/xterm/xterm.faq.html#building_it I would like to add an optional feature which makes the String typedef "const" if _CONST_X_STRING is defined. Modifying the Intrinsic.h header is only a partial solution because the library has not been modified to take advantage of this (if it had, most of the const-warnings from gcc would go away). This change modifies the header file as well as the makestrs.c program which generates Shell.h and StringDefs.h so that they use String-casts rather than char*-casts (reducing the warnings seen when compiling with Xt's header files). Signed-off-by: Thomas E. Dickey --- include/X11/Intrinsic.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include') diff --git a/include/X11/Intrinsic.h b/include/X11/Intrinsic.h index 794b820..85afbf1 100644 --- a/include/X11/Intrinsic.h +++ b/include/X11/Intrinsic.h @@ -63,7 +63,16 @@ in this Software without prior written authorization from The Open Group. #define XtSpecificationRelease 6 +/* + * As used in its function interface, the String type of libXt can be readonly. + * But compiling libXt with this feature may require some internal changes, + * e.g., casts and occasionally using a plain "char*". + */ +#ifdef _CONST_X_STRING +typedef const char *String; +#else typedef char *String; +#endif /* We do this in order to get "const" declarations to work right. We * use _XtString instead of String so that C++ applications can -- cgit v1.2.1