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 \
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
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;
}
/*
{
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);
}
# 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
# 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"