hay guys why isn't XOpenDisplay()'s argument const char?

Alan Coopersmith alan.coopersmith at oracle.com
Wed Oct 5 14:24:58 UTC 2016


On 10/ 4/16 07:48 PM, Ashe Goulding wrote:
> Is it safe to regard it as const char?

Since it's declared as const char, yes:

#ifndef _Xconst
#define _Xconst const
#endif /* _Xconst */

extern Display *XOpenDisplay(
     _Xconst char*       /* display_name */
);

(The ifdef used to be much more complicated, since libX11 was written before
  all compilers had support for const, but since we no longer support pre-C89
  compilers, it got simplified to this years back.)

-- 
	-Alan Coopersmith-              alan.coopersmith at oracle.com
	 Oracle Solaris Engineering - http://blogs.oracle.com/alanc


More information about the xorg mailing list