Helper Reference Manual  1.7.1
strong_types.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright (c) 2015-2018 Linaro Limited
3  */
4 
12 #ifndef ODPH_STRONG_TYPES_H_
13 #define ODPH_STRONG_TYPES_H_
14 
16 #ifdef __cplusplus
18 #define ODPH_HANDLE_T(type) struct _##type { uint8_t unused_dummy_var; } *type
19 #else
20 #define odph_handle_t struct { uint8_t unused_dummy_var; } *
22 #define ODPH_HANDLE_T(type) odph_handle_t type
23 #endif
24 
26 #define _odph_typeval(handle) ((uintptr_t)(handle))
27 
29 #define _odph_pri(handle) ((uint64_t)(uintptr_t)(handle))
30 
32 #define _odph_cast_scalar(type, val) ((type)(uintptr_t)(val))
33 
34 #endif