diff options
author | Thomas E. Dickey <dickey@invisible-island.net> | 2019-03-19 20:31:29 -0400 |
---|---|---|
committer | Thomas E. Dickey <dickey@invisible-island.net> | 2019-04-15 19:43:52 -0400 |
commit | 965bc251c1d8391e672f277686254299627d4e3c (patch) | |
tree | efc7e9715a0453270a0ef4e21c04a6943972ebaa /include | |
parent | c131d277ef061716b97e27cccc094bf1c0ae222f (diff) | |
download | xorg-lib-libXt-965bc251c1d8391e672f277686254299627d4e3c.tar.gz |
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 <dickey@invisible-island.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/X11/Intrinsic.h | 9 |
1 files changed, 9 insertions, 0 deletions
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 |