1#ifndef C_COMMON
2#define C_COMMON
3/*
4Copyright (c) 2015-2015 Cisco Systems, Inc.
5
6Licensed under the Apache License, Version 2.0 (the "License");
7you may not use this file except in compliance with the License.
8You may obtain a copy of the License at
9
10    http://www.apache.org/licenses/LICENSE-2.0
11
12Unless required by applicable law or agreed to in writing, software
13distributed under the License is distributed on an "AS IS" BASIS,
14WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15See the License for the specific language governing permissions and
16limitations under the License.
17*/
18#include <stdint.h>
19#include <assert.h>
20
21typedef uint8_t   uint8;
22typedef int8_t     int8;
23
24typedef uint16_t  uint16;
25typedef int16_t    int16;
26
27typedef uint32_t   uint32; //32 bit
28typedef int32_t    int32;
29
30
31typedef uint32_t    uint;
32typedef uint8_t    uchar;
33typedef uint16_t   ushort;
34
35typedef void*           c_pvoid;
36
37#ifndef NULL
38#ifdef __cplusplus
39#define NULL    0
40#else  /* __cplusplus */
41#define NULL    ((void *)0)
42#endif  /* __cplusplus */
43#endif  /* NULL */
44
45
46#ifdef _DEBUG
47    #define BP_ASSERT(a) assert(a)
48#else
49    #define BP_ASSERT(a) (void (a))
50#endif
51
52#endif
53
54#define ASSERT_MSG(cond, msg) if (!(cond)) {std::cerr << msg << std::endl; exit(-1);}
55