*
* @file base.h
*
- * @copyright Copyright (C) 2013 Czech Technical University in Prague
+ * @copyright Copyright (C) 2013, 2015 Czech Technical University in Prague
*
* @author Carlos Jenkins <carlos@jenkins.co.cr>
*/
#include "types.h"
#include "binary.h"
#include "os/os.h"
-#ifdef TARGET_TMS570_RPP
-#include "sys/_tms570_rpp/port.h"
-#endif /* TARGET_TMS570_RPP */
+#include <assert.h>
// General IO directives
/**
# define D(x)
#endif
+/** Calculates the number of elements in an array */
+#define ARRAY_SIZE(x) (sizeof(x)/sizeof(*(x)))
+
+#if defined(static_assert)
+/** Static assertion as available in C11 standard */
+#define STATIC_ASSERT(COND,MSG) static_assert(COND, #MSG)
+#else
+/** Static assertion - non-C11 fall-back */
+#define STATIC_ASSERT(COND,MSG) typedef char static_assertion_##MSG[(COND) ? 1 : -1]
+#endif
+
#endif /* __BASE_H */