[srvx-commits] CVS: services/src compat.h,1.12,1.13 helpfile.c,1.58,1.59
Brought to you by:
entrope
|
From: Entrope <en...@us...> - 2002-11-09 02:33:25
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv19211/src
Modified Files:
compat.h helpfile.c
Log Message:
try to find an actually-working way to va_copy()
Index: compat.h
===================================================================
RCS file: /cvsroot/srvx/services/src/compat.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -r1.12 -r1.13
*** compat.h 11 Aug 2002 03:26:16 -0000 1.12
--- compat.h 9 Nov 2002 02:33:22 -0000 1.13
***************
*** 58,61 ****
--- 58,69 ----
#endif
+ #ifdef HAVE_VA_COPY
+ #define VA_COPY(DEST, SRC) va_copy(DEST, SRC)
+ #elif HAVE___VA_COPY
+ #define VA_COPY(DEST, SRC) __va_copy(DEST, SRC)
+ #else
+ #define VA_COPY(DEST, SRC) memcpy(&(DEST), &(SRC), sizeof(DEST))
+ #endif
+
#ifndef HAVE_GETTIMEOFDAY
extern int gettimeofday(struct timeval * tv, struct timezone * tz);
Index: helpfile.c
===================================================================
RCS file: /cvsroot/srvx/services/src/helpfile.c,v
retrieving revision 1.58
retrieving revision 1.59
diff -C2 -r1.58 -r1.59
*** helpfile.c 5 Nov 2002 03:10:35 -0000 1.58
--- helpfile.c 9 Nov 2002 02:33:22 -0000 1.59
***************
*** 170,174 ****
* The kludge-around is to pass a non-NULL pointer instead.
*/
! __va_copy(working, al);
if ((ret = vsnprintf(line, 0, format, working)) <= 0) {
char *temp;
--- 170,174 ----
* The kludge-around is to pass a non-NULL pointer instead.
*/
! VA_COPY(working, al);
if ((ret = vsnprintf(line, 0, format, working)) <= 0) {
char *temp;
***************
*** 177,186 ****
input = malloc(size);
va_end(working);
! __va_copy(working, al);
while ((ret = vsnprintf(input, size, format, working)) == -1) {
size <<= 1;
input = realloc(input, size);
va_end(working);
! __va_copy(working, al);
}
temp = alloca(ret+1);
--- 177,186 ----
input = malloc(size);
va_end(working);
! VA_COPY(working, al);
while ((ret = vsnprintf(input, size, format, working)) == -1) {
size <<= 1;
input = realloc(input, size);
va_end(working);
! VA_COPY(working, al);
}
temp = alloca(ret+1);
***************
*** 193,197 ****
input = alloca(size);
va_end(working);
! __va_copy(working, al);
ret = vsnprintf(input, size, format, al);
}
--- 193,197 ----
input = alloca(size);
va_end(working);
! VA_COPY(working, al);
ret = vsnprintf(input, size, format, al);
}
|