mirror of
https://github.com/rkd77/elinks.git
synced 2024-09-06 23:44:43 -04:00
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:
parent
9555619c50
commit
336e596a83
@ -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);
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user