1 /*****************************************************************
2  *****************************************************************
3  *******                                                  ********
4  ****** Copyright (C) 1988-2010 Tecplot, Inc.              *******
5  *******                                                  ********
6  *****************************************************************
7  *****************************************************************/
8 /* BEGINREMOVEFROMADDON */
9 /* NOTE: All code contained between comments that look like
10  *             BEGINREMOVEFROMADDON
11  *             ENDREMOVEFROMADDON
12  * are pulled out to create the MASTER.h file used in addons.
13  */
14 /* ENDREMOVEFROMADDON */
15 
16 #ifndef _MASTER_H_
17 #define _MASTER_H_
18 
19 /*
20  * Annotations that specify the life cycle of objects returned from functions
21  * and input and output parameters sent as function parameters. The following
22  * table specifies the meaning in their context. The annotations provide code
23  * generation tools with information for building language bindings to various
24  * Tecplot 360 and Tecplot SDK related libraries.
25  *
26  * For purposes of this table the client is one making the call and the service
27  * is the recipient.
28  *
29  * +==================+=========================+=================================================================+
30  * | Function Context | Annotation              | Meaning                                                         |
31  * |   Result or      |                         |                                                                 |
32  * |   Parameter      |                         |                                                                 |
33  * |==================+=========================+=================================================================|
34  * | Result           | TP_OUT                  | Default for a function return value that does not transfer      |
35  * |                  |                         | ownership. Because this is the most common scenario this        |
36  * |                  |                         | annotation is implied and never explicitly used in this         |
37  * |                  |                         | context.                                                        |
38  * |------------------+-------------------------+-----------------------------------------------------------------|
39  * | Scalar Result    | TP_GIVES                | Annotates a function scalar return value as one who's ownership |
40  * |                  |                         | is transfered to the client. The client is responsible for      |
41  * |                  |                         | properly disposing the value.                                   |
42  * |------------------+-------------------------+-----------------------------------------------------------------|
43  * | Array Result     | TP_ARRAY_GIVES          | Annotates a function array return value as one who's ownership  |
44  * |                  |                         | is transfered to the client. The client is responsible for      |
45  * |                  |                         | properly disposing the value.                                   |
46  * |==================+=========================+=================================================================|
47  * | Parameter        | TP_IN                   | Default for a function input parameter value sent to the        |
48  * |                  |                         | service. Because this is the most common scenario this          |
49  * |                  |                         | annotation is implied and never explicitly used.                |
50  * |------------------+-------------------------+-----------------------------------------------------------------|
51  * | Parameter        | TP_ACQUIRES             | Annotates a function parameter as one that sends a value to     |
52  * |                  |                         | the service through the parameter and acquires shared           |
53  * |                  |                         | ownership of the input value with the client. The service is    |
54  * |                  |                         | not responsible for disposing the value however it is           |
55  * |                  |                         | expected that a symmetric API exists that "releases" the        |
56  * |                  |                         | library of this shared ownership. For example:                  |
57  * |                  |                         |   void addListener(TP_ACQUIRES Listener& listener);             |
58  * |                  |                         |   void removeListener(TP_RELEASES Listener& listener);          |
59  * |------------------+-------------------------+-----------------------------------------------------------------|
60  * | Parameter        | TP_RELEASES             | Annotates a function parameter as one that sends a value to     |
61  * |                  |                         | the service through the parameter and releases previously       |
62  * |                  |                         | shared ownership of the                                         |
63  * |                  |                         | input value with the client. The service is not responsible     |
64  * |                  |                         | for disposing the value however it is expected that a           |
65  * |                  |                         | symmetric API exists that "releases" the library of this        |
66  * |                  |                         | shared ownership. For example:                                  |
67  * |                  |                         |   void addListener(TP_ACQUIRES Listener& listener);             |
68  * |                  |                         |   void removeListener(TP_RELEASES Listener& listener);          |
69  * |------------------+-------------------------+-----------------------------------------------------------------|
70  * | Scalar Parameter | TP_OUT                  | Annotates a function scalar parameter as one that returns a     |
71  * |                  |                         | value to the client through the parameter but does not          |
72  * |                  |                         | transfer ownership of the output value to the client.           |
73  * |                  |                         | The client is not responsible for disposing the value.          |
74  * |------------------+-------------------------+-----------------------------------------------------------------|
75  * | Scalar Parameter | TP_IN_OUT               | Annotates a function scalar parameter as one that both sends    |
76  * |                  |                         | a value to the service and returns a value to the client        |
77  * |                  |                         | through the parameter. Ownership of the input value is not      |
78  * |                  |                         | transfered to the service nor is ownership of the output value  |
79  * |                  |                         | transfered to the client. The service is not responsible for    |
80  * |                  |                         | disposing  the input value and the client is not responsible    |
81  * |                  |                         | for disposing the output value.                                 |
82  * |------------------+-------------------------+-----------------------------------------------------------------|
83  * | Array Parameter  | TP_ARRAY_OUT            | Annotates a function array parameter as one that returns a      |
84  * |                  |                         | value to the client through the parameter but does not          |
85  * |                  |                         | transfer ownership of the output value to the client.           |
86  * |                  |                         | The client is not responsible for disposing the value.          |
87  * |------------------+-------------------------+-----------------------------------------------------------------|
88  * | Array Parameter  | TP_ARRAY_IN_OUT         | Annotates a function array parameter as one that both sends     |
89  * |                  |                         | a value to the service and returns a value to the client        |
90  * |                  |                         | through the parameter. Ownership of the input value is not      |
91  * |                  |                         | transfered to the service nor is ownership of the output value  |
92  * |                  |                         | transfered to the client. The service is not responsible for    |
93  * |                  |                         | disposing  the input value and the client is not responsible    |
94  * |                  |                         | for disposing the output value.                                 |
95  * |------------------+-------------------------+-----------------------------------------------------------------|
96  * | Scalar Parameter | TP_GIVES                | Annotates a function scalar parameter as one that returns a     |
97  * |                  |                         | value to the client through the parameter and transfers         |
98  * |                  |                         | ownership of the output value to the client. The client is      |
99  * |                  |                         | responsible for properly disposing the value.                   |
100  * |------------------+-------------------------+-----------------------------------------------------------------|
101  * | Scalar Parameter | TP_RECEIVES             | Annotates a function scalar parameter as one that sends a value |
102  * |                  |                         | to the service through the parameter and transfers ownership    |
103  * |                  |                         | of the input value to the service. The service is responsible   |
104  * |                  |                         | for properly disposing the value.                               |
105  * |------------------+-------------------------+-----------------------------------------------------------------|
106  * | Scalar Parameter | TP_RECEIVES_GIVES       | Annotates a function scalar parameter as one that both sends    |
107  * |                  |                         | a value to the service and returns a value to the client        |
108  * |                  |                         | through the  parameter. Ownership of the input value is         |
109  * |                  |                         | transfered to the service and ownership of the output value is  |
110  * |                  |                         | transfered to the client. The service is responsible for        |
111  * |                  |                         | properly disposing the input value and the client is            |
112  * |                  |                         | responsible for properly disposing the output value.            |
113  * |------------------+-------------------------+-----------------------------------------------------------------|
114  * | Array Parameter  | TP_ARRAY_GIVES          | Annotates a function array parameter as one that returns a      |
115  * |                  |                         | value to the client through the parameter and transfers         |
116  * |                  |                         | ownership of the output value to the client. The client is      |
117  * |                  |                         | responsible for properly disposing the value.                   |
118  * |------------------+-------------------------+-----------------------------------------------------------------|
119  * | Array Parameter  | TP_ARRAY_RECEIVES       | Annotates a function array parameter as one that sends a value  |
120  * |                  |                         | to the service through the parameter and transfers ownership    |
121  * |                  |                         | of the input value to the service. The service is responsible   |
122  * |                  |                         | for properly disposing the value.                               |
123  * |------------------+-------------------------+-----------------------------------------------------------------|
124  * | Array Parameter  | TP_ARRAY_RECEIVES_GIVES | Annotates a function array parameter as one that both sends     |
125  * |                  |                         | a value to the service and returns a value to the client        |
126  * |                  |                         | through the  parameter. Ownership of the input value is         |
127  * |                  |                         | transfered to the service and ownership of the output value is  |
128  * |                  |                         | transfered to the client. The service is responsible for        |
129  * |                  |                         | properly disposing the input value and the client is            |
130  * |                  |                         | responsible for properly disposing the output value.            |
131  * |==================+===================+=======================================================================|
132  */
133 
134 /*
135  * First check to make sure that our life-cycle keywords are not in conflict with any system defines.
136  */
137 #if defined TP_ACQUIRES             || \
138     defined TP_RELEASES             || \
139     defined TP_OUT                  || \
140     defined TP_IN_OUT               || \
141     defined TP_ARRAY_OUT            || \
142     defined TP_ARRAY_IN_OUT         || \
143     defined TP_GIVES                || \
144     defined TP_RECEIVES             || \
145     defined TP_RECEIVES_GIVES       || \
146     defined TP_ARRAY_GIVES          || \
147     defined TP_ARRAY_RECEIVES       || \
148     defined TP_ARRAY_RECEIVES_GIVES
149         #error "Tecplot's parameter life-cycle keywords are in direct conflict with other meanings."
150 #endif
151 
152 #if defined INCLUDE_OBJECT_LIFECYCLE_ANNOTATIONS
153     #define TP_ACQUIRES             __attribute((gccxml("acquires","in")))
154     #define TP_RELEASES             __attribute((gccxml("releases","in")))
155     #define TP_OUT                  __attribute((gccxml("out")))
156     #define TP_IN_OUT               __attribute((gccxml("in","out")))
157     #define TP_ARRAY_OUT            __attribute((gccxml("array","out")))
158     #define TP_ARRAY_IN_OUT         __attribute((gccxml("array","in","out")))
159     #define TP_GIVES                __attribute((gccxml("gives","out")))
160     #define TP_RECEIVES             __attribute((gccxml("receives","in")))
161     #define TP_RECEIVES_GIVES       __attribute((gccxml("receives","in","gives","out")))
162     #define TP_ARRAY_GIVES          __attribute((gccxml("array","gives","out")))
163     #define TP_ARRAY_RECEIVES       __attribute((gccxml("array","receives","in")))
164     #define TP_ARRAY_RECEIVES_GIVES __attribute((gccxml("array","receives","in","gives","out")))
165 #else
166     #define TP_ACQUIRES
167     #define TP_RELEASES
168     #define TP_OUT
169     #define TP_IN_OUT
170     #define TP_ARRAY_OUT
171     #define TP_ARRAY_IN_OUT
172     #define TP_GIVES
173     #define TP_RECEIVES
174     #define TP_RECEIVES_GIVES
175     #define TP_ARRAY_GIVES
176     #define TP_ARRAY_RECEIVES
177     #define TP_ARRAY_RECEIVES_GIVES
178 #endif
179 
180 /* BEGINREMOVEFROMADDON */
181 #ifdef NO_ASSERTS /* obfuscate names */
182 #define ShutDownLicensing FreeAllExtraMapData
183 #define ProcessYMapInXDirection
184 #endif /* NO_ASSERTS */
185 
186 
187 /**************************************
188  * LICENSING
189  **************************************/
190 #if defined TECPLOTKERNEL && !defined ENGINE
191 /* CORE SOURCE CODE REMOVED */
192 #if defined FLEXLM && defined RLM
193 #endif
194 #if !defined FLEXLM && !defined RLM
195 #endif
196 #endif
197 
198 #include "stdafx.h"
199 
200 #if defined MSWIN && defined TECPLOTKERNEL
201 /* CORE SOURCE CODE REMOVED */
202 #endif
203 
204 #include <string>
205 #include <map>
206 #include <vector>
207 #include <queue>
208 
209 #include "TranslatedString.h"
210 
211 /*
212  * The following is a temporary fix for figuring out which product is
213  * running.  In the future when Focus and 360 use the same code base,
214  * we will have to do this dynamically (either with flags on the compiler
215  * or variables within Tecplot).
216  */
217 /* ENDREMOVEFROMADDON */
218 
219 #if defined _WIN32
220 
221 #if !defined TECPLOTKERNEL
222 
223 #if !defined MSWIN
224 #define MSWIN
225 #endif /* !MSWIN */
226 
227 /* For the sake of some older add-ons,
228    defined _WINDOWS, WINDOWS, and WIN32
229    New code should always use MSWIN */
230 
231 #if !defined WINDOWS
232 #define WINDOWS
233 #endif /* WINDOWS */
234 
235 #if !defined _WINDOWS
236 #define _WINDOWS
237 #endif /* !_WINDOWS */
238 
239 #if !defined WIN32
240 #define WIN32
241 #endif /* !WIN32 */
242 
243 #if defined _DEBUG
244 #if !defined DEBUG
245 #define DEBUG
246 #endif
247 #elif defined CHECKED_BUILD
248 #if defined NO_ASSERTS
249 #undef NO_ASSERTS
250 #endif
251 #if !defined NDEBUG
252 #define NDEBUG
253 #endif
254 #else /* RELEASE */
255 #if !defined NDEBUG
256 #define NDEBUG
257 #endif
258 #if !defined NO_ASSERTS
259 #define NO_ASSERTS
260 #endif
261 #endif /* _DEBUG */
262 #endif /* TECPLOTKERNEL */
263 
264 #if _MSC_VER >= 1400
265 #define VS_2005 /* Using VS2005 Compiler */
266 #endif
267 
268 #if !defined TECPLOTKERNEL && defined VS_2005
269 /* Suppress the warnings about the
270      deprecated c runtime functions. */
271 
272 #if !defined _CRT_SECURE_NO_DEPRECATE
273 #define _CRT_SECURE_NO_DEPRECATE
274 #endif
275 #endif /* !TECPLOTKERNEL && VS_2005 */
276 
277 #endif /* MSWIN */
278 
279 #ifdef NDEBUG
280 # ifdef _DEBUG
281 #   error "Both NDEBUG and _DEBUG defined"
282 # endif
283 #elif defined TECPLOTKERNEL
284 # ifndef _DEBUG
285 #   define _DEBUG
286 # endif
287 #endif
288 
289 /* Now a requirement */
290 #define USE_3D_HARDWARE
291 
292 #ifndef THREED
293 #  define THREED
294 #endif
295 
296 #include <stdio.h>
297 #include <ctype.h>
298 #include <math.h>
299 
300 #if defined QUICKDEMO
301 #define DEMO
302 #endif
303 
304 #if defined MicrosoftC
305 #define DOS
306 #endif
307 
308 #if defined CRAYX
309 #define CRAY
310 #endif
311 
312 #if defined IRISX
313 #define IRIS
314 #endif
315 
316 #if defined HPX
317 #define HPUX
318 #define HP
319 #endif
320 
321 #if defined IBMRS6000X
322 #define IBMRS6000
323 #endif
324 
325 #if defined COMPAQALPHAX
326 #define COMPAQALPHA
327 #define COMPAQX
328 #define COMPAQ
329 #endif
330 
331 #if defined DECALPHAX
332 #define DECALPHA
333 #define DECX
334 #endif
335 
336 #if defined DECX
337 #define DEC
338 #endif
339 
340 #if defined SUNSOLARISX || defined SUNSOLARIS86X
341 #define SUNX
342 #endif
343 
344 #if defined SUNX
345 #define SUN
346 #endif
347 
348 #if defined IRISX || defined CRAYX || defined HPX || defined SUNX || defined CONVEXX
349 #define UNIXX
350 #define SYSV
351 #endif
352 
353 #if defined DECX || defined LINUX || defined IBMRS6000X || defined COMPAQX || defined DARWIN
354 #define UNIXX
355 #endif
356 
357 /* BEGINREMOVEFROMADDON */
358 #include <stdarg.h>
359 
360 
361 /* A bit of OEM stuff */
362 #define OEM_INVALID_CHECKSUM (LgIndex_t) -1
363 
364 /* Hide the name of the checksum function */
365 #if defined NDEBUG
366 # define DECRYPTTIMEDCODE          FixupPlot
367 # define CHECKHASHEDCODE           ExpandPlot
368 # define UPDATECLASSICOEMEHCKSUM   ToggleQuadrants
369 # define UPDATEOEMCHECKSUM         ComputeAngleFromQuatrant
370 # define InitOemSettings           InitAngleQuatrantSettings
371 #endif
372 
373 #if defined MSWIN
374 #define USE_TRUETYPEFONTS
375 #endif
376 /* ENDREMOVEFROMADDON */
377 
378 /* BEGINREMOVEFROMADDON */
379 
380 #ifdef __cplusplus // STL
381 
382 #ifdef MSWIN
383 
384 #pragma warning(push, 1) /* warning disabling bellow doesn't actually have any effect on compiler warning.
385 * It appears that Microsft STL enables all the warning right back on.
386 * Therefore, the only way to hide them is to push existing warning level,
387 * lower the level for the time while STL headers are included and then restore
388     * previous warning level with a "pragma warning(pop)"
389     */
390 
391 #pragma warning(disable: 4018)  // signed/unsigned mismatch
392 #pragma warning(disable: 4100)  // unreferenced formal parameter
393 #pragma warning(disable: 4146)  // unary minus operator applied to unsigned type,
394     // result still unsigned
395 #pragma warning(disable: 4244)  // 'conversion' conversion from 'type1' to 'type2',
396     // possible loss of data
397 #pragma warning(disable: 4245)  // conversion from 'type1' to 'type2', signed/unsigned
398     // mismatch
399 #pragma warning(disable: 4511)  // 'class' : copy constructor could not be generated
400 #pragma warning(disable: 4512)  // 'class' : assignment operator could not be generated
401 #pragma warning(disable: 4663)  // C++ language change: to explicitly specialize class
402     // template 'vector'
403 #pragma warning(disable: 4710)  // 'function' : function not inlined
404 #pragma warning(disable: 4786)  // identifier was truncated to 'number' characters
405     // in the debug information
406 #endif
407 
408 #ifdef MSWIN
409 #pragma warning(pop) //Restore old warning state.
410 #endif //MSWIN
411 
412 #endif //__cplusplus
413 
414     /* ENDREMOVEFROMADDON */
415 
416 #ifdef MSWIN
417     /* BEGINREMOVEFROMADDON */
418 #ifdef TECPLOTKERNEL
419 /* CORE SOURCE CODE REMOVED */
420 #ifdef _DEBUG
421 #endif
422 #endif /* TECPLOTKERNEL */
423     /* ENDREMOVEFROMADDON */
424 
425 #ifndef TECPLOTKERNEL
426 #if defined VS_2005
427 #define Widget LONG_PTR /* correct for 32 & 64 bit builds */
428 #else
429 #define Widget long
430 #endif
431 #endif
432 
433 
434 
435 #endif /* MSWIN */
436 
437 
438 #if defined UNIXX && defined ENGINE
439     typedef void *Widget;
440 #endif
441 
442 
443 #include <string.h>
444 
445 #if !defined SYSV && !defined MSWIN
446 #include <strings.h>
447 #endif
448 
449 #if defined (MicrosoftC)
450 #include <stdlib.h>
451 #define EXECOS
452 #ifndef FAR
453 #define FAR
454 #endif
455 #define VOID       void
456 #endif
457 
458 #include <sys/types.h>
459 #include <stdlib.h>
460 
461 #if defined UNIXX
462 #if !defined ENGINE
463 #define X11
464 #define MOTIF
465 #endif
466 #define FAR
467 #define NEAR
468 #include <unistd.h>
469 #endif
470 
471 /* BEGINREMOVEFROMADDON */
472 #if defined TECPLOTKERNEL
473 /* CORE SOURCE CODE REMOVED */
474 #if !defined THREADS_BY_PTHREADS && !defined THREADS_BY_WINAPI
475 #endif
476 #if defined THREADS_BY_PTHREADS
477 #endif
478 #endif
479 /* ENDREMOVEFROMADDON */
480 
481 /* BEGINREMOVEFROMADDON */
482 /* OPENGL currently a must have */
483 #if defined TECPLOTKERNEL
484 /* CORE SOURCE CODE REMOVED */
485 #if 0 /* including GLEW header file is currently defining GLAPI to "extern" which causes problems with a kludged Mesa header GLwDrawA.h external glwMDrawingAreaWidgetClass */
486     #if defined USE_VBOs
487     #endif
488 #endif
489 #  if !defined ENGINE
490 #    if defined UNIXX
491 #    endif
492 #  endif
493 #endif
494 /* ENDREMOVEFROMADDON */
495 /*
496  * If not building the tecplot kernel then at least
497  * include the X Instrinsics.  This will make most
498  * development for addons etc work.
499  */
500 
501 /* NOTE: MOTIF not defined if ENGINE is defined */
502 #if defined MOTIF
503 #  if defined TECPLOTKERNEL
504 /* CORE SOURCE CODE REMOVED */
505 #    if XmVERSION == 1 && XmREVISION == 0
506 #    endif
507 #  else
508 #    include <X11/Intrinsic.h>
509 #  endif
510 #endif
511 
512 #if defined MOTIF
513 #define CREATE_DIALOG_PARAMS Widget W
514 typedef Widget ComboBoxWidget_t;
515 typedef Widget DropDownListWidget_t;
516 typedef Widget FileDialogWidget_t;
517 typedef Widget LabelWidget_t;
518 typedef Widget ListWidget_t;
519 typedef Widget OptionMenuWidget_t;
520 typedef Widget PullDownMenuWidget_t;
521 typedef Widget ScaleWidget_t;
522 typedef Widget TextFieldWidget_t;
523 typedef Widget ToggleWidget_t;
524 typedef Widget ButtonWidget_t;
525 typedef Widget GridWidget_t;
526 #endif
527 #if defined MSWIN
528 #include <windows.h>
529 #define CREATE_DIALOG_PARAMS     CWnd *, LaunchDialogMode_e
530 typedef Widget ComboBoxWidget_t;
531 typedef Widget DropDownListWidget_t;
532 typedef Widget FileDialogWidget_t;
533 typedef Widget LabelWidget_t;
534 typedef Widget ListWidget_t;
535 typedef Widget OptionMenuWidget_t;
536 typedef Widget PullDownMenuWidget_t;
537 typedef Widget ScaleWidget_t;
538 typedef Widget TextFieldWidget_t;
539 typedef Widget ToggleWidget_t;
540 typedef Widget ButtonWidget_t;
541 typedef Widget GridWidget_t;
542 #endif
543 
544 /* BEGINREMOVEFROMADDON */
545 #if defined MSWIN && defined TECPLOTKERNEL
546 /* CORE SOURCE CODE REMOVED */
547 #if defined TRACE
548 #endif
549 #if defined TRACE0
550 #endif
551 #if defined TRACE1
552 #endif
553 #if defined TRACE2
554 #endif
555 #if defined TRACE3
556 #endif
557 #if defined NDEBUG
558 #else
559 #endif
560 #endif /* MSWIN */
561 
562 #if defined TECPLOTKERNEL
563 /* CORE SOURCE CODE REMOVED */
564 #endif /* TECPLOTKERNEL */
565 /* ENDREMOVEFROMADDON */
566 
567 /* Assume that if TRACE is not defined, then none of the TRACE macros are */
568 #if !defined (TRACE)
569 /* TRACE is not used by non-debug builds */
570 #if defined NDEBUG
571 #if defined MSWIN
572 #define TRACE              __noop
573 #define TRACE0(s)          __noop
574 #define TRACE1(S,a1)       __noop
575 #define TRACE2(s,a1,a2)    __noop
576 #define TRACE3(s,a1,a2,a3) __noop
577 #else
578 #define TRACE(str)           ((void)0)
579 #define TRACE0(str)          ((void)0)
580 #define TRACE1(str,a1)       ((void)0)
581 #define TRACE2(str,a1,a2)    ((void)0)
582 #define TRACE3(str,a1,a2,a3) ((void)0)
583 #endif /* MSWIN */
584 #else /* DEBUG */
585 #if defined MSWIN
586 /* If the add-on is running in debug mode but does not
587  * use MFC, then no TRACE macro is available. Thus, to make tracing available,
588  * map TRACE to the win32 OutpuDebugString() function.
589  */
590 # define TRACE(str)           do { OutputDebugStringA(str); } while (0)
591 # define TRACE1(str,a1)       do { char s[5000]; sprintf(s,str,a1);       OutputDebugStringA(s); } while (0)
592 # define TRACE2(str,a1,a2)    do { char s[5000]; sprintf(s,str,a1,a2);    OutputDebugStringA(s); } while (0)
593 # define TRACE3(str,a1,a2,a3) do { char s[5000]; sprintf(s,str,a1,a2,a3); OutputDebugStringA(s); } while (0)
594 # define TRACE0(str) TRACE(str)
595 #else
596 #define TRACE  printf
597 #define TRACE0 printf
598 #define TRACE1 printf
599 #define TRACE2 printf
600 #define TRACE3 printf
601 #endif /* MSWIN */
602 #endif /* NDEBUG */
603 #endif /* !defined (TRACE) */
604 
605 
606 /*
607   Platform independent way for add-ons to know how much space
608   to allocate for a filename.
609 */
610 #if !defined MAX_SIZEOFUTF8CHAR
611 #define MAX_SIZEOFUTF8CHAR 1
612 #endif
613 
614 #if !defined (MaxCharsFilePath)
615 # if defined (MSWIN)
616 #   define MaxCharsFilePath (_MAX_PATH*MAX_SIZEOFUTF8CHAR+1) /* Includes traling '\0' */
617 # else
618 #   define MaxCharsFilePath 2047 /* ...not really a hard limit for Linux/Unix */
619 # endif /* MSWIN */
620 #endif /* !MaxCharsFilePath */
621 
622 /* BEGINREMOVEFROMADDON */
623 
624 /*
625  * Under Windows, if we are doing a release build (NDEBUG) that is not a CHECKED_BUILD
626  * then NO_ASSERTS should be defined
627  */
628 #if defined MSWIN && defined NDEBUG && !defined NO_ASSERTS && !defined CHECKED_BUILD
629 /* intentionally break the compile */
630 #  error "define NO_ASSERTS for release builds"
631 #endif
632 
633 /*
634  * Under Windows, if we are doing a CHECKED_BUILD then it should
635  * also be a release build (NDEBUG)
636  */
637 #if defined MSWIN && defined CHECKED_BUILD && !defined NDEBUG
638 #  error "CHECKED_BUILDS must also be release builds! NDEBUG should be defined but isn't."
639 #endif
640 
641 
642 #if defined NO_ASSERTS
643 #  if !defined USE_MACROS_FOR_FUNCTIONS
644 #    define USE_MACROS_FOR_FUNCTIONS
645 #  endif
646 #endif
647 /* ENDREMOVEFROMADDON */
648 
649 /* BEGINREMOVEFROMADDON */
650 /*
651  * Under Linux the definition of NULL has a cast that conflicts with our own
652  * casting causing warnings that make it tough to find real problems.
653  */
654 #if defined LINUX && defined NULL
655 # undef NULL
656 # define NULL 0
657 #endif
658 
659 /*
660  */
661 #if !defined MSWIN && !defined ENGINE && !defined ISMESA
662 #define DISALLOW_OFFSCREEN_EXPORT_IN_BATCH
663 #endif
664 
665 /* indentify the platforms capable of using FFMPEG for encoding video formats */
666 #if defined MSWIN || defined LINUX || defined DARWIN
667     #define HAVE_FFMPEG
668 #endif
669 /* ENDREMOVEFROMADDON */
670 
671 /* In windows min and max are being redefined in windef.h.
672  * As we want to use the ones provided by the STL we undefined them
673  */
674 #if defined MSWIN && defined max
675 # undef max
676 #endif
677 
678 #if defined MSWIN && defined min
679 # undef min
680 #endif
681 
682 #endif /* _MASTER_H_ */
683