* unixcompat.h: Provides macros and functions that are missing in

some Unix variants.
	* Makefile.am: Added unixcompat.h.
This commit is contained in:
Roland Illig 2005-01-25 22:54:41 +00:00
parent ccc1b17f7d
commit 0e1609c2f9
3 changed files with 32 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2005-01-25 Roland Illig <roland.illig@gmx.de>
* unixcompat.h: Provides macros and functions that are missing in
some Unix variants.
* Makefile.am: Added unixcompat.h.
2005-01-25 Roland Illig <roland.illig@gmx.de>
* dialog.h (widget_msg_t): Added WIDGET_RESIZED to inform widgets

View File

@ -59,7 +59,7 @@ SRCS = achown.c achown.h background.c background.h boxes.c boxes.h \
slint.c subshell.c subshell.h textconf.c textconf.h \
tree.c tree.h treestore.c treestore.h tty.h user.c user.h \
util.c util.h utilunix.c view.c view.h vfsdummy.h widget.c \
widget.h win.c win.h wtools.c wtools.h
widget.h win.c win.h wtools.c wtools.h unixcompat.h
if CHARSET
mc_SOURCES = $(SRCS) $(CHARSET_SRC)

25
src/unixcompat.h Normal file
View File

@ -0,0 +1,25 @@
#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
#ifndef major
# define major(devnum) (((devnum) >> 8) & 0xff)
#endif
#ifndef minor
# define minor(devnum) (((devnum) & 0xff)
#endif
#endif