5a141925e7fefebb0af5c6c0ebead9f5dee2d56a
[protos/libecoli.git] / include / ecoli_utils.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright 2018, Olivier MATZ <zer0@droids-corp.org>
3  */
4
5 #ifndef ECOLI_UTILS_
6 #define ECOLI_UTILS_
7
8 /**
9  * Cast a variable into a type, ensuring its initial type first
10  */
11 #define EC_CAST(x, old_type, new_type) ({       \
12         old_type __x = (x);                     \
13         (new_type)__x;                          \
14         })
15
16 #endif