June 1994
Intermediate to advanced
821 pages
24h 40m
English
In R5 and later, Xlib defines the symbol
XlibSpecificationRelease with the release number as
the value (i.e., 5). This can be used to allow an application to
successfully compile with more than one release of Xlib (assuming of
course it depends only on features present in the releases which it will
be compiled). Example 15-4 shows a code
segment into which R4, R5 and R6 code could be inserted:
Example 15-4. Using the XlibSpecificationRelease symbol
#ifdef XlibSpecificationRelease
if (XlibSpecificationRelease == 5)
;/* R5 */
else if (XlibSpecificationRelease == 6)
;/* R6 */
else
;/* R7 or error */
#elseif
/* R4 */
#endifRead now
Unlock full access