When using dpms.h in a C++ program. The code is compiled and linked correctly, but when the program is ran the DPMS symbols have been mangled by C++ and the DPMS* functions can't be located and the program crashes. Suggest putting and #ifdef __cplusplus extern "C" in the dpms.h header to correct this problem. Example from xpm.h, which works correctly with C++ #ifdef __cplusplus extern "C" { #endif Version-Release number of selected component (if applicable): xorg-x11-devel-6.7.0-2 How reproducible: Always Steps to Reproduce: 1. create a c++ program that uses DPMSQueryExtension 2. compile and link program 3. execute program Actual Results: relocation error: undefined symbol: _Z18DPMSQueryExtensionP9_XDisplayPiS1_ Expected Results: Program should execute correctly. Additional info: When compiling against C code the program works correctly. In my program I did this and it solved the problem #ifdef DPMSExtension #include <X11/Xlib.h> #ifndef DPMS_SERVER #include <X11/X.h> #include <X11/Xmd.h> extern "C" Bool DPMSQueryExtension(Display *, int *, int *); extern "C" Bool DPMSCapable(Display *); extern "C" Status DPMSInfo(Display *, CARD16 *, BOOL *); extern "C" Status DPMSEnable(Display *); #endif #endif See Fedora Core 2 bug 125979 https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=125979
Wrong component... "xserver" is not X.Org. Reassigning to xorg component.
Does anyone have comments on this issue?
Created attachment 811 [details] [review] patch for dpms.h to compile with C++ code This patch fixes compilation with C++ code. So that code is correctly identified as C code. Much like the xpm.h header file.
Comment on attachment 811 [details] [review] patch for dpms.h to compile with C++ code Isn't it sufficient to use |_XFUNCPROTOBEGIN| and |_XFUNCPROTOEND| like used in all the other X11 header files ?
Created attachment 815 [details] [review] Alternate patch that uses _XFUNCPROTOBEGIN and _XFUNCPROTOEND Same patch, but it uses _XFUNCPROTOBEGIN and _XFUNCPROTOEND instead of the #ifdef __cplusplus
Comment on attachment 815 [details] [review] Alternate patch that uses _XFUNCPROTOBEGIN and _XFUNCPROTOEND The patch looks fine for me... Nit: Is it possible to fix xpm.h, too (e.g. replace the "manual" |extern "C"| with _XFUNCPROTOBEGIN and _XFUNCPROTOEND) ?
Created attachment 816 [details] [review] Patch for xpm.h to use _XFUNCPROTOBEGIN and _XFUNCPROTOEND Patch for xpm.h to use _XFUNCPROTOBEGIN and _XFUNCPROTOEND. This was requested by Roland.
Comment on attachment 816 [details] [review] Patch for xpm.h to use _XFUNCPROTOBEGIN and _XFUNCPROTOEND This is defective
Created attachment 817 [details] [review] Corrected version of xpm.h.patch Previous patch had a bug in it. This should fix it.
Kevin: Can we take both patches for the release (assuming that I and Alan Coopersmith verify that the patch works on Linux/Solaris) ?
Roland, You make the patches and do what you want with them. I am not holding any license or other restriction on them other than the normal xorg license. Kevin
Roland et al., the 6.8 release is now frozen for all but documentation changes. These fixes can go in after we cut the 6.8 release.
Kevin DeKorte wrote: > You make the patches and do what you want with them. I am not holding any > license or other restriction on them other than the normal xorg license. Oh... we have two Kevins here... :) I was thinking about Kevin Martin in this case since he is the release manager for X11R6.8 and he decides what goes "in" into the "frozen" tree and what not.
Kevin E. Martin wrote: > Roland et al., the 6.8 release is now frozen for all but documentation > changes. I know, but AFAIK you are allowed to make exceptions from the rule (the changes seems to be trivial with low risk) ... but on the other side the final release canidate already has been cut so even those changes may be to "risky"... > These fixes can go in after we cut the 6.8 release. Agreed.
Taking bug myself to get some action here...
Created attachment 1492 [details] [review] [FIXED_X11R68x] Final patch for X11/extensions/dpms.h (patch for 2004-12-06-trunk)
Attachment #1492 [details] checked-in: /cvs/xorg/xc/ChangeLog,v <-- ChangeLog new revision: 1.581; previous revision: 1.580 /cvs/xorg/xc/include/extensions/dpms.h,v <-- dpms.h new revision: 1.3; previous revision: 1.2 Mailing the commit message to xorg-commit@lists.freedesktop.org...
Created attachment 1493 [details] [review] [FIXED_X11R68x] xpm.h diff including Changelog, patch for 2004-12-07-trunk
Attachment #1493 [details] checked-in: /cvs/xorg/xc/ChangeLog,v <-- ChangeLog new revision: 1.582; previous revision: 1.581 /cvs/xorg/xc/extras/Xpm/lib/xpm.h,v <-- xpm.h new revision: 1.3; previous revision: 1.2 Mailing the commit message to xorg-commit@lists.freedesktop.org... Both fixes checked-in into Xorg trunk, marking bug as FIXED.
Comment on attachment 1492 [details] [review] [FIXED_X11R68x] Final patch for X11/extensions/dpms.h (patch for 2004-12-06-trunk) Requesting approval for X11R6.8.x branch. The patch fixes the problem in the same way used in all other X11 headers so the changes should be pretty much safe.
Comment on attachment 1493 [details] [review] [FIXED_X11R68x] xpm.h diff including Changelog, patch for 2004-12-07-trunk Requesting approval for X11R6.8.x branch... it's a pure "correctness" patch which should not harm anyone - after the CPP preprocessor phase the resulting code is identical (we're just using now the "official" X11 way to mark the begin/end of function prototypes instead of using homegrown C++ code).
Comment on attachment 1492 [details] [review] [FIXED_X11R68x] Final patch for X11/extensions/dpms.h (patch for 2004-12-06-trunk) Approval for X11R6.8.x stable branch granted in the 2004-12-08 release-wranglers phone call. Please don't commit, I'll do that myself...
Comment on attachment 1493 [details] [review] [FIXED_X11R68x] xpm.h diff including Changelog, patch for 2004-12-07-trunk Approval for X11R6.8.x stable branch granted in the 2004-12-08 release-wranglers phone call. Please don't commit, I'll do that myself...
Comment on attachment 1492 [details] [review] [FIXED_X11R68x] Final patch for X11/extensions/dpms.h (patch for 2004-12-06-trunk) Patch checked-in into X11R6.8.x stable branch: /cvs/xorg/xc/ChangeLog,v <-- ChangeLog new revision: 1.365.2.34; previous revision: 1.365.2.33 cvs commit: Using deprecated info format strings. Convert your scripts to use the new argument format and remove '1's from your info file format strings. /cvs/xorg/xc/include/extensions/dpms.h,v <-- dpms.h new revision: 1.2.4.1; previous revision: 1.2 cvs commit: Using deprecated info format strings. Convert your scripts to use the new argument format and remove '1's from your info file format strings. Mailing the commit message to xorg-commit@lists.freedesktop.org...
Comment on attachment 1493 [details] [review] [FIXED_X11R68x] xpm.h diff including Changelog, patch for 2004-12-07-trunk Patch checked-in into X11R6.8.x stable branch: /cvs/xorg/xc/ChangeLog,v <-- ChangeLog new revision: 1.365.2.35; previous revision: 1.365.2.34 cvs commit: Using deprecated info format strings. Convert your scripts to use the new argument format and remove '1's from your info file format strings. /cvs/xorg/xc/extras/Xpm/lib/xpm.h,v <-- xpm.h new revision: 1.2.4.1; previous revision: 1.2 cvs commit: Using deprecated info format strings. Convert your scripts to use the new argument format and remove '1's from your info file format strings. Mailing the commit message to xorg-commit@lists.freedesktop.org...
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.