1 /****************************************************************************
2 *
3 *    Copyright 2012 - 2021 Vivante Corporation, Santa Clara, California.
4 *    All Rights Reserved.
5 *
6 *    Permission is hereby granted, free of charge, to any person obtaining
7 *    a copy of this software and associated documentation files (the
8 *    'Software'), to deal in the Software without restriction, including
9 *    without limitation the rights to use, copy, modify, merge, publish,
10 *    distribute, sub license, and/or sell copies of the Software, and to
11 *    permit persons to whom the Software is furnished to do so, subject
12 *    to the following conditions:
13 *
14 *    The above copyright notice and this permission notice (including the
15 *    next paragraph) shall be included in all copies or substantial
16 *    portions of the Software.
17 *
18 *    THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
19 *    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 *    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
21 *    IN NO EVENT SHALL VIVANTE AND/OR ITS SUPPLIERS BE LIABLE FOR ANY
22 *    CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23 *    TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24 *    SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 *
26 *****************************************************************************/
27 
28 #ifndef elm_precom_h
29 #define elm_precom_h
30 
31 /* System headers. */
32 #include <stdio.h>
33 #include <stdlib.h>
34 #include <string.h>
35 
36 /* VGLite hdaders. */
37 #include "vg_lite.h"
38 
39 /* Project headers. */
40 #include "Elm.h"
41 #include "velm.h"
42 #include "elm_os.h"
43 
44 #define JUMP_IF_NON_ZERO_VALUE(x, label) { int ret = x; if ( (ret) != 1 ) { goto label; }  }
45 #define JUMP_IF_NULL(x, label) { if (x == NULL) { goto label;} }
46 #define JUMP_IF_LOWER(x, y, label) {if (x < y) {goto label;} }
47 #define JUMP_IF_GREATER(x, y, label) {if (x > y) {goto label;} }
48 #define JUMP_IF_EQUAL(x, y, label) {if (x == y) {goto label;} }
49 #define JUMP_IF_LOWER_OR_EQUAL(x, y, label) {if (x <= y) {goto label;} }
50 #define JUMP_IF_GREATER_OR_EQUAL(x, y, label) {if (x => y) {goto label;} }
51 
52 #define MIN(a, b) ((a) > (b) ? (b) : (a))
53 #define MAX(a, b) ((a) > (b) ? (a) : (b))
54 
55 #endif /* elm_precom_h */
56