VirtualBox

Changeset 1834 in kBuild for trunk


Ignore:
Timestamp:
Oct 11, 2008 7:07:29 PM (16 years ago)
Author:
bird
Message:

kmk: assertions.

Location:
trunk/src/kmk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kmk/expand.c

    r1831 r1834  
    487487  if (length < 0)
    488488    length = strlen (string);
     489  else
     490    MY_ASSERT_MSG (string + length == (p1 = memchr (string, '\0', length)) || !p1, ("len=%ld p1=%p %s\n", length, p1, line));
    489491
    490492  /* Simple 1: Emptry string. */
     
    551553                o = op;
    552554                p = begp;
     555                assert (!memchr (variable_buffer + line_offset, '\0', o - variable_buffer + line_offset));
    553556                break;
    554557              }
     
    707710  o = variable_buffer_output (o, "\0", 2); /* KMK: compensate for the strlen + 1 that was removed above. */
    708711  *eolp = o - 2;
    709   assert (strchr (variable_buffer + line_offset, '\0') == *eolp);
     712  MY_ASSERT_MSG (strchr (variable_buffer + line_offset, '\0') == *eolp,
     713                 ("expected=%d actual=%d\nlength=%ld string=%.*s\n",
     714                  (int)(*eolp - variable_buffer + line_offset), (int)strlen(variable_buffer + line_offset),
     715                  length, (int)length, string));
    710716  return (variable_buffer + line_offset);
    711717}
  • trunk/src/kmk/kbuild.c

    r1832 r1834  
    5050#ifndef va_copy
    5151# define va_copy(dst, src) do {(dst) = (src);} while (0)
    52 #endif
    53 #ifdef _MSC_VER
    54 # define MY_INLINE  _inline static
    55 #elif defined(__GNUC__)
    56 # define MY_INLINE  static __inline__
    57 #else
    58 # define MY_INLINE  static
    5952#endif
    6053
  • trunk/src/kmk/make.h

    r1827 r1834  
    148148#ifndef CHAR_BIT
    149149# define CHAR_BIT 8
     150#endif
     151
     152#ifdef KMK
     153# ifdef _MSC_VER
     154#  define MY_INLINE  _inline static
     155# elif defined(__GNUC__)
     156#  define MY_INLINE  static __inline__
     157# else
     158#  define MY_INLINE  static
     159# endif
     160#endif /* KMK */
     161#if defined(CONFIG_WITH_VALUE_LENGTH) || defined(KMK)
     162# ifndef NDEBUG
     163#  define MY_ASSERT_MSG(expr, printfargs) \
     164    do { if (!(expr)) { printf printfargs; assert(expr); } } while (0)
     165# else
     166#  define MY_ASSERT_MSG(expr, printfargs)   do { } while (0)
     167# endif
    150168#endif
    151169
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette