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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
/************************************************************************/
/*
*
* Filename     :  MILSETUP.H
* Revision     :  10.40.0640
* Content      :  This file contains definitions for specifying the target
*                 compile environment and the default state to set for
*                 MIL (Matrox Imaging Library). It also defines the
*                 MappAllocDefault() and MappFreeDefault() macros.
*
* Copyright © Matrox Electronic Systems Ltd., 1992-2020.
* All Rights Reserved
*************************************************************************/
#ifndef __MILSETUP_H__
#define __MILSETUP_H__
 
/************************************************************************/
/* MIL COMPILE VERSION                                                  */
/* These defines are for Matrox internal purpose only and are NOT meant */
/* to be edited by the client.                                          */
/************************************************************************/
#if !defined(MIL_COMPILE_VERSION_HEX) || (MIL_COMPILE_VERSION_HEX== 0)
   #ifdef MIL_COMPILE_VERSION_HEX
      #undef MIL_COMPILE_VERSION_HEX
   #endif
   #define MIL_COMPILE_VERSION_HEX 0x1040
#endif
 
// Let's put the hex value in decimal.
#define MIL_COMPILE_VERSION ((((MIL_COMPILE_VERSION_HEX >> 12) & 0xf) * 1000) + (((MIL_COMPILE_VERSION_HEX >> 8) & 0xf) * 100) + (((MIL_COMPILE_VERSION_HEX >> 4) & 0xf) * 10) + (((MIL_COMPILE_VERSION_HEX) & 0xf) ))
#define MIL_COMPILE_TRUNK_VERSION         1060
#define MIL_COMPILE_NEXT_MAJOR_VERSION    1100
 
/************************************************************************/
/* COMPILATION FLAG                                                     */
/* One and only one flag must be active                                 */
/************************************************************************/
#ifndef M_MIL_USE_OS
   #define M_MIL_USE_OS               1
 
#ifndef M_MIL_USE_RT
 
#if defined(UNDER_RTSS)
#define M_MIL_USE_RT    1
#else
#define M_MIL_USE_RT    0
#endif
 
#endif
 
   #if defined(__linux__)
      #if defined(__arm__) || defined(__aarch64__)
         #define M_MIL_USE_ARM        1
      #else
         #define M_MIL_USE_ARM        0
      #endif
      #define M_MIL_USE_WINDOWS       0
      #define M_MIL_USE_LINUX         1
      #define M_MIL_USE_NEW_STDHEADERS 1
      #if defined(__x86_64__) || defined(__aarch64__)
         #define M_MIL_USE_64BIT      1
      #else
         #define M_MIL_USE_64BIT      0
      #endif
 
      #ifndef M_LINUX_KERNEL
         #define M_LINUX_KERNEL       0
      #endif
 
      #ifdef __INTEL_COMPILER
         #define M_MIL_USE_LINTEL     1
      #endif
   #else
      #define M_MIL_USE_WINDOWS       1
      #define M_MIL_USE_LINUX         0
      #define M_MIL_USE_ARM           0
      #if defined(_WIN64) || defined(WIN64)
         #define M_MIL_USE_64BIT      1
      #else
         #define M_MIL_USE_64BIT      0
      #endif
 
      #if (_MSC_VER >= 1400) && !defined(M_MIL_USING_SAFE_CRT)
         #define M_MIL_USING_SAFE_CRT       1
      #endif
   #endif
 
   #if defined(__POWERPC__)
#error "PowerPC not supported"
   #endif
#endif
 
#if !(M_MIL_USE_WINDOWS || M_MIL_USE_LINUX)
#error "You must set at least one compilation flag."
#endif
 
#if ( (M_MIL_USE_WINDOWS && M_MIL_USE_LINUX) )
#error "You must select one and only one compilation flag."
#endif
 
 
#if M_MIL_USE_RT
#define MIL_DLLFUNC //__declspec(dllimport)
#else
#define MIL_DLLFUNC
#endif
/************************************************************************/
/*This flag indicates if MIL has been compiled without UNICODE support  */
/*If MIL supports UNICODE, user can define UNICODE to use UNICODE API   */
/************************************************************************/
#if !defined(M_MIL_USE_UNICODE) && !M_MIL_USE_LINUX
   #define M_MIL_USE_UNICODE 1
#elif !defined (M_MIL_USE_UNICODE)
   #define M_MIL_USE_UNICODE 0
#endif
 
 
#if defined(UNICODE)
   #define M_MIL_UNICODE_API 1
#else
   #if M_MIL_USE_RT
      #error "The project must be compiled with Unicode character set"
   #endif
   #define M_MIL_UNICODE_API 0
#endif
 
#if M_MIL_USE_LINUX || M_MIL_UNICODE_API
#define M_MIL_USE_TTF_UNICODE 1
#endif
 
