*** empty log message ***
[midnight-commander.git] / slang / jdmacros.h
blobb94eae4fd8c5bcadcecb99d33a7e5d8d8b239c9b
1 #ifndef _JD_MACROS_H_
2 #define _JD_MACROS_H_
4 /* This file defines some macros that I use with programs that link to
5 * the slang library.
6 */
8 #ifdef HAVE_STDLIB_H
9 # include <stdlib.h>
10 #endif
12 #if !defined(STDC_HEADERS) && defined(HAVE_MALLOC_H)
13 # include <malloc.h>
14 #endif
16 #ifdef HAVE_MEMORY_H
17 # include <memory.h>
18 #endif
20 #ifndef SLMEMSET
21 # ifdef HAVE_MEMSET
22 # define SLMEMSET memset
23 # else
24 # define SLMEMSET SLmemset
25 # endif
26 #endif
28 #ifndef SLMEMCHR
29 # ifdef HAVE_MEMCHR
30 # define SLMEMCHR memchr
31 # else
32 # define SLMEMCHR SLmemchr
33 # endif
34 #endif
36 #ifndef SLMEMCPY
37 # ifdef HAVE_MEMCPY
38 # define SLMEMCPY memcpy
39 # else
40 # define SLMEMCPY SLmemcpy
41 # endif
42 #endif
44 /* Note: HAVE_MEMCMP requires an unsigned memory comparison!!! */
45 #ifndef SLMEMCMP
46 # ifdef HAVE_MEMCMP
47 # define SLMEMCMP memcmp
48 # else
49 # define SLMEMCMP SLmemcmp
50 # endif
51 #endif
53 #if SLANG_VERSION < 9934
54 # define SLmemcmp jed_memcmp
55 # define SLmemcpy jed_memcpy
56 # define SLmemset jed_memset
57 # define SLmemchr jed_memchr
58 #endif
60 #ifndef SLFREE
61 # define SLFREE free
62 #endif
64 #ifndef SLMALLOC
65 # define SLMALLOC malloc
66 #endif
68 #ifndef SLCALLOC
69 # define SLCALLOC calloc
70 #endif
72 #ifndef SLREALLOC
73 # define SLREALLOC realloc
74 #endif
76 #endif /* _JD_MACROS_H_ */