From owner-cvs-all Mon May 10 11:21:44 1999 Delivered-To: cvs-all@freebsd.org Received: from helios.dnttm.ru (dnttm-gw.rssi.ru [193.232.0.205]) by hub.freebsd.org (Postfix) with ESMTP id 83FAF14BF2; Mon, 10 May 1999 11:21:26 -0700 (PDT) (envelope-from dima@tejblum.dnttm.rssi.ru) Received: (from uucp@localhost) by helios.dnttm.ru (8.9.1/8.9.1/IP-3) with UUCP id WAA10825; Mon, 10 May 1999 22:15:28 +0400 Received: from tejblum.dnttm.rssi.ru (localhost [127.0.0.1]) by tejblum.dnttm.rssi.ru (8.9.3/8.9.1) with ESMTP id WAA01570; Mon, 10 May 1999 22:17:51 +0400 (MSD) (envelope-from dima@tejblum.dnttm.rssi.ru) Message-Id: <199905101817.WAA01570@tejblum.dnttm.rssi.ru> X-Mailer: exmh version 2.0gamma 1/27/96 To: Poul-Henning Kamp Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/usr.bin/file fsmagic.c In-reply-to: Your message of "Mon, 10 May 1999 11:06:39 PDT." <199905101806.LAA28487@freefall.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 10 May 1999 22:17:50 +0400 From: Dmitrij Tejblum Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk Poul-Henning Kamp wrote: > phk 1999/05/10 11:06:39 PDT > > Modified files: > usr.bin/file fsmagic.c > Log: > Don't go looking for weird #includes if major isn't a macro. > Try something like this instead: --- types.h Mon May 10 21:55:39 1999 +++ types.h Mon May 10 22:00:54 1999 @@ -119,26 +119,38 @@ * bits 16-31 for devices that don't use them. */ +#ifdef __GNUC__ + static __inline int -minor(dev_t dev) +__minor(dev_t _dev) { - return(dev & 0xffff00ff); + return(_dev & 0xffff00ff); } static __inline int -major(dev_t dev) +__major(dev_t _dev) { - return((dev & 0xff00) >> 8); + return((_dev & 0xff00) >> 8); } static __inline dev_t -makedev(int x, int y) +__makedev(int _x, int _y) { - return ((x << 8) | y); + return ((_x << 8) | _y); } -#endif +#define major(x) __major(x) +#define minor(x) __minor(x) +#define makedev(x,y) __makedev(x,y) + +#else +#define major(x) ((int)(((u_int)(x) >> 8)&0xff)) /* major number */ +#define minor(x) ((int)((x)&0xffff00ff)) /* minor number */ +#define makedev(x,y) ((dev_t)(((x) << 8) | (y))) /* create dev_t */ + +#endif +#endif #include #ifdef _BSD_CLOCK_T_ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message