home *** CD-ROM | disk | FTP | other *** search
/ RISCWORLD 7 / RISCWORLD_VOL7.iso / Software / Issue4 / SDL / gcc346 / !gcc / include / unixlib / sys / h / sysmacros < prev    next >
Encoding:
Text File  |  2006-09-17  |  1.6 KB  |  48 lines

  1. /****************************************************************************
  2.  *
  3.  * $Source: $
  4.  * $Date: $
  5.  * $Revision: $
  6.  * $State: $
  7.  * $Author: $
  8.  *
  9.  ***************************************************************************/
  10.  
  11. /*
  12.  * File taken from glibc 2.2.5.
  13.  * Following changes were made:
  14.  *  <none>
  15.  */
  16.  
  17. /* Definitions of macros to access `dev_t' values.
  18.    Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc.
  19.    This file is part of the GNU C Library.
  20.  
  21.    The GNU C Library is free software; you can redistribute it and/or
  22.    modify it under the terms of the GNU Lesser General Public
  23.    License as published by the Free Software Foundation; either
  24.    version 2.1 of the License, or (at your option) any later version.
  25.  
  26.    The GNU C Library is distributed in the hope that it will be useful,
  27.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  28.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  29.    Lesser General Public License for more details.
  30.  
  31.    You should have received a copy of the GNU Lesser General Public
  32.    License along with the GNU C Library; if not, write to the Free
  33.    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  34.    02111-1307 USA.  */
  35.  
  36. #ifndef _SYS_SYSMACROS_H
  37. #define _SYS_SYSMACROS_H    1
  38.  
  39. /* For compatibility we provide alternative names.
  40.  
  41.    The problem here is that compilers other than GCC probably don't
  42.    have the `long long' type and so `dev_t' is actually an array.  */
  43. #define major(dev) ((int)(((unsigned int) (dev) >> 8) & 0xff))
  44. #define minor(dev) ((int)((dev) & 0xff))
  45. #define makedev(major, minor) (((major) << 8) | (minor))
  46.  
  47. #endif /* sys/sysmacros.h */
  48.