[PATCH 1/3] score: Add RTEMS_CONST

Sebastian Huber sebastian.huber at embedded-brains.de
Fri Apr 5 07:15:08 UTC 2019


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 770865bb80..8babc0a448 100644
--- a/cpukit/include/rtems/score/basedefs.h
+++ b/cpukit/include/rtems/score/basedefs.h
@@ -104,6 +104,17 @@
 /* Provided for backward compatibility */
 #define RTEMS_COMPILER_NO_RETURN_ATTRIBUTE RTEMS_NO_RETURN
 
+/**
+ *  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
-- 
2.16.4



More information about the devel mailing list