Skip to content

Commit ba4ef27

Browse files
committed
patch 7.4.1216
Problem: Still using HAVE_STDARG_H. Solution: Assume it's always defined.
1 parent b638a7b commit ba4ef27

10 files changed

Lines changed: 22 additions & 44 deletions

File tree

src/auto/configure

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10064,7 +10064,7 @@ fi
1006410064
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
1006510065
fi
1006610066

10067-
for ac_header in stdarg.h stdint.h stdlib.h string.h \
10067+
for ac_header in stdint.h stdlib.h string.h \
1006810068
sys/select.h sys/utsname.h termcap.h fcntl.h \
1006910069
sgtty.h sys/ioctl.h sys/time.h sys/types.h \
1007010070
termio.h iconv.h inttypes.h langinfo.h math.h \

src/eval.c

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15217,46 +15217,41 @@ f_prevnonblank(typval_T *argvars, typval_T *rettv)
1521715217
rettv->vval.v_number = lnum;
1521815218
}
1521915219

15220-
#ifdef HAVE_STDARG_H
1522115220
/* This dummy va_list is here because:
1522215221
* - passing a NULL pointer doesn't work when va_list isn't a pointer
1522315222
* - locally in the function results in a "used before set" warning
1522415223
* - using va_start() to initialize it gives "function with fixed args" error */
1522515224
static va_list ap;
15226-
#endif
1522715225

1522815226
/*
1522915227
* "printf()" function
1523015228
*/
1523115229
static void
1523215230
f_printf(typval_T *argvars, typval_T *rettv)
1523315231
{
15232+
char_u buf[NUMBUFLEN];
15233+
int len;
15234+
char_u *s;
15235+
int saved_did_emsg = did_emsg;
15236+
char *fmt;
15237+
1523415238
rettv->v_type = VAR_STRING;
1523515239
rettv->vval.v_string = NULL;
15236-
#ifdef HAVE_STDARG_H /* only very old compilers can't do this */
15237-
{
15238-
char_u buf[NUMBUFLEN];
15239-
int len;
15240-
char_u *s;
15241-
int saved_did_emsg = did_emsg;
15242-
char *fmt;
1524315240

15244-
/* Get the required length, allocate the buffer and do it for real. */
15245-
did_emsg = FALSE;
15246-
fmt = (char *)get_tv_string_buf(&argvars[0], buf);
15247-
len = vim_vsnprintf(NULL, 0, fmt, ap, argvars + 1);
15248-
if (!did_emsg)
15241+
/* Get the required length, allocate the buffer and do it for real. */
15242+
did_emsg = FALSE;
15243+
fmt = (char *)get_tv_string_buf(&argvars[0], buf);
15244+
len = vim_vsnprintf(NULL, 0, fmt, ap, argvars + 1);
15245+
if (!did_emsg)
15246+
{
15247+
s = alloc(len + 1);
15248+
if (s != NULL)
1524915249
{
15250-
s = alloc(len + 1);
15251-
if (s != NULL)
15252-
{
15253-
rettv->vval.v_string = s;
15254-
(void)vim_vsnprintf((char *)s, len + 1, fmt, ap, argvars + 1);
15255-
}
15250+
rettv->vval.v_string = s;
15251+
(void)vim_vsnprintf((char *)s, len + 1, fmt, ap, argvars + 1);
1525615252
}
15257-
did_emsg |= saved_did_emsg;
1525815253
}
15259-
#endif
15254+
did_emsg |= saved_did_emsg;
1526015255
}
1526115256

1526215257
/*

src/misc2.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6023,11 +6023,7 @@ emsg3(char_u *s, char_u *a1, char_u *a2)
60236023
{
60246024
if (emsg_not_now())
60256025
return TRUE; /* no error messages at the moment */
6026-
#ifdef HAVE_STDARG_H
60276026
vim_snprintf((char *)IObuff, IOSIZE, (char *)s, a1, a2);
6028-
#else
6029-
vim_snprintf((char *)IObuff, IOSIZE, (char *)s, (long_u)a1, (long_u)a2);
6030-
#endif
60316027
return emsg(IObuff);
60326028
}
60336029

src/os_amiga.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@
2020
# if defined(AZTEC_C) || defined(__amigaos4__)
2121
# define HAVE_STAT_H
2222
# endif
23-
# ifdef __amigaos4__
24-
# define HAVE_STDARG_H
25-
# endif
2623
# define HAVE_STDLIB_H
2724
# define HAVE_STRING_H
2825
# define HAVE_FCNTL_H

src/os_msdos.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
# define USE_LONG_FNAME _USE_LFN /* decide at run time */
2222
# define USE_FNAME_CASE
2323
# define HAVE_PUTENV
24-
# define HAVE_STDARG_H
2524
#else
2625
# define SHORT_FNAME /* always 8.3 file name */
2726
#endif

src/os_vms_conf.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@
109109
#define HAVE_FSYNC
110110
#define HAVE_GETPWUID
111111
#define HAVE_GETPWNAM
112-
#define HAVE_STDARG_H
113112
#define HAVE_STDLIB_H
114113
#define HAVE_STRING_H
115114
#define HAVE_ERRNO_H

src/os_win32.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,6 @@
4949
#ifndef HAVE_FCNTL_H
5050
# define HAVE_FCNTL_H
5151
#endif
52-
#ifndef HAVE_STDARG_H
53-
# define HAVE_STDARG_H
54-
#endif
5552
#define HAVE_QSORT
5653
#define HAVE_ST_MODE /* have stat.st_mode */
5754

src/proto.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,7 @@ extern int _stricoll(char *a, char *b);
104104
# include "menu.pro"
105105
# endif
106106

107-
# if !defined MESSAGE_FILE || defined(HAVE_STDARG_H)
108-
/* These prototypes cannot be produced automatically and conflict with
109-
* the old-style prototypes in message.c. */
107+
/* These prototypes cannot be produced automatically. */
110108
int
111109
# ifdef __BORLANDC__
112110
_RTLENTRYF
@@ -131,10 +129,7 @@ _RTLENTRYF
131129
# endif
132130
vim_snprintf(char *, size_t, char *, ...);
133131

134-
# if defined(HAVE_STDARG_H)
135132
int vim_vsnprintf(char *str, size_t str_m, char *fmt, va_list ap, typval_T *tvs);
136-
# endif
137-
# endif
138133

139134
# include "message.pro"
140135
# include "misc1.pro"

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -746,6 +746,8 @@ static char *(features[]) =
746746

747747
static int included_patches[] =
748748
{ /* Add new patch number below this line */
749+
/**/
750+
1216,
749751
/**/
750752
1215,
751753
/**/

src/vim.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -508,9 +508,7 @@ typedef unsigned long u8char_T; /* long should be 32 bits or more */
508508
#ifdef HAVE_WCTYPE_H
509509
# include <wctype.h>
510510
#endif
511-
#ifdef HAVE_STDARG_H
512-
# include <stdarg.h>
513-
#endif
511+
#include <stdarg.h>
514512

515513
#if defined(HAVE_SYS_SELECT_H) && \
516514
(!defined(HAVE_SYS_TIME_H) || defined(SYS_SELECT_WITH_SYS_TIME))

0 commit comments

Comments
 (0)