target: rtt: include rtt.h
[openocd.git] / src / helper / compiler.h
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2
3 /*
4 * This file contains compiler specific workarounds to handle different
5 * compilers and different compiler versions.
6 * Inspired by Linux's include/linux/compiler_attributes.h
7 * and file sys/cdefs.h in libc and newlib.
8 */
9
10 #ifndef OPENOCD_HELPER_COMPILER_H
11 #define OPENOCD_HELPER_COMPILER_H
12
13 /*
14 * __has_attribute is supported on gcc >= 5, clang >= 2.9 and icc >= 17.
15 */
16 #ifndef __has_attribute
17 # define __has_attribute(x) 0
18 #endif
19
20 /*
21 * The __returns_nonnull function attribute marks the return type of the function
22 * as always being non-null.
23 */
24 #ifndef __returns_nonnull
25 # if __has_attribute(__returns_nonnull__)
26 # define __returns_nonnull __attribute__((__returns_nonnull__))
27 # else
28 # define __returns_nonnull
29 # endif
30 #endif
31
32 /*
33 * The __nonnull function attribute marks pointer parameters that
34 * must not be NULL.
35 *
36 * clang for Apple defines
37 * #define __nonnull _Nonnull
38 * that is a per argument attribute, incompatible with the gcc per function attribute __nonnull__.
39 * gcc for Apple includes sys/cdefs.h from MacOSX.sdk that defines
40 * #define __nonnull
41 * In both cases, undefine __nonnull to keep compatibility among compilers and platforms.
42 */
43 #if defined(__APPLE__)
44 # undef __nonnull
45 #endif
46 #ifndef __nonnull
47 # if __has_attribute(__nonnull__)
48 # define __nonnull(params) __attribute__ ((__nonnull__ params))
49 # else
50 # define __nonnull(params)
51 # endif
52 #endif
53
54 #endif /* OPENOCD_HELPER_COMPILER_H */

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)