19 lines
578 B
C
19 lines
578 B
C
//
|
|
// Created by epagris on 2022.10.31..
|
|
//
|
|
|
|
#ifndef ETHERLIB_UTILS_H
|
|
#define ETHERLIB_UTILS_H
|
|
|
|
#include <stdio.h>
|
|
|
|
#define ERROR(...) printf(__VA_ARGS__)
|
|
#define INFO(...) printf(__VA_ARGS__)
|
|
|
|
#define ASSERT_BAD_ALIGN(p) if ((size_t)(p) & 0b11) ERROR("Bad memory alignment in function '%s' in file '%s' on line %d!\n", __func__, __FILE__, __LINE__)
|
|
#define ASSERT_NULL(p) if ((p) == NULL) ERROR("NULL in function '%s' in file '%s' on line %d!\n", __func__, __FILE__, __LINE__)
|
|
|
|
#define ALIGN(p,t) (((size_t)(p) + (sizeof(t) - 1)) & ~(sizeof(t) - 1))
|
|
|
|
#endif //ETHERLIB_UTILS_H
|