introduce restricted pointer aliasing marker
[dpdk.git] / lib / librte_eal / include / rte_common.h
index 0843ce6..586f815 100644 (file)
@@ -103,6 +103,15 @@ typedef uint16_t unaligned_uint16_t;
  */
 #define __rte_unused __attribute__((__unused__))
 
+/**
+ * Mark pointer as restricted with regard to pointer aliasing.
+ */
+#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901L
+#define __rte_restrict __restrict
+#else
+#define __rte_restrict restrict
+#endif
+
 /**
  * definition to mark a variable or function parameter as used so
  * as to avoid a compiler warning