2005-01-25 22:54:41 +00:00
|
|
|
#ifndef MC_UNIXCOMPAT_H
|
|
|
|
#define MC_UNIXCOMPAT_H
|
|
|
|
|
|
|
|
/* 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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <sys/types.h> /* BSD */
|
|
|
|
#ifdef HAVE_SYS_MKDEV_H
|
|
|
|
# include <sys/mkdev.h> /* Solaris 9 */
|
|
|
|
#endif
|
2005-02-23 23:49:30 +00:00
|
|
|
#if defined(_AIX) && defined(HAVE_SYS_SYSMACROS_H)
|
2005-01-27 22:19:48 +00:00
|
|
|
# include <sys/sysmacros.h> /* AIX */
|
|
|
|
#endif
|
2005-01-25 22:54:41 +00:00
|
|
|
|
|
|
|
#ifndef major
|
2005-02-07 22:59:51 +00:00
|
|
|
# warning major() is undefined. Device numbers will not be shown correctly.
|
2005-01-25 22:54:41 +00:00
|
|
|
# define major(devnum) (((devnum) >> 8) & 0xff)
|
|
|
|
#endif
|
|
|
|
#ifndef minor
|
2005-02-12 22:16:25 +00:00
|
|
|
# warning minor() is undefined. Device numbers will not be shown correctly.
|
2005-02-22 03:47:01 +00:00
|
|
|
# define minor(devnum) (((devnum) & 0xff))
|
2005-01-25 22:54:41 +00:00
|
|
|
#endif
|
2005-01-27 23:02:24 +00:00
|
|
|
#ifndef makedev
|
2005-02-12 22:16:25 +00:00
|
|
|
# warning makedev() is undefined. Device numbers will not be shown correctly.
|
2005-01-27 23:02:24 +00:00
|
|
|
# define makedev(major,minor) ((((major) & 0xff) << 8) | ((minor) & 0xff))
|
|
|
|
#endif
|
2005-01-25 22:54:41 +00:00
|
|
|
|
|
|
|
#endif
|