tccpp: fix bug in handling of recursive macros
[tinycc.git] / examples / ex4.c
blobb33b0331d6db4626c7e3f044ed265322e316b37f
1 #!./tcc -run -L/usr/X11R6/lib -lX11
2 #include <stdlib.h>
3 #include <stdio.h>
4 #include <X11/Xlib.h>
6 /* Yes, TCC can use X11 too ! */
8 int main(int argc, char **argv)
10 Display *display;
11 Screen *screen;
13 display = XOpenDisplay("");
14 if (!display) {
15 fprintf(stderr, "Could not open X11 display\n");
16 exit(1);
18 printf("X11 display opened.\n");
19 screen = XScreenOfDisplay(display, 0);
20 printf("width = %d\nheight = %d\ndepth = %d\n",
21 screen->width,
22 screen->height,
23 screen->root_depth);
24 XCloseDisplay(display);
25 return 0;