1 /*
2  * $Id: default.h,v 1.5 2003/05/16 08:58:45 skyper Exp $
3  */
4 
5 #ifndef __THCRUT_DEFAULT_H__
6 #define __THCRUT_DEFAULT_H__ 1
7 
8 #ifdef HAVE_CONFIG_H
9 # include <config.h>
10 #endif
11 
12 #include <stdio.h>
13 #include <stdlib.h>
14 
15 #ifdef HAVE_CONFIG_H
16 # if defined(STDC_HEADERS) || defined(HAVE_STRING_H)
17 #  include <string.h>
18 # else
19 #  ifndef HAVE_STRCHR
20 #   ifndef strchr
21 #    define strchr index
22 #   endif
23 #   ifndef strrchr
24 #    define strrchr rindex
25 #   endif
26 #  endif
27 char *strchr (), *strrchr ();
28 #  ifndef HAVE_MEMCPY
29 #   ifndef memcpy
30 #    define memcpy(d, s, n) bcopy ((s), (d), (n))
31 #   endif
32 #   ifndef memmove
33 #    define memmove(d, s, n) bcopy ((s), (d), (n))
34 #   endif
35 #  endif
36 # endif
37 #else
38 # include <string.h>
39 #endif
40 
41 #ifdef DEBUG
42 # define DEBUGF(a...) do{fprintf(stderr, "DEBUG %s:%d: ", __func__, __LINE__); fprintf(stderr, a); }while(0)
43 #else
44 # define DEBUGF(a...)
45 #endif
46 
47 #define XFREE(ptr)  do{if(ptr) free(ptr); ptr = NULL;}while(0)
48 
49 #endif /* !__THCRUT_DEFAULT_H__ */
50