Changeset 476 for trunk/src


Ignore:
Timestamp:
Jun 1, 2015, 6:58:33 PM (9 years ago)
Author:
katerina
Message:

Fix for ticket #373 (better autoconf macro for va_copy).

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/sh_error.c

    r444 r476  
    15741574}
    15751575
    1576 #if !defined(VA_COPY)
    1577 #if defined(__GNUC__) && defined(__PPC__) && (defined(_CALL_SYSV) || defined(_WIN32))
    1578 #define VA_COPY(ap1, ap2)     (*(ap1) = *(ap2))
    1579 #elif defined(VA_COPY_AS_ARRAY)
    1580 #define VA_COPY(ap1, ap2)     memmove ((ap1), (ap2), sizeof (va_list))
    1581 #else /* va_list is a pointer */
    1582 #define VA_COPY(ap1, ap2)     ((ap1) = (ap2))
    1583 #endif
    1584 #endif
    1585 
    15861576
    15871577/* print an error  into string
     
    17171707  else
    17181708    {
    1719       /* use VA_COPY */
    1720       /*@i@*/VA_COPY(vl2, vl);
     1709      /* use va_copy */
     1710      /*@i@*/va_copy(vl2, vl);
    17211711      len      = sl_strlen(lmsg->msg);
    17221712      /*@i@*/required = sl_vsnprintf(&(lmsg->msg[len]),
  • trunk/src/slib.c

    r473 r476  
    587587
    588588
    589 #if !defined (VA_COPY)
    590 #if defined (__GNUC__) && defined (__PPC__) && (defined (_CALL_SYSV) || defined (_WIN32))
    591 #define VA_COPY(ap1, ap2)     (*(ap1) = *(ap2))
    592 #elif defined (VA_COPY_AS_ARRAY)
    593 #define VA_COPY(ap1, ap2)     memmove ((ap1), (ap2), sizeof (va_list))
    594 #else /* va_list is a pointer */
    595 #define VA_COPY(ap1, ap2)     ((ap1) = (ap2))
    596 #endif
    597 #endif
    598 
    599589#if !defined(HAVE_VSNPRINTF) || defined(HAVE_BROKEN_VSNPRINTF)
    600590static
     
    784774  str[n-1] = '\0';
    785775#else
    786   VA_COPY (vl2, vl);                     /* save the argument list           */
     776  va_copy(vl2, vl);                      /* save the argument list           */
    787777  total = sl_printf_count (format, vl);
    788778  len = (int) total;
     
    830820  str[n-1] = '\0';
    831821#else
    832   VA_COPY (vl2, vl);                   /* save the argument list           */
     822  va_copy(vl2, vl);                    /* save the argument list           */
    833823  total = sl_printf_count (format, vl);
    834824  if (total < n)
Note: See TracChangeset for help on using the changeset viewer.