Mercurial > vim
changeset 7838:cfed0e9f0ca2 v7.4.1216
commit https://github.com/vim/vim/commit/ba4ef2757cfc126f342b710f1ad9ea39e6b56cec
Author: Bram Moolenaar <Bram@vim.org>
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.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 30 Jan 2016 22:00:05 +0100 |
parents | 33ba2adb6065 |
children | daacc8ad538b |
files | src/auto/configure src/eval.c src/misc2.c src/os_amiga.h src/os_msdos.h src/os_vms_conf.h src/os_win32.h src/proto.h src/version.c src/vim.h |
diffstat | 10 files changed, 26 insertions(+), 48 deletions(-) [+] |
line wrap: on
line diff
--- 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 \
--- 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; } /*
--- 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); }
--- 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
--- 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
--- 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
--- 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 */
--- 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"
--- 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,
--- a/src/vim.h +++ b/src/vim.h @@ -508,9 +508,7 @@ typedef unsigned long u8char_T; /* l #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))