2005-01-26 01:54:41 +03:00
|
|
|
|
2009-02-05 21:28:18 +03:00
|
|
|
/** \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.
|
2005-01-26 01:54:41 +03:00
|
|
|
*/
|
|
|
|
|
2009-02-05 21:28:18 +03:00
|
|
|
#ifndef MC_UNIXCOMPAT_H
|
|
|
|
#define MC_UNIXCOMPAT_H
|
2005-01-26 01:54:41 +03:00
|
|
|
|
|
|
|
#include <sys/types.h> /* BSD */
|
|
|
|
#ifdef HAVE_SYS_MKDEV_H
|
|
|
|
# include <sys/mkdev.h> /* Solaris 9 */
|
|
|
|
#endif
|
2005-02-24 02:49:30 +03:00
|
|
|
#if defined(_AIX) && defined(HAVE_SYS_SYSMACROS_H)
|
2005-01-28 01:19:48 +03:00
|
|
|
# include <sys/sysmacros.h> /* AIX */
|
|
|
|
#endif
|
2005-01-26 01:54:41 +03:00
|
|
|
|
2010-01-17 15:51:07 +03:00
|
|
|
#if defined(_AIX)
|
|
|
|
# include <time.h> /* AIX for tm */
|
|
|
|
#endif
|
|
|
|
|
2005-01-26 01:54:41 +03:00
|
|
|
#ifndef major
|
2005-02-08 01:59:51 +03:00
|
|
|
# warning major() is undefined. Device numbers will not be shown correctly.
|
2005-01-26 01:54:41 +03:00
|
|
|
# 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.
|
2005-02-22 06:47:01 +03:00
|
|
|
# define minor(devnum) (((devnum) & 0xff))
|
2005-01-26 01:54:41 +03:00
|
|
|
#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
|
2005-01-26 01:54:41 +03:00
|
|
|
|
|
|
|
#endif
|