Generate __attribute__(deprecated) for deprecated APIs.

We allow also a custom deprecation message.

Change-Id: I297bed611c7fbbb34d41e7edd796557c9afe50da
diff --git a/scriptc/rs_math.rsh b/scriptc/rs_math.rsh
index 7ab6975..9125854 100644
--- a/scriptc/rs_math.rsh
+++ b/scriptc/rs_math.rsh
@@ -4083,22 +4083,46 @@
  *   low: Lower bound.
  *   high: Upper bound.
  */
-extern char __attribute__((const, always_inline, overloadable))
+extern char __attribute__((const, always_inline, overloadable
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+, deprecated("Use clamp() instead.")
+#endif
+))
     rsClamp(char amount, char low, char high);
 
-extern uchar __attribute__((const, always_inline, overloadable))
+extern uchar __attribute__((const, always_inline, overloadable
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+, deprecated("Use clamp() instead.")
+#endif
+))
     rsClamp(uchar amount, uchar low, uchar high);
 
-extern short __attribute__((const, always_inline, overloadable))
+extern short __attribute__((const, always_inline, overloadable
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+, deprecated("Use clamp() instead.")
+#endif
+))
     rsClamp(short amount, short low, short high);
 
-extern ushort __attribute__((const, always_inline, overloadable))
+extern ushort __attribute__((const, always_inline, overloadable
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+, deprecated("Use clamp() instead.")
+#endif
+))
     rsClamp(ushort amount, ushort low, ushort high);
 
-extern int __attribute__((const, always_inline, overloadable))
+extern int __attribute__((const, always_inline, overloadable
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+, deprecated("Use clamp() instead.")
+#endif
+))
     rsClamp(int amount, int low, int high);
 
-extern uint __attribute__((const, always_inline, overloadable))
+extern uint __attribute__((const, always_inline, overloadable
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+, deprecated("Use clamp() instead.")
+#endif
+))
     rsClamp(uint amount, uint low, uint high);
 
 /*
@@ -4108,7 +4132,11 @@
  *
  * Returns the fractional part of a float
  */
-extern float __attribute__((const, overloadable))
+extern float __attribute__((const, overloadable
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+, deprecated("Use fract() instead.")
+#endif
+))
     rsFrac(float v);
 
 /*