mc/lib/unixcompat.h

41 lines
1.2 KiB
C
Raw Normal View History

/** \file unixcompat.h
* \brief Header: collects differences between the various Unix
*
* This header file collects differences between the various Unix
* variants that are supported by the Midnight Commander and provides
* replacement routines if they are not natively available.
* The major/minor macros are not specified in SUSv3, so we can only hope
* they are provided by the operating system or emulate it.
*/
#ifndef MC_UNIXCOMPAT_H
#define MC_UNIXCOMPAT_H
#include <sys/types.h> /* BSD */
#ifdef HAVE_SYS_MKDEV_H
# include <sys/mkdev.h> /* Solaris 9 */
#endif
#if defined(_AIX) && defined(HAVE_SYS_SYSMACROS_H)
# include <sys/sysmacros.h> /* AIX */
#endif
#if defined(_AIX)
# include <time.h> /* AIX for tm */
#endif
#ifndef major
# warning major() is undefined. Device numbers will not be shown correctly.
# define major(devnum) (((devnum) >> 8) & 0xff)
#endif
#ifndef minor
2005-02-13 01:16:25 +03:00
# warning minor() is undefined. Device numbers will not be shown correctly.
# define minor(devnum) (((devnum) & 0xff))
#endif
2005-01-28 02:02:24 +03:00
#ifndef makedev
2005-02-13 01:16:25 +03:00
# warning makedev() is undefined. Device numbers will not be shown correctly.
2005-01-28 02:02:24 +03:00
# define makedev(major,minor) ((((major) & 0xff) << 8) | ((minor) & 0xff))
#endif
#endif