mc.keymap.emacs: fix of LinkSymbolicRelative keymap.
[midnight-commander.git] / lib / unixcompat.h
blob8021c6048da38ce558c99c8f0759ec8a31c40600
1 /** \file unixcompat.h
2 * \brief Header: collects differences between the various Unix
4 * This header file collects differences between the various Unix
5 * variants that are supported by the Midnight Commander and provides
6 * replacement routines if they are not natively available.
7 * The major/minor macros are not specified in SUSv3, so we can only hope
8 * they are provided by the operating system or emulate it.
9 */
11 #ifndef MC_UNIXCOMPAT_H
12 #define MC_UNIXCOMPAT_H
14 #include <sys/types.h> /* BSD */
15 #ifdef HAVE_SYS_MKDEV_H
16 #include <sys/mkdev.h> /* Solaris 9 */
17 #endif
18 #if defined(_AIX) && defined(HAVE_SYS_SYSMACROS_H)
19 #include <sys/sysmacros.h> /* AIX */
20 #endif
22 #if defined(_AIX)
23 #include <time.h> /* AIX for tm */
24 #endif
26 /*** typedefs(not structures) and defined constants **********************************************/
28 #ifndef major
29 #warning major() is undefined. Device numbers will not be shown correctly.
30 #define major(devnum) (((devnum) >> 8) & 0xff)
31 #endif
33 #ifndef minor
34 #warning minor() is undefined. Device numbers will not be shown correctly.
35 #define minor(devnum) (((devnum) & 0xff))
36 #endif
38 #ifndef makedev
39 #warning makedev() is undefined. Device numbers will not be shown correctly.
40 #define makedev(major,minor) ((((major) & 0xff) << 8) | ((minor) & 0xff))
41 #endif
43 /*** enums ***************************************************************************************/
45 /*** structures declarations (and typedefs of structures)*****************************************/
47 /*** global variables defined in .c file *********************************************************/
49 /*** declarations of public functions ************************************************************/
51 /*** inline functions ****************************************************************************/
53 #endif