1
1

* util.c: Move replacements for permission bits ...

* fs.h: ... here.  Add more replacements.
* global.h: Include direct.h only with MSVC.
Этот коммит содержится в:
Pavel Roskin 2002-01-22 01:23:18 +00:00
родитель 3d0de08b32
Коммит e5c6976b15
4 изменённых файлов: 52 добавлений и 15 удалений

Просмотреть файл

@ -1,5 +1,9 @@
2002-01-21 Pavel Roskin <proski@gnu.org>
* util.c: Move replacements for permission bits ...
* fs.h: ... here. Add more replacements.
* global.h: Include direct.h only with MSVC.
* main.c: Include "drive.h", not <drive.h>, do it after panel.h.
Use _OS_NT as the condition for including drive.h.
* screen.c: Use _OS_NT as the condition for including drive.h.

Просмотреть файл

@ -2,12 +2,56 @@
#ifndef __FS_H
#define __FS_H
#include <sys/types.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#include <sys/stat.h>
/* Replacement for permission bits missing in sys/stat.h */
#ifndef S_IFLNK
# define S_IFLNK 0
#endif
#ifndef S_ISLNK
# define S_ISLNK(x) (((x) & S_IFLNK) == S_IFLNK)
#endif
#ifndef S_IFSOCK
# define S_IFSOCK 0
#endif
#ifndef S_ISSOCK
# define S_ISSOCK(x) (((x) & S_IFSOCK) == S_IFSOCK)
#endif
#ifndef S_IFFIFO
# define S_IFFIFO 0
#endif
#ifndef S_ISFIFO
# define S_ISFIFO(x) (((x) & S_IFFIFO) == S_IFFIFO)
#endif
#ifndef S_IFCHR
# define S_IFCHR 0
#endif
#ifndef S_ISCHR
# define S_ISCHR(x) (((x) & S_IFCHR) == S_IFCHR)
#endif
#ifndef S_IFBLK
# define S_IFBLK 0
#endif
#ifndef S_ISBLK
# define S_ISBLK(x) (((x) & S_IFBLK) == S_IFBLK)
#endif
#ifndef MAXPATHLEN
# define MC_MAXPATHLEN 4096
#else
@ -40,4 +84,4 @@
# endif /* HAVE_NDIR_H */
#endif /* not (HAVE_DIRENT_H or _POSIX_VERSION) */
#endif
#endif /* !__FS_H */

Просмотреть файл

@ -11,7 +11,9 @@
#ifdef _OS_NT
# include <windows.h>
# include <io.h>
# include <direct.h>
#ifdef _MSC_VER
# include <direct.h> /* from mkdir() */
#endif
#endif
#ifdef HAVE_SYS_PARAM_H

Просмотреть файл

@ -46,19 +46,6 @@ int get_int (char *, char *, int);
char *load_file (char *filename);
char *load_mc_home_file (const char *filename, char ** allocated_filename);
#include "fs.h"
#ifndef S_ISLNK
# define S_ISLNK(x) (((x) & S_IFLNK) == S_IFLNK)
#endif
#ifndef S_ISSOCK
# ifdef S_IFSOCK
# define S_ISSOCK(x) (((x) & S_IFSOCK) == S_IFSOCK)
# else
# define S_ISSOCK(x) 0
# endif
#endif
/* uid/gid managing */
void init_groups (void);
void destroy_groups (void);