# HG changeset patch # User Christian Brabandt # Date 1454187605 -3600 # Node ID cfed0e9f0ca28558336e5776bb18457a12fd75b9 # Parent 33ba2adb606505c18d36b7ff30e147687b840a83 commit https://github.com/vim/vim/commit/ba4ef2757cfc126f342b710f1ad9ea39e6b56cec Author: Bram Moolenaar Date: Sat Jan 30 21:48:49 2016 +0100 patch 7.4.1216 Problem: Still using HAVE_STDARG_H. Solution: Assume it's always defined. diff --git a/src/auto/configure b/src/auto/configure --- a/src/auto/configure +++ b/src/auto/configure @@ -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 \ diff --git a/src/eval.c b/src/eval.c --- a/src/eval.c +++ b/src/eval.c @@ -15217,13 +15217,11 @@ f_prevnonblank(typval_T *argvars, typval 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) - { - s = alloc(len + 1); - if (s != NULL) - { - rettv->vval.v_string = s; - (void)vim_vsnprintf((char *)s, len + 1, fmt, ap, argvars + 1); - } - } - did_emsg |= saved_did_emsg; - } -#endif + + /* 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) + { + rettv->vval.v_string = s; + (void)vim_vsnprintf((char *)s, len + 1, fmt, ap, argvars + 1); + } + } + did_emsg |= saved_did_emsg; } /* diff --git a/src/misc2.c b/src/misc2.c --- a/src/misc2.c +++ b/src/misc2.c @@ -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); } diff --git a/src/os_amiga.h b/src/os_amiga.h --- a/src/os_amiga.h +++ b/src/os_amiga.h @@ -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 diff --git a/src/os_msdos.h b/src/os_msdos.h --- a/src/os_msdos.h +++ b/src/os_msdos.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 diff --git a/src/os_vms_conf.h b/src/os_vms_conf.h --- a/src/os_vms_conf.h +++ b/src/os_vms_conf.h @@ -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 diff --git a/src/os_win32.h b/src/os_win32.h --- a/src/os_win32.h +++ b/src/os_win32.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 */ diff --git a/src/proto.h b/src/proto.h --- a/src/proto.h +++ b/src/proto.h @@ -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 @@ int # 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" diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -747,6 +747,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1216, +/**/ 1215, /**/ 1214, diff --git a/src/vim.h b/src/vim.h --- a/src/vim.h +++ b/src/vim.h @@ -508,9 +508,7 @@ typedef unsigned long u8char_T; /* l #ifdef HAVE_WCTYPE_H # include #endif -#ifdef HAVE_STDARG_H -# include -#endif +#include #if defined(HAVE_SYS_SELECT_H) && \ (!defined(HAVE_SYS_TIME_H) || defined(SYS_SELECT_WITH_SYS_TIME))