mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
patch 7.4.1216
Problem: Still using HAVE_STDARG_H. Solution: Assume it's always defined.
This commit is contained in:
parent
b638a7be95
commit
ba4ef2757c
2
src/auto/configure
vendored
2
src/auto/configure
vendored
@ -10064,7 +10064,7 @@ fi
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
fi
|
||||
|
||||
for ac_header in stdarg.h stdint.h stdlib.h string.h \
|
||||
for ac_header in stdint.h stdlib.h string.h \
|
||||
sys/select.h sys/utsname.h termcap.h fcntl.h \
|
||||
sgtty.h sys/ioctl.h sys/time.h sys/types.h \
|
||||
termio.h iconv.h inttypes.h langinfo.h math.h \
|
||||
|
39
src/eval.c
39
src/eval.c
@ -15217,13 +15217,11 @@ f_prevnonblank(typval_T *argvars, typval_T *rettv)
|
||||
rettv->vval.v_number = lnum;
|
||||
}
|
||||
|
||||
#ifdef HAVE_STDARG_H
|
||||
/* This dummy va_list is here because:
|
||||
* - passing a NULL pointer doesn't work when va_list isn't a pointer
|
||||
* - locally in the function results in a "used before set" warning
|
||||
* - using va_start() to initialize it gives "function with fixed args" error */
|
||||
static va_list ap;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* "printf()" function
|
||||
@ -15231,32 +15229,29 @@ static va_list ap;
|
||||
static void
|
||||
f_printf(typval_T *argvars, typval_T *rettv)
|
||||
{
|
||||
char_u buf[NUMBUFLEN];
|
||||
int len;
|
||||
char_u *s;
|
||||
int saved_did_emsg = did_emsg;
|
||||
char *fmt;
|
||||
|
||||
rettv->v_type = VAR_STRING;
|
||||
rettv->vval.v_string = NULL;
|
||||
#ifdef HAVE_STDARG_H /* only very old compilers can't do this */
|
||||
{
|
||||
char_u buf[NUMBUFLEN];
|
||||
int len;
|
||||
char_u *s;
|
||||
int saved_did_emsg = did_emsg;
|
||||
char *fmt;
|
||||
|
||||
/* Get the required length, allocate the buffer and do it for real. */
|
||||
did_emsg = FALSE;
|
||||
fmt = (char *)get_tv_string_buf(&argvars[0], buf);
|
||||
len = vim_vsnprintf(NULL, 0, fmt, ap, argvars + 1);
|
||||
if (!did_emsg)
|
||||
/* Get the required length, allocate the buffer and do it for real. */
|
||||
did_emsg = FALSE;
|
||||
fmt = (char *)get_tv_string_buf(&argvars[0], buf);
|
||||
len = vim_vsnprintf(NULL, 0, fmt, ap, argvars + 1);
|
||||
if (!did_emsg)
|
||||
{
|
||||
s = alloc(len + 1);
|
||||
if (s != NULL)
|
||||
{
|
||||
s = alloc(len + 1);
|
||||
if (s != NULL)
|
||||
{
|
||||
rettv->vval.v_string = s;
|
||||
(void)vim_vsnprintf((char *)s, len + 1, fmt, ap, argvars + 1);
|
||||
}
|
||||
rettv->vval.v_string = s;
|
||||
(void)vim_vsnprintf((char *)s, len + 1, fmt, ap, argvars + 1);
|
||||
}
|
||||
did_emsg |= saved_did_emsg;
|
||||
}
|
||||
#endif
|
||||
did_emsg |= saved_did_emsg;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -6023,11 +6023,7 @@ emsg3(char_u *s, char_u *a1, char_u *a2)
|
||||
{
|
||||
if (emsg_not_now())
|
||||
return TRUE; /* no error messages at the moment */
|
||||
#ifdef HAVE_STDARG_H
|
||||
vim_snprintf((char *)IObuff, IOSIZE, (char *)s, a1, a2);
|
||||
#else
|
||||
vim_snprintf((char *)IObuff, IOSIZE, (char *)s, (long_u)a1, (long_u)a2);
|
||||
#endif
|
||||
return emsg(IObuff);
|
||||
}
|
||||
|
||||
|
@ -20,9 +20,6 @@
|
||||
# if defined(AZTEC_C) || defined(__amigaos4__)
|
||||
# define HAVE_STAT_H
|
||||
# endif
|
||||
# ifdef __amigaos4__
|
||||
# define HAVE_STDARG_H
|
||||
# endif
|
||||
# define HAVE_STDLIB_H
|
||||
# define HAVE_STRING_H
|
||||
# define HAVE_FCNTL_H
|
||||
|
@ -21,7 +21,6 @@
|
||||
# define USE_LONG_FNAME _USE_LFN /* decide at run time */
|
||||
# define USE_FNAME_CASE
|
||||
# define HAVE_PUTENV
|
||||
# define HAVE_STDARG_H
|
||||
#else
|
||||
# define SHORT_FNAME /* always 8.3 file name */
|
||||
#endif
|
||||
|
@ -109,7 +109,6 @@
|
||||
#define HAVE_FSYNC
|
||||
#define HAVE_GETPWUID
|
||||
#define HAVE_GETPWNAM
|
||||
#define HAVE_STDARG_H
|
||||
#define HAVE_STDLIB_H
|
||||
#define HAVE_STRING_H
|
||||
#define HAVE_ERRNO_H
|
||||
|
@ -49,9 +49,6 @@
|
||||
#ifndef HAVE_FCNTL_H
|
||||
# define HAVE_FCNTL_H
|
||||
#endif
|
||||
#ifndef HAVE_STDARG_H
|
||||
# define HAVE_STDARG_H
|
||||
#endif
|
||||
#define HAVE_QSORT
|
||||
#define HAVE_ST_MODE /* have stat.st_mode */
|
||||
|
||||
|
@ -104,9 +104,7 @@ extern int _stricoll(char *a, char *b);
|
||||
# include "menu.pro"
|
||||
# endif
|
||||
|
||||
# if !defined MESSAGE_FILE || defined(HAVE_STDARG_H)
|
||||
/* These prototypes cannot be produced automatically and conflict with
|
||||
* the old-style prototypes in message.c. */
|
||||
/* These prototypes cannot be produced automatically. */
|
||||
int
|
||||
# ifdef __BORLANDC__
|
||||
_RTLENTRYF
|
||||
@ -131,10 +129,7 @@ _RTLENTRYF
|
||||
# endif
|
||||
vim_snprintf(char *, size_t, char *, ...);
|
||||
|
||||
# if defined(HAVE_STDARG_H)
|
||||
int vim_vsnprintf(char *str, size_t str_m, char *fmt, va_list ap, typval_T *tvs);
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# include "message.pro"
|
||||
# include "misc1.pro"
|
||||
|
@ -746,6 +746,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
1216,
|
||||
/**/
|
||||
1215,
|
||||
/**/
|
||||
|
@ -508,9 +508,7 @@ typedef unsigned long u8char_T; /* long should be 32 bits or more */
|
||||
#ifdef HAVE_WCTYPE_H
|
||||
# include <wctype.h>
|
||||
#endif
|
||||
#ifdef HAVE_STDARG_H
|
||||
# include <stdarg.h>
|
||||
#endif
|
||||
#include <stdarg.h>
|
||||
|
||||
#if defined(HAVE_SYS_SELECT_H) && \
|
||||
(!defined(HAVE_SYS_TIME_H) || defined(SYS_SELECT_WITH_SYS_TIME))
|
||||
|
Loading…
x
Reference in New Issue
Block a user