riscv: More insns, operands and arg slots
[tinycc.git] / examples / ex4.c
blobf92c0da9ff7c2cb7387a7bbb40efdf8b8774e5c6
1 #!/usr/local/bin/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;