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
|
|
|
|
2010-11-08 13:21:45 +03:00
|
|
|
#include <sys/types.h> /* BSD */
|
2013-11-24 09:39:16 +04:00
|
|
|
|
|
|
|
#if MAJOR_IN_MKDEV
|
|
|
|
#include <sys/mkdev.h>
|
|
|
|
#elif MAJOR_IN_SYSMACROS
|
|
|
|
#include <sys/sysmacros.h>
|
2005-01-28 01:19:48 +03:00
|
|
|
#endif
|
2005-01-26 01:54:41 +03:00
|
|
|
|
2010-01-17 15:51:07 +03:00
|
|
|
#if defined(_AIX)
|
2010-11-08 13:21:45 +03:00
|
|
|
#include <time.h> /* AIX for tm */
|
2010-01-17 15:51:07 +03:00
|
|
|
#endif
|
|
|
|
|
2010-11-08 13:21:45 +03:00
|
|
|
/*** typedefs(not structures) and defined constants **********************************************/
|
|
|
|
|
2005-01-26 01:54:41 +03:00
|
|
|
#ifndef major
|
2010-11-08 13:21:45 +03:00
|
|
|
#warning major() is undefined. Device numbers will not be shown correctly.
|
|
|
|
#define major(devnum) (((devnum) >> 8) & 0xff)
|
2005-01-26 01:54:41 +03:00
|
|
|
#endif
|
2010-11-08 13:21:45 +03:00
|
|
|
|
2005-01-26 01:54:41 +03:00
|
|
|
#ifndef minor
|
2010-11-08 13:21:45 +03:00
|
|
|
#warning minor() is undefined. Device numbers will not be shown correctly.
|
|
|
|
#define minor(devnum) (((devnum) & 0xff))
|
2005-01-26 01:54:41 +03:00
|
|
|
#endif
|
2010-11-08 13:21:45 +03:00
|
|
|
|
2005-01-28 02:02:24 +03:00
|
|
|
#ifndef makedev
|
2010-11-08 13:21:45 +03:00
|
|
|
#warning makedev() is undefined. Device numbers will not be shown correctly.
|
|
|
|
#define makedev(major,minor) ((((major) & 0xff) << 8) | ((minor) & 0xff))
|
2005-01-28 02:02:24 +03:00
|
|
|
#endif
|
2005-01-26 01:54:41 +03:00
|
|
|
|
2010-11-08 13:21:45 +03:00
|
|
|
/*** enums ***************************************************************************************/
|
|
|
|
|
|
|
|
/*** structures declarations (and typedefs of structures)*****************************************/
|
|
|
|
|
|
|
|
/*** global variables defined in .c file *********************************************************/
|
|
|
|
|
|
|
|
/*** declarations of public functions ************************************************************/
|
|
|
|
|
|
|
|
/*** inline functions ****************************************************************************/
|
|
|
|
|
2005-01-26 01:54:41 +03:00
|
|
|
#endif
|