dev: strip debig log function name prefix during compilation
[vpp.git] / src / vppinfra / types.h
index 7841823..ad85af3 100644 (file)
@@ -57,12 +57,8 @@ typedef unsigned char u8;
 typedef unsigned short u16;
 #endif /* ! CLIB_LINUX_KERNEL */
 
-#if defined (__x86_64__)
-#ifndef __COVERITY__
-typedef signed int i128 __attribute__ ((mode (TI)));
-typedef unsigned int u128 __attribute__ ((mode (TI)));
-#endif
-#endif
+typedef signed __int128 i128;
+typedef unsigned __int128 u128;
 
 #if (defined(i386) || (defined(_mips) && __mips != 64) || defined(powerpc) || defined (__SPU__) || defined(__sparc__) || defined(__arm__) || defined (__xtensa__) || defined(__TMS320C6X__))
 typedef signed int i32;
@@ -135,6 +131,9 @@ typedef u32 clib_address_t;
 #define CLIB_U32_MAX __UINT32_MAX__
 #define CLIB_U64_MAX __UINT64_MAX__
 
+#define CLIB_F64_MAX __DBL_MAX__
+#define CLIB_F32_MAX __FLT_MAX__
+
 #if clib_address_bits == 64
 #define CLIB_WORD_MAX  CLIB_I64_MAX
 #define CLIB_UWORD_MAX CLIB_U64_MAX
@@ -200,6 +199,18 @@ typedef i64 i64u __attribute__ ((aligned (1), __may_alias__));
 typedef word wordu __attribute__ ((aligned (1), __may_alias__));
 typedef uword uwordu __attribute__ ((aligned (1), __may_alias__));
 
+#define foreach_int(__var, ...)                                               \
+  for (int __int_array[] = { __VA_ARGS__, 0 }, *__int_ptr = __int_array,      \
+          __var = *__int_ptr;                                                \
+       __int_ptr - (ARRAY_LEN (__int_array) - 1) < __int_array;               \
+       __var = *++__int_ptr)
+
+#define foreach_pointer(__var, ...)                                           \
+  for (void *__ptr_array[] = { __VA_ARGS__, 0 }, **__ptr_ptr = __ptr_array,   \
+           *__var = *__ptr_ptr;                                              \
+       __ptr_ptr - (ARRAY_LEN (__ptr_array) - 1) < __ptr_array;               \
+       __var = *++__ptr_ptr)
+
 #endif /* included_clib_types_h */
 
 /*