toolchain: define ZRESTRICT for restrict aliasing
restrict keyword is not supported in C++, however GNUC does support __restrict for C/C++ so we can use that, however the complexity of toolchains requires a ZRESTRICT symbol that should be used throughout the codebase to not cause any conflicts or redefinition errors Signed-off-by: Nicholas Lowell <nlowell@lexmark.com>
This commit is contained in:
parent
4ae9fb6ce5
commit
0d31403318
2 changed files with 14 additions and 0 deletions
|
@ -26,6 +26,14 @@
|
||||||
#define TASK_ENTRY_CPP extern "C"
|
#define TASK_ENTRY_CPP extern "C"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef ZRESTRICT
|
||||||
|
#ifndef __cplusplus
|
||||||
|
#define ZRESTRICT restrict
|
||||||
|
#else
|
||||||
|
#define ZRESTRICT
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Generate a reference to an external symbol.
|
* Generate a reference to an external symbol.
|
||||||
* The reference indicates to the linker that the symbol is required
|
* The reference indicates to the linker that the symbol is required
|
||||||
|
|
|
@ -63,6 +63,12 @@
|
||||||
#define BUILD_ASSERT(EXPR, MSG...)
|
#define BUILD_ASSERT(EXPR, MSG...)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
#define ZRESTRICT __restrict
|
||||||
|
#else
|
||||||
|
#define ZRESTRICT restrict
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <toolchain/common.h>
|
#include <toolchain/common.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue