summaryrefslogtreecommitdiffstats
path: root/cpukit
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2021-02-10 06:43:39 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2021-02-19 07:07:04 +0100
commitbe60372136ac4f5acd8bc3286da6ed3fc50fa053 (patch)
tree512b7b112b73f231ed52833840137cfa9205bd5d /cpukit
parentshell.c: Fix Dereference before null check (CID #1467420) (diff)
downloadrtems-be60372136ac4f5acd8bc3286da6ed3fc50fa053.tar.bz2
basedefs: Add RTEMS_ALIGNOF()
Diffstat (limited to 'cpukit')
-rw-r--r--cpukit/include/rtems/score/basedefs.h21
1 files changed, 20 insertions, 1 deletions
diff --git a/cpukit/include/rtems/score/basedefs.h b/cpukit/include/rtems/score/basedefs.h
index c3a46f52b3..c423c530b2 100644
--- a/cpukit/include/rtems/score/basedefs.h
+++ b/cpukit/include/rtems/score/basedefs.h
@@ -10,7 +10,7 @@
/*
* Copyright (C) 2014 Paval Pisa
* Copyright (C) 2011, 2013 On-Line Applications Research Corporation (OAR)
- * Copyright (C) 2009, 2020 embedded brains GmbH (http://www.embedded-brains.de)
+ * Copyright (C) 2009, 2021 embedded brains GmbH (http://www.embedded-brains.de)
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -156,6 +156,25 @@ extern "C" {
#define RTEMS_ALIGNED( _alignment )
#endif
+/* Generated from spec:/rtems/basedefs/if/alignof */
+
+/**
+ * @ingroup RTEMSAPIBaseDefs
+ *
+ * @brief Gets the alignment requirement of the type.
+ *
+ * @param _type_name is the type name to get the alignment requirement for.
+ *
+ * @return Returns the alignment requirement of the type.
+ */
+#if __cplusplus >= 201103L
+ #define RTEMS_ALIGNOF( _type_name ) alignof( _type_name )
+#elif __STDC_VERSION__ >= 201112L
+ #define RTEMS_ALIGNOF( _type_name ) _Alignof( _type_name )
+#else
+ #define RTEMS_ALIGNOF( _type_name ) sizeof( _type_name )
+#endif
+
/* Generated from spec:/rtems/basedefs/if/alloc-align */
/**