Ignore:
Timestamp:
Jul 1, 2008, 1:26:57 AM (15 years ago)
Author:
Sam Hocevar
Message:
  • Add a --debug flag to the configure step.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • neercs/trunk/src/neercs.h

    r2505 r2510  
    207207int fill_config(struct screen_list *screen_list);
    208208
    209 #if 1
    210 #   define debug(f, z...) fprintf(stderr, f "\n", z)
     209#if defined DEBUG
     210#   include <stdio.h>
     211#   include <stdarg.h>
     212static inline void debug(const char *format, ...)
     213{
     214    int saved_errno = geterrno();
     215    va_list args;
     216    va_start(args, format);
     217    fprintf(stderr, "** neercs debug ** ");
     218    vfprintf(stderr, format, args);
     219    fprintf(stderr, "\n");
     220    va_end(args);
     221    seterrno(saved_errno);
     222}
    211223#else
    212 #   define debug(f, z...) do {} while(0)
     224#   define debug(format, ...) do {} while(0)
    213225#endif
    214226
Note: See TracChangeset for help on using the changeset viewer.