Try to fix test

This commit is contained in:
Andy Cedilnik 2002-11-06 08:52:25 -05:00
parent 37b8509310
commit bde5ee3f44
1 changed files with 2 additions and 18 deletions

View File

@ -1,33 +1,17 @@
#include "stdio.h"
#ifdef CMAKE_HAS_X #ifdef CMAKE_HAS_X
#include <X11/Xlib.h> #include <X11/Xlib.h>
#include <X11/Xutil.h> #include <X11/Xutil.h>
#include <stdlib.h>
int main() int main()
{ {
Display *mydisplay; printf("There is X on this computer\n");
char* display = ":0";
if ( getenv("DISPLAY") )
{
display = getenv("DISPLAY");
}
mydisplay=XOpenDisplay(display);
if ( mydisplay )
{
XCloseDisplay(mydisplay);
}
return 0; return 0;
} }
#else #else
#include "stdio.h"
int main() int main()
{ {
printf("No X on this computer\n"); printf("No X on this computer\n");