/************************************************************************/
/*This flag enable or disable deprecated defines.                       */
/************************************************************************/
#if !defined(M_MIL_WARN_ON_DEPRECATED)
#if (defined(_MSC_VER) && (_MSC_VER >= 1400)) || defined(__INTEL_COMPILER)
#define M_MIL_WARN_ON_DEPRECATED 1
#else
#define M_MIL_WARN_ON_DEPRECATED 0
#endif
#endif
 
#if M_MIL_WARN_ON_DEPRECATED
   // Define true (1) or false (2) depends on MIL_COMPILE_VERSION and START_VERSION.
   #if MIL_COMPILE_VERSION >= 1000
   #define MIL_COMPILE_VERSION_HIGHER_OR_EQUAL_TO_1000 1
   #else
   #define MIL_COMPILE_VERSION_HIGHER_OR_EQUAL_TO_1000 0
   #endif
   #if MIL_COMPILE_VERSION >= 1010
   #define MIL_COMPILE_VERSION_HIGHER_OR_EQUAL_TO_1010 1
   #else
   #define MIL_COMPILE_VERSION_HIGHER_OR_EQUAL_TO_1010 0
   #endif
   #if MIL_COMPILE_VERSION >= 1020
   #define MIL_COMPILE_VERSION_HIGHER_OR_EQUAL_TO_1020 1
   #else
   #define MIL_COMPILE_VERSION_HIGHER_OR_EQUAL_TO_1020 0
   #endif
   #if MIL_COMPILE_VERSION >= 1030
   #define MIL_COMPILE_VERSION_HIGHER_OR_EQUAL_TO_1030 1
   #else
   #define MIL_COMPILE_VERSION_HIGHER_OR_EQUAL_TO_1030 0
   #endif
   #if MIL_COMPILE_VERSION >= 1040
   #define MIL_COMPILE_VERSION_HIGHER_OR_EQUAL_TO_1040 1
   #else
   #define MIL_COMPILE_VERSION_HIGHER_OR_EQUAL_TO_1040 0
   #endif
   #if MIL_COMPILE_VERSION >= 1050
   #define MIL_COMPILE_VERSION_HIGHER_OR_EQUAL_TO_1050 1
   #else
   #define MIL_COMPILE_VERSION_HIGHER_OR_EQUAL_TO_1050 0
   #endif
 
   #if MIL_COMPILE_VERSION >= MIL_COMPILE_TRUNK_VERSION
   #define MIL_COMPILE_VERSION_HIGHER_OR_EQUAL_TO_1060 1
   #else
   #define MIL_COMPILE_VERSION_HIGHER_OR_EQUAL_TO_1060 0
   #endif
   #if MIL_COMPILE_VERSION >= MIL_COMPILE_NEXT_MAJOR_VERSION
   #define MIL_COMPILE_VERSION_HIGHER_OR_EQUAL_TO_1100 1
   #else
   #define MIL_COMPILE_VERSION_HIGHER_OR_EQUAL_TO_1100 0
   #endif
 
   #define PRIMITIVE_CAT(X, ...)                     X ## __VA_ARGS__
   #define MIL_COMPILE_VERSION_HIGHER_OR_EQUAL_TO(X) PRIMITIVE_CAT(MIL_COMPILE_VERSION_HIGHER_OR_EQUAL_TO_, X)
   #define IIF(X)                                    PRIMITIVE_CAT(IIF_, X)
   #define IIF_0(X, ...)                             __VA_ARGS__
   #define IIF_1(X, ...)                             X
 
   #define MIL_DEPRECATED(IDENTIFIER, START_VERSION) IIF(MIL_COMPILE_VERSION_HIGHER_OR_EQUAL_TO(START_VERSION)) (__pragma(deprecated(#IDENTIFIER)), /*nothing*/)
#else
   #define MIL_DEPRECATED(IDENTIFIER, START_VERSION)
#endif
 
 
#ifndef M_MIL_WARN_ON_DEPRECATED_MOS
   #define M_MIL_WARN_ON_DEPRECATED_MOS 1
#endif
 
 
#ifndef M_MILIM_FUNCTION_DEPRECATION_WARNING
   #if defined(OldDefinesSupport) && OldDefinesSupport
      #define M_MILIM_FUNCTION_DEPRECATION_WARNING 1
   #else
      #define M_MILIM_FUNCTION_DEPRECATION_WARNING 0
   #endif
#endif
 
/************************************************************************/
/* DEFAULT STATE INITIALIZATION FLAG                                    */
/************************************************************************/
 
//Defines for INSTALLDIR support
#define M_INSTALL_DIR    MIL_TEXT("///INSTALLDIR///")
#if MIL_COMPILE_VERSION < MIL_COMPILE_TRUNK_VERSION
#define INSTALL_DIR    M_INSTALL_DIR
#endif
#define M_TEMP_DIR     MIL_TEXT("///MILTEMPDIRDIR///")
#define M_USER_DLL_DIR MIL_TEXT("///MILUSERDLLDIR///")
 
