1
0
Fork 0

Rename VA_COPY to va_copy

With this, the C99 standard macro va_copy is used when available
instead of the prestandard __va_copy.
This commit is contained in:
Felix Janda 2017-11-23 19:18:20 -05:00
parent 9555619c50
commit 336e596a83
4 changed files with 8 additions and 8 deletions

View File

@ -100,7 +100,7 @@ msg_text_do(unsigned char *format, va_list ap)
int infolen, len;
va_list ap2;
VA_COPY(ap2, ap);
va_copy(ap2, ap);
infolen = vsnprintf(NULL, 0, format, ap2);
info = mem_alloc(infolen + 1);

View File

@ -162,7 +162,7 @@ trigger_event_va(int id, va_list ap_init)
enum evhook_status ret;
va_list ap;
VA_COPY(ap, ap_init);
va_copy(ap, ap_init);
ret = ev_handler->callback(ap, ev_handler->data);
va_end(ap);

View File

@ -178,7 +178,7 @@ dopr(char *buffer, size_t maxlen, const char *format, va_list args_in)
size_t currlen;
va_list args;
VA_COPY(args, args_in);
va_copy(args, args_in);
state = DP_S_DEFAULT;
currlen = 0;
@ -825,7 +825,7 @@ elinks_vasprintf(char **ptr, const char *format, va_list ap)
int ret;
va_list ap2;
VA_COPY(ap2, ap);
va_copy(ap2, ap);
ret = vsnprintf(NULL, 0, format, ap2);
if (ret <= 0) return ret;
@ -842,7 +842,7 @@ elinks_vasprintf(char **ptr, const char *format, va_list ap)
(*ptr) = (char *) malloc(ret + 1);
if (!*ptr) return -1;
VA_COPY(ap2, ap);
va_copy(ap2, ap);
return vsnprintf(*ptr, ret + 1, format, ap2);
}

View File

@ -11,11 +11,11 @@
/* XXX: This is not quite the best place for it, perhaps. But do we have
* a better one now? --pasky */
#ifndef VA_COPY
#ifndef va_copy
#ifdef __va_copy
#define VA_COPY(dest, src) __va_copy(dest, src)
#define va_copy(dest, src) __va_copy(dest, src)
#else
#define VA_COPY(dest, src) (dest) = (src)
#define va_copy(dest, src) (dest) = (src)
#endif
#endif