Ignore:
Timestamp:
Nov 16, 2009, 2:15:19 AM (11 years ago)
Author:
Sam Hocevar
Message:

Move debugging methods to caca_debug.h.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/caca/caca_stubs.h

    r2896 r3904  
    1717 */
    1818
    19 #ifndef __STUBS_H__
    20 #define __STUBS_H__
     19#ifndef __CACA_STUBS_H__
     20#define __CACA_STUBS_H__
    2121
    2222/* errno handling */
     
    2828#   define seterrno(x) do { (void)(x); } while(0)
    2929#   define geterrno(x) 0
    30 #endif
    31 
    32 /* debug messages */
    33 #if defined DEBUG && !defined __KERNEL__
    34 #   include <stdio.h>
    35 #   include <stdarg.h>
    36 static inline void debug(const char *format, ...)
    37 {
    38     int saved_errno = geterrno();
    39     va_list args;
    40     va_start(args, format);
    41     fprintf(stderr, "** libcaca debug ** ");
    42     vfprintf(stderr, format, args);
    43     fprintf(stderr, "\n");
    44     va_end(args);
    45     seterrno(saved_errno);
    46 }
    47 #else
    48 #   define debug(format, ...) do {} while(0)
    4930#endif
    5031
     
    9475#endif
    9576
    96 #endif /* __STUBS_H__ */
     77#endif /* __CACA_STUBS_H__ */
    9778
Note: See TracChangeset for help on using the changeset viewer.