File: dzconfig.h

package info (click to toggle)
scantool 1.21%2Bdfsg-6
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 2,952 kB
  • ctags: 2,392
  • sloc: ansic: 12,279; sh: 829; makefile: 344; asm: 86; perl: 29
file content (143 lines) | stat: -rw-r--r-- 3,474 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
/*
 * DZcomm : a serial port API.
 * file : dzconfig.h
 *
 * Configuration defines
 *
 * By Neil Townsend based on the Allegro project
 * 
 * See readme.txt for copyright information.
 */


/* platform generic stuff */

#define DZ_ID(a,b,c,d)     (((a)<<24) | ((b)<<16) | ((c)<<8) | (d))



/* include platform-specific stuff */
#if defined SCAN_EXPORT
   #include "dzscanex.h"
#elif defined __RSXNT__
   #include "dzrsxnt.h"
#elif defined __MINGW32__
   #include "dzmngw32.h"
#elif defined _MSC_VER
   #include "dzmsvc.h"
#elif defined __WATCOMC__
   #include "dzwatcom.h"
#elif defined DJGPP
   #include "dzdjgpp.h"
#elif defined __unix__
   #include "dzucfg.h"
#elif defined __BEOS__
   #include "dzbecfg.h"
#else
   #error unknown platform
#endif


/* special definitions for the GCC compiler */
#ifdef __GNUC__
   #define DZCOMM_GCC

   #ifndef DZ_INLINE
      #define DZ_INLINE(type, name, args, code)    static inline type name args code
   #endif

   #define DZ_PRINTFUNC(type, name, args, a, b)    DZ_FUNC(type, name, args) __attribute__ ((format (printf, a, b)))

   #define CONSTRUCTOR_FUNCTION(func)              func __attribute__ ((constructor))

   #ifndef INLINE
   # define INLINE          inline
   #endif

   #ifndef ZERO_SIZE
      #define ZERO_SIZE    0
   #endif

   #define LONG_LONG       long long

   #ifdef __i386__
      #define DZCOMM_I386
   #endif
#endif


/* the rest of this file fills in some default definitions of language
 * features and helper functions, which are conditionalised so they will
 * only be included if none of the above headers defined custom versions.
 */

#ifndef INLINE
   #define INLINE
#endif

#ifndef ZERO_SIZE
   #define ZERO_SIZE
#endif

#ifndef DZ_VAR
   #define DZ_VAR(type, name)                      extern type name
#endif

#ifndef DZ_ARRAY
   #define DZ_ARRAY(type, name)                    extern type name[]
#endif

#ifndef DZ_FUNC
   #define DZ_FUNC(type, name, args)               type name args
#endif

#ifndef DZ_PRINTFUNC
   #define DZ_PRINTFUNC(type, name, args, a, b)    AL_FUNC(type, name, args)
#endif

#ifndef DZ_METHOD
   #define DZ_METHOD(type, name, args)             type (*name) args
#endif

#ifndef DZ_FUNCPTR
   #define DZ_FUNCPTR(type, name, args)            extern type (*name) args
#endif

#ifndef DZ_INLINE
   #define DZ_INLINE(type, name, args, code)       type name args;
#endif


/* fill in default memory locking macros */
#ifndef END_OF_FUNCTION
   #define END_OF_FUNCTION(x)
   #define END_OF_STATIC_FUNCTION(x)
   #define LOCK_DATA(d, s)
   #define LOCK_CODE(c, s)
   #define UNLOCK_DATA(d, s)
   #define LOCK_VARIABLE(x)
   #define LOCK_FUNCTION(x)
#endif


/* emulate the FA_* flags for platforms that don't already have them */
#ifndef FA_RDONLY
   #define FA_RDONLY       1
   #define FA_HIDDEN       2
   #define FA_SYSTEM       4
   #define FA_LABEL        8
   #define FA_DIREC        16
   #define FA_ARCH         32
#endif

/* don't currently use these, but if in case I need to later ... */
#ifndef DZCOMM_DJGPP
   #define _farsetsel(seg)
   #define _farnspokeb(addr, val)   (*((unsigned char  *)(addr)) = (val))
   #define _farnspokew(addr, val)   (*((unsigned short *)(addr)) = (val))
   #define _farnspokel(addr, val)   (*((unsigned long  *)(addr)) = (val))
   #define _farnspeekb(addr)        (*((unsigned char  *)(addr)))
   #define _farnspeekw(addr)        (*((unsigned short *)(addr)))
   #define _farnspeekl(addr)        (*((unsigned long  *)(addr)))
#endif