[rtems commit] score: Add RTEMS_CONST

Sebastian Huber sebh at rtems.org
Tue Apr 9 06:11:38 UTC 2019


Module:    rtems
Branch:    master
Commit:    3c50c3286535730084633b4d960b3aee4d86e455
Changeset: http://git.rtems.org/rtems/commit/?id=3c50c3286535730084633b4d960b3aee4d86e455

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Fri Apr  5 08:42:01 2019 +0200

score: Add RTEMS_CONST

Close #3734.

---

 cpukit/include/rtems/score/basedefs.h | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/cpukit/include/rtems/score/basedefs.h b/cpukit/include/rtems/score/basedefs.h
index 770865b..8babc0a 100644
--- a/cpukit/include/rtems/score/basedefs.h
+++ b/cpukit/include/rtems/score/basedefs.h
@@ -107,6 +107,17 @@
 /**
  *  The following defines a compiler specific attribute which informs
  *  the compiler that the method has no effect except the return value
+ *  and that the return value depends only the value of parameters.
+ */
+#ifdef __GNUC__
+  #define RTEMS_CONST __attribute__((__const__))
+#else
+  #define RTEMS_CONST
+#endif
+
+/**
+ *  The following defines a compiler specific attribute which informs
+ *  the compiler that the method has no effect except the return value
  *  and that the return value depends only on parameters and/or global
  *  variables.
  */




More information about the vc mailing list