Subject: pkg/9863: pkgsrc/x11/xlockmore nit (missing include files and bad function decl)
To: None <gnats-bugs@gnats.netbsd.org>
From: Sean Doran <smd@ebone.net>
List: netbsd-bugs
Date: 04/12/2000 06:14:09
>Number:         9863
>Category:       pkg
>Synopsis:       build of pkgsrc/x11/xlockmore with XFree86's 4.0 fails
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Apr 12 06:15:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Sean Doran
>Release:        cvs as of 20000412
>Organization:
Sean Doran <smd@ebone.net>
Development Manager, Ebone Inc., Copenhagen Denmark
>Environment:
	
System: NetBSD sean.ebone.net 1.4X NetBSD 1.4X (EBONE) #0: Wed Apr 5 00:40:25 CEST 2000 smd@sean.ebone.net:/usr/src/sys/arch/i386/compile/EBONE i386


>Description:
  the xlockmore package won't build if XFree86 4.0 is installed
  because of the following code snippet in .../xlockmore-4.14/xlock/xlock.c :

(line 592-)

#ifdef USE_DPMS
#define MIN_DPMS 30             /* 30 second minimum */
#include <X11/extensions/dpms.h>
extern unsigned char DPMSQueryExtension(Display *, int *, int *);
extern int  DPMSGetTimeouts(Display *, unsigned short *, unsigned short *, unsig
ned short *);
extern int  DPMSSetTimeouts(Display *, unsigned short, unsigned short, unsigned
short);

which leads to 

...
===> Building for xlockmore-4.14
cc -c -o ./xlock.o  -DHAVE_CONFIG_H -DDEF_FILESEARCHPATH=\"/usr/X11R6/lib/X11/app-defaults/%N%C%S:/usr/X11R6/lib/X11/app-defaults/%N%S\"  -I. -I.. -I../.. -I/usr/X11R6/include -I/usr/X11R6/include  -I/usr/X11R6/include/X11 -I/usr/X11R6/include -pipe -O3 -march=i686 -mfancy-math-387 -fsched-interblock -fsched-spec -fsched-spec-load -fbranch-count-reg ./xlock.c
In file included from ./xlock.c:594:
/usr/X11R6/include/X11/extensions/dpms.h:48: syntax error before `CARD16'
/usr/X11R6/include/X11/extensions/dpms.h:49: syntax error before `CARD16'
/usr/X11R6/include/X11/extensions/dpms.h:52: syntax error before `CARD16'
/usr/X11R6/include/X11/extensions/dpms.h:53: syntax error before `CARD16'
./xlock.c:595: conflicting types for `DPMSQueryExtension'
/usr/X11R6/include/X11/extensions/dpms.h:45: previous declaration of `DPMSQueryExtension'
./xlock.c:597: conflicting types for `DPMSSetTimeouts'
./xlock.c:597: An argument type that has a default promotion
./xlock.c:597: can't match an empty parameter name list declaration.
/usr/X11R6/include/X11/extensions/dpms.h:48: previous declaration of `DPMSSetTimeouts'
*** Error code 1

Stop.


>How-To-Repeat:
	install XFree86 v 4.0 from http://www.xfree86.org/
	cd /usr/pkgsrc/x11/xlockmore
	make
>Fix:

This patch makes it build.

--- xlock.c     Fri Jun 18 22:23:41 1999
+++ /tmp/xlock.c+       Wed Apr 12 15:11:14 2000
@@ -591,8 +591,12 @@
 #endif
 #ifdef USE_DPMS
 #define MIN_DPMS 30            /* 30 second minimum */
+#include <X11/Xlib.h>  /* needed */
+#include <X11/Xdmcp.h> /* needed */
 #include <X11/extensions/dpms.h>
-extern unsigned char DPMSQueryExtension(Display *, int *, int *);
+/* bad decl
+ * extern unsigned char DPMSQueryExtension(Display *, int *, int *);
+ */
 extern int  DPMSGetTimeouts(Display *, unsigned short *, unsigned short *, unsigned short *);
 extern int  DPMSSetTimeouts(Display *, unsigned short, unsigned short, unsigned short);
 extern int  dpmsstandby;

>Release-Note:
>Audit-Trail:
>Unformatted: