shithub: sox

Download patch

ref: 42d30cfc19bf2a377dbe9869dbb92bf55b34c86b
parent: 61b964bbaaa3cac0037aeb7818f8c322489f15cb
author: Mans Rullgard <mans@mansr.com>
date: Sat Sep 5 19:08:47 EDT 2015

Make non-null return attributes meaningful with gcc 4.9 and up

--- a/src/sox.h
+++ b/src/sox.h
@@ -32,6 +32,19 @@
 #pragma GCC system_header
 #endif
 
+#if defined __GNUC__
+#define LSX_GCC(maj, min) \
+  ((__GNUC__ > (maj)) || (__GNUC__ == (maj) && __GNUC_MINOR__ >= (min)))
+#else
+#define LSX_GCC(maj, min) 0
+#endif
+
+#if LSX_GCC(4,9)
+#define _Ret_ __attribute__ ((returns_nonnull))
+#define _Ret_valid_ _Ret_
+#define _Ret_z_ _Ret_
+#endif
+
 /*****************************************************************************
 API decoration macros:
 Mostly for documentation purposes. For some compilers, decorations also affect