mirror of
https://github.com/neovim/neovim.git
synced 2025-09-13 06:48:17 +00:00
remove HAVE_RENAME
rename is a C99 standard function.
This commit is contained in:

committed by
Thiago de Arruda

parent
3da084d612
commit
a96f2949cc
@@ -48,7 +48,6 @@
|
|||||||
#define HAVE_PUTENV 1
|
#define HAVE_PUTENV 1
|
||||||
#define HAVE_PWD_H 1
|
#define HAVE_PWD_H 1
|
||||||
#define HAVE_READLINK 1
|
#define HAVE_READLINK 1
|
||||||
#define HAVE_RENAME 1
|
|
||||||
#define HAVE_SELECT 1
|
#define HAVE_SELECT 1
|
||||||
// TODO: add proper cmake check
|
// TODO: add proper cmake check
|
||||||
// #define HAVE_SELINUX 1
|
// #define HAVE_SELINUX 1
|
||||||
|
@@ -2370,29 +2370,6 @@ char_u **file;
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef HAVE_RENAME
|
|
||||||
/*
|
|
||||||
* Scaled-down version of rename(), which is missing in Xenix.
|
|
||||||
* This version can only move regular files and will fail if the
|
|
||||||
* destination exists.
|
|
||||||
*/
|
|
||||||
int mch_rename(src, dest)
|
|
||||||
const char *src, *dest;
|
|
||||||
{
|
|
||||||
struct stat st;
|
|
||||||
|
|
||||||
if (stat(dest, &st) >= 0) /* fail if destination exists */
|
|
||||||
return -1;
|
|
||||||
if (link(src, dest) != 0) /* link file to new name */
|
|
||||||
return -1;
|
|
||||||
if (mch_remove(src) == 0) /* delete link to old name */
|
|
||||||
return 0;
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
#endif /* !HAVE_RENAME */
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#if defined(FEAT_LIBCALL) || defined(PROTO)
|
#if defined(FEAT_LIBCALL) || defined(PROTO)
|
||||||
typedef char_u * (*STRPROCSTR)(char_u *);
|
typedef char_u * (*STRPROCSTR)(char_u *);
|
||||||
typedef char_u * (*INTPROCSTR)(int);
|
typedef char_u * (*INTPROCSTR)(int);
|
||||||
|
@@ -253,11 +253,7 @@
|
|||||||
# define DFLT_MAXMEMTOT (10*1024) /* use up to 10 Mbyte for Vim */
|
# define DFLT_MAXMEMTOT (10*1024) /* use up to 10 Mbyte for Vim */
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
# ifdef HAVE_RENAME
|
#define mch_rename(src, dst) rename(src, dst)
|
||||||
# define mch_rename(src, dst) rename(src, dst)
|
|
||||||
# else
|
|
||||||
int mch_rename(const char *src, const char *dest);
|
|
||||||
# endif
|
|
||||||
|
|
||||||
#if !defined(S_ISDIR) && defined(S_IFDIR)
|
#if !defined(S_ISDIR) && defined(S_IFDIR)
|
||||||
# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
|
# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
|
||||||
|
Reference in New Issue
Block a user