Changeset 1835 for trunk/src


Ignore:
Timestamp:
Oct 11, 2008, 9:18:45 PM (17 years ago)
Author:
bird
Message:

kmk: fixed assertion + made them useful.

Location:
trunk/src/kmk
Files:
2 edited

Legend:

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

    r1834 r1835  
    553553                o = op;
    554554                p = begp;
    555                 assert (!memchr (variable_buffer + line_offset, '\0', o - variable_buffer + line_offset));
     555                MY_ASSERT_MSG (!(p1 = memchr (variable_buffer + line_offset, '\0', o - (variable_buffer + line_offset))),
     556                               ("line=%p o/exp_end=%p act_end=%p\n", variable_buffer + line_offset, o, p1));
    556557                break;
    557558              }
  • trunk/src/kmk/make.h

    r1834 r1835  
    150150#endif
    151151
    152 #ifdef KMK
     152#if defined(KMK) || defined(CONFIG_WITH_VALUE_LENGTH)
    153153# ifdef _MSC_VER
    154 #  define MY_INLINE  _inline static
     154#  define MY_INLINE     _inline static
     155#  define MY_DBGBREAK   __debugbreak()
    155156# 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)
     157#  define MY_INLINE     static __inline__
     158#  if defined(__i386__) || defined(__x86_64__)
     159#   define MY_DBGBREAK  __asm__ __volatile__ ("int3")
     160#else
     161#   define MY_DBGBREAK  assert(0)
     162#  endif
     163# else
     164#  define MY_INLINE     static
     165#  define MY_DBGBREAK  assert(0)
     166# endif
    162167# ifndef NDEBUG
    163168#  define MY_ASSERT_MSG(expr, printfargs) \
    164     do { if (!(expr)) { printf printfargs; assert(expr); } } while (0)
     169    do { if (!(expr)) { printf printfargs; MY_DBGBREAK; } } while (0)
    165170# else
    166171#  define MY_ASSERT_MSG(expr, printfargs)   do { } while (0)
Note: See TracChangeset for help on using the changeset viewer.