Julius Werner | 94f8907 | 2017-07-31 18:15:11 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2017, ARM Limited and Contributors. All rights reserved. |
| 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
Antonio Nino Diaz | 5eb8837 | 2018-11-08 10:20:19 +0000 | [diff] [blame] | 7 | #ifndef CONSOLE_ASSERTIONS_H |
| 8 | #define CONSOLE_ASSERTIONS_H |
Julius Werner | 94f8907 | 2017-07-31 18:15:11 -0700 | [diff] [blame] | 9 | |
| 10 | #include <cassert.h> |
| 11 | |
| 12 | /* |
| 13 | * This file contains some separate assertions about console_t, moved here to |
| 14 | * keep them out of the way. Should only be included from <console.h>. |
| 15 | */ |
| 16 | CASSERT(CONSOLE_T_NEXT == __builtin_offsetof(console_t, next), |
| 17 | assert_console_t_next_offset_mismatch); |
| 18 | CASSERT(CONSOLE_T_FLAGS == __builtin_offsetof(console_t, flags), |
| 19 | assert_console_t_flags_offset_mismatch); |
| 20 | CASSERT(CONSOLE_T_PUTC == __builtin_offsetof(console_t, putc), |
| 21 | assert_console_t_putc_offset_mismatch); |
| 22 | CASSERT(CONSOLE_T_GETC == __builtin_offsetof(console_t, getc), |
| 23 | assert_console_t_getc_offset_mismatch); |
| 24 | CASSERT(CONSOLE_T_FLUSH == __builtin_offsetof(console_t, flush), |
| 25 | assert_console_t_flush_offset_mismatch); |
| 26 | CASSERT(CONSOLE_T_DRVDATA == sizeof(console_t), |
| 27 | assert_console_t_drvdata_offset_mismatch); |
| 28 | |
Antonio Nino Diaz | 5eb8837 | 2018-11-08 10:20:19 +0000 | [diff] [blame] | 29 | #endif /* CONSOLE_ASSERTIONS_H */ |