#if   M_MIL_USE_LINUX
   #define M_IMAGE_PATH               M_INSTALL_DIR MIL_TEXT("images/")
   #define M_CONTEXT_PATH             M_INSTALL_DIR MIL_TEXT("contexts/")
#else
   #define M_IMAGE_PATH               M_INSTALL_DIR MIL_TEXT("images\\")
   #define M_CONTEXT_PATH             M_INSTALL_DIR MIL_TEXT("contexts\\")
#endif
 
/************************************************************************/
/* DEFAULT SYSTEM SPECIFICATIONS                                        */
/************************************************************************/
 
/*DO NOT EDIT: you should change the default values with the Mil Configuration utility*/
#if OldDefinesSupport
   #define M_DEF_SYSTEM_NUM           M_DEFAULT
   MIL_DEPRECATED(M_DEF_SYSTEM_NUM, 1000)
   #define M_SYSTEM_SETUP             M_DEF_SYSTEM_TYPE
   MIL_DEPRECATED(M_SYSTEM_SETUP, 1000)
   #define M_DEF_SYSTEM_TYPE          M_SYSTEM_DEFAULT
   MIL_DEPRECATED(M_DEF_SYSTEM_TYPE, 1000)
#endif
 
/************************************************************************/
/* DEFAULT DIGITIZER SPECIFICATIONS                                     */
/************************************************************************/
 
/*DO NOT EDIT: you should change the default values with the Mil Configuration utility*/
#if OldDefinesSupport
   #define M_DEF_DIGITIZER_INIT       M_DEFAULT
   MIL_DEPRECATED(M_DEF_DIGITIZER_INIT, 1000)
   #define M_DEF_DIGITIZER_NUM        M_DEFAULT
   MIL_DEPRECATED(M_DEF_DIGITIZER_NUM, 1000)
   #define M_CAMERA_SETUP             M_DEF_DIGITIZER_FORMAT
   MIL_DEPRECATED(M_CAMERA_SETUP, 1000)
   #define M_DEF_DIGITIZER_FORMAT     MIL_TEXT("M_DEFAULT")
   MIL_DEPRECATED(M_DEF_DIGITIZER_FORMAT, 1000)
#endif
 
/************************************************************************/
/* DEFAULT DISPLAY SPECIFICATIONS                                       */
/************************************************************************/
 
/*DO NOT EDIT: you should change the default values with the Mil Configuration utility*/
#if OldDefinesSupport
   #define M_DEF_DISPLAY_FORMAT               MIL_TEXT("M_DEFAULT")
   #define M_DISPLAY_SETUP                    M_DEF_DISPLAY_FORMAT
   MIL_DEPRECATED(M_DISPLAY_SETUP, 1000)
   MIL_DEPRECATED(M_DEF_DISPLAY_FORMAT, 1000)
   #define M_DEF_DISPLAY_INIT                 M_DEFAULT
   MIL_DEPRECATED(M_DEF_DISPLAY_INIT, 1000)
   #define M_DEF_DISPLAY_NUM                  M_DEFAULT
   MIL_DEPRECATED(M_DEF_DISPLAY_NUM, 1000)
#endif
 
/************************************************************************/
/* DEFAULT IMAGE BUFFER SPECIFICATIONS                                  */
/************************************************************************/
#if OldDefinesSupport
   #define M_DEF_IMAGE_NUMBANDS_MIN   1
   MIL_DEPRECATED(M_DEF_IMAGE_NUMBANDS_MIN, 1000)
   #define M_DEF_IMAGE_SIZE_X_MIN     50
   MIL_DEPRECATED(M_DEF_IMAGE_SIZE_X_MIN, 1000)
   #define M_DEF_IMAGE_SIZE_Y_MIN     50
   MIL_DEPRECATED(M_DEF_IMAGE_SIZE_Y_MIN, 1000)
   #define M_DEF_IMAGE_SIZE_X_MAX     4000000
   MIL_DEPRECATED(M_DEF_IMAGE_SIZE_X_MAX, 1000)
   #define M_DEF_IMAGE_SIZE_Y_MAX     4000000
   MIL_DEPRECATED(M_DEF_IMAGE_SIZE_Y_MAX, 1000)
   #define M_DEF_IMAGE_TYPE           (8+M_UNSIGNED)
   MIL_DEPRECATED(M_DEF_IMAGE_TYPE, 1000)
   #define M_DEF_IMAGE_ATTRIBUTE_MIN  (M_IMAGE+M_PROC)
   MIL_DEPRECATED(M_DEF_IMAGE_ATTRIBUTE_MIN, 1000)
#endif
 
/************************************************************************/
/* Enables DMIL monitoring auto-publish mode. 0 == Disabled             */
/************************************************************************/
#define M_DEF_AUTO_PUBLISH  0
 
 
#endif /*__MILSETUP_H__*/