18b52a31eSHanoh Haim#ifndef C_COMMON
28b52a31eSHanoh Haim#define C_COMMON
38b52a31eSHanoh Haim/*
48b52a31eSHanoh HaimCopyright (c) 2015-2015 Cisco Systems, Inc.
58b52a31eSHanoh Haim
68b52a31eSHanoh HaimLicensed under the Apache License, Version 2.0 (the "License");
78b52a31eSHanoh Haimyou may not use this file except in compliance with the License.
88b52a31eSHanoh HaimYou may obtain a copy of the License at
98b52a31eSHanoh Haim
108b52a31eSHanoh Haim    http://www.apache.org/licenses/LICENSE-2.0
118b52a31eSHanoh Haim
128b52a31eSHanoh HaimUnless required by applicable law or agreed to in writing, software
138b52a31eSHanoh Haimdistributed under the License is distributed on an "AS IS" BASIS,
148b52a31eSHanoh HaimWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
158b52a31eSHanoh HaimSee the License for the specific language governing permissions and
168b52a31eSHanoh Haimlimitations under the License.
178b52a31eSHanoh Haim*/
188b52a31eSHanoh Haim#include <stdint.h>
198b52a31eSHanoh Haim#include <assert.h>
208b52a31eSHanoh Haim
218b52a31eSHanoh Haimtypedef uint8_t   uint8;
228b52a31eSHanoh Haimtypedef int8_t     int8;
238b52a31eSHanoh Haim
248b52a31eSHanoh Haimtypedef uint16_t  uint16;
258b52a31eSHanoh Haimtypedef int16_t    int16;
268b52a31eSHanoh Haim
278b52a31eSHanoh Haimtypedef uint32_t   uint32; //32 bit
288b52a31eSHanoh Haimtypedef int32_t    int32;
298b52a31eSHanoh Haim
308b52a31eSHanoh Haim
318b52a31eSHanoh Haimtypedef uint32_t    uint;
328b52a31eSHanoh Haimtypedef uint8_t    uchar;
338b52a31eSHanoh Haimtypedef uint16_t   ushort;
348b52a31eSHanoh Haim
358b52a31eSHanoh Haimtypedef void*           c_pvoid;
368b52a31eSHanoh Haim
378b52a31eSHanoh Haim#ifndef NULL
388b52a31eSHanoh Haim#ifdef __cplusplus
398b52a31eSHanoh Haim#define NULL    0
408b52a31eSHanoh Haim#else  /* __cplusplus */
418b52a31eSHanoh Haim#define NULL    ((void *)0)
428b52a31eSHanoh Haim#endif  /* __cplusplus */
438b52a31eSHanoh Haim#endif  /* NULL */
448b52a31eSHanoh Haim
458b52a31eSHanoh Haim
468b52a31eSHanoh Haim#ifdef _DEBUG
478b52a31eSHanoh Haim    #define BP_ASSERT(a) assert(a)
488b52a31eSHanoh Haim#else
4938dc2db8Simarom    #define BP_ASSERT(a) (void (a))
508b52a31eSHanoh Haim#endif
518b52a31eSHanoh Haim
528b52a31eSHanoh Haim#endif
531e6b2bf6SYaroslav Brustinov
541e6b2bf6SYaroslav Brustinov#define ASSERT_MSG(cond, msg) if (!(cond)) {std::cerr << msg << std::endl; exit(-1);}