diff options
author | Erik Andersen <andersen@codepoet.org> | 1999-12-17 21:44:15 +0300 |
---|---|---|
committer | Erik Andersen <andersen@codepoet.org> | 1999-12-17 21:44:15 +0300 |
commit | 4d1d0113fd3309aac30b2dd1d443bf7c7d5f0a3d (patch) | |
tree | 1d18bbba8f8a1d78d7ff13e7a87ee2aab165125f /util-linux | |
parent | 6da0ae8183a31d4faab745d534a363c7e66ef864 (diff) |
Reworked the source so it will compile and run under glibc 2.0.7
and linux kernel 2.0.36 (though the dubious reasons why someone
would want to do that defy imagination ;)
-Erik
Diffstat (limited to 'util-linux')
-rw-r--r-- | util-linux/fbset.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/util-linux/fbset.c b/util-linux/fbset.c index 3f7e4552a..c29145e51 100644 --- a/util-linux/fbset.c +++ b/util-linux/fbset.c @@ -32,9 +32,14 @@ #include <ctype.h> #include <sys/ioctl.h> #include <linux/fb.h> +#include <linux/version.h> #define PERROR(ctx) do { perror(ctx); exit(1); } while(0) +#ifndef KERNEL_VERSION +#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) +#endif + #define DEFAULTFBDEV "/dev/fb0" #define DEFAULTFBMODE "/etc/fb.modes" @@ -185,10 +190,16 @@ static void showmode(struct fb_var_screeninfo *v) #endif printf("\tgeometry %u %u %u %u %u\n", v->xres, v->yres, v->xres_virtual, v->yres_virtual, v->bits_per_pixel); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,0) printf("\ttimings %u %u %u %u %u %u %u\n", v->pixclock, v->left_margin, v->right_margin, v->upper_margin, v->lower_margin, v->hsync_len, v->vsync_len); printf("\taccel %s\n", (v->accel_flags > 0 ? "true" : "false")); +#else + printf("\ttimings %lu %lu %lu %lu %lu %lu %lu\n", v->pixclock, v->left_margin, + v->right_margin, v->upper_margin, v->lower_margin, v->hsync_len, + v->vsync_len); +#endif printf("\trgba %u/%u,%u/%u,%u/%u,%u/%u\n", v->red.length, v->red.offset, v->green.length, v->green.offset, v->blue.length, v->blue.offset, v->transp.length, v->transp.offset); @@ -215,7 +226,6 @@ extern int fbset_main(int argc, char **argv) #endif { struct fb_var_screeninfo var, varset; - struct fb_fix_screeninfo fix; int fh, i; char *fbdev = DEFAULTFBDEV; char *modefile = DEFAULTFBMODE; |