From 4d1d0113fd3309aac30b2dd1d443bf7c7d5f0a3d Mon Sep 17 00:00:00 2001 From: Erik Andersen Date: Fri, 17 Dec 1999 18:44:15 +0000 Subject: 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 --- util-linux/fbset.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'util-linux') 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 #include #include +#include #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; -- cgit v1.2.3