mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
patch 8.0.0840: MS-Windows: fopen() and open() prototypes are wrong
Problem: MS-Windows: fopen() and open() prototypes do not match the ones in the system header file. Can't build without FEAT_MBYTE. Solution: Add "const". Move macro to after including protoo.h.
This commit is contained in:
@@ -191,9 +191,6 @@
|
|||||||
# ifndef WIN32
|
# ifndef WIN32
|
||||||
# define mch_access(n, p) access((n), (p))
|
# define mch_access(n, p) access((n), (p))
|
||||||
# endif
|
# endif
|
||||||
# if !(defined(FEAT_MBYTE) && defined(WIN3264))
|
|
||||||
# define mch_fopen(n, p) fopen((n), (p))
|
|
||||||
# endif
|
|
||||||
# define mch_fstat(n, p) fstat((n), (p))
|
# define mch_fstat(n, p) fstat((n), (p))
|
||||||
# ifdef MSWIN /* has it's own mch_stat() function */
|
# ifdef MSWIN /* has it's own mch_stat() function */
|
||||||
# define mch_stat(n, p) vim_stat((n), (p))
|
# define mch_stat(n, p) vim_stat((n), (p))
|
||||||
@@ -223,10 +220,6 @@
|
|||||||
* but it is not recommended, because it can destroy indexes etc.
|
* but it is not recommended, because it can destroy indexes etc.
|
||||||
*/
|
*/
|
||||||
# define mch_open(n, m, p) open(vms_fixfilename(n), (m), (p))
|
# define mch_open(n, m, p) open(vms_fixfilename(n), (m), (p))
|
||||||
# else
|
|
||||||
# if !(defined(FEAT_MBYTE) && defined(WIN3264))
|
|
||||||
# define mch_open(n, m, p) open((n), (m), (p))
|
|
||||||
# endif
|
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -6503,7 +6503,7 @@ getout:
|
|||||||
* Version of open() that may use UTF-16 file name.
|
* Version of open() that may use UTF-16 file name.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
mch_open(char *name, int flags, int mode)
|
mch_open(const char *name, int flags, int mode)
|
||||||
{
|
{
|
||||||
/* _wopen() does not work with Borland C 5.5: creates a read-only file. */
|
/* _wopen() does not work with Borland C 5.5: creates a read-only file. */
|
||||||
# ifndef __BORLANDC__
|
# ifndef __BORLANDC__
|
||||||
@@ -6536,7 +6536,7 @@ mch_open(char *name, int flags, int mode)
|
|||||||
* Version of fopen() that may use UTF-16 file name.
|
* Version of fopen() that may use UTF-16 file name.
|
||||||
*/
|
*/
|
||||||
FILE *
|
FILE *
|
||||||
mch_fopen(char *name, char *mode)
|
mch_fopen(const char *name, const char *mode)
|
||||||
{
|
{
|
||||||
WCHAR *wn, *wm;
|
WCHAR *wn, *wm;
|
||||||
FILE *f = NULL;
|
FILE *f = NULL;
|
||||||
|
@@ -4,6 +4,8 @@ HINSTANCE find_imported_module_by_funcname(HINSTANCE hInst, const char *funcname
|
|||||||
void *get_dll_import_func(HINSTANCE hInst, const char *funcname);
|
void *get_dll_import_func(HINSTANCE hInst, const char *funcname);
|
||||||
int dyn_libintl_init(void);
|
int dyn_libintl_init(void);
|
||||||
void dyn_libintl_end(void);
|
void dyn_libintl_end(void);
|
||||||
|
int null_libintl_putenv(const char *envstring);
|
||||||
|
int null_libintl_wputenv(const wchar_t *envstring);
|
||||||
void PlatformId(void);
|
void PlatformId(void);
|
||||||
void mch_setmouse(int on);
|
void mch_setmouse(int on);
|
||||||
void mch_update_cursor(void);
|
void mch_update_cursor(void);
|
||||||
@@ -56,8 +58,8 @@ int mch_wrename(WCHAR *wold, WCHAR *wnew);
|
|||||||
int mch_rename(const char *pszOldFile, const char *pszNewFile);
|
int mch_rename(const char *pszOldFile, const char *pszNewFile);
|
||||||
char *default_shell(void);
|
char *default_shell(void);
|
||||||
int mch_access(char *n, int p);
|
int mch_access(char *n, int p);
|
||||||
int mch_open(char *name, int flags, int mode);
|
int mch_open(const char *name, int flags, int mode);
|
||||||
FILE *mch_fopen(char *name, char *mode);
|
FILE *mch_fopen(const char *name, const char *mode);
|
||||||
int mch_copy_file_attribute(char_u *from, char_u *to);
|
int mch_copy_file_attribute(char_u *from, char_u *to);
|
||||||
int myresetstkoflw(void);
|
int myresetstkoflw(void);
|
||||||
int get_cmd_argsW(char ***argvp);
|
int get_cmd_argsW(char ***argvp);
|
||||||
|
@@ -769,6 +769,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
840,
|
||||||
/**/
|
/**/
|
||||||
839,
|
839,
|
||||||
/**/
|
/**/
|
||||||
|
@@ -2141,6 +2141,11 @@ typedef enum {
|
|||||||
# define number_width(x) 7
|
# define number_width(x) 7
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* This must come after including proto.h */
|
||||||
|
#if !(defined(FEAT_MBYTE) && defined(WIN3264))
|
||||||
|
# define mch_open(n, m, p) open((n), (m), (p))
|
||||||
|
# define mch_fopen(n, p) fopen((n), (p))
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "globals.h" /* global variables and messages */
|
#include "globals.h" /* global variables and messages */
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user