shithub: sox

Download patch

ref: 7cdd8975a4aa03716fcda9caa173cf29613d5423
parent: 3c8b42f039405f6938faaa32234292b55e1b8eea
author: cbagwell <cbagwell>
date: Thu Dec 14 09:19:12 EST 2006

Make compile on non-gnu compilers. Remove unused REGPARM macro.

--- a/src/misc.c
+++ b/src/misc.c
@@ -454,7 +454,7 @@
 
 
 /* here for linear interp.  might be useful for other things */
-REGPARM(2) st_sample_t st_gcd(st_sample_t a, st_sample_t b)
+st_sample_t st_gcd(st_sample_t a, st_sample_t b)
 {
         if (b == 0)
                 return a;
@@ -462,7 +462,7 @@
                 return st_gcd(b, a % b);
 }
 
-REGPARM(2) st_sample_t st_lcm(st_sample_t a, st_sample_t b)
+st_sample_t st_lcm(st_sample_t a, st_sample_t b)
 {
     /* parenthesize this way to avoid st_sample_t overflow in product term */
     return a * (b / st_gcd(a, b));
--- a/src/st_i.h
+++ b/src/st_i.h
@@ -23,8 +23,11 @@
 #endif
 
 /* various gcc optimizations and portablity defines */
+#ifdef __GNUC__
 #define NORET __attribute__((noreturn))
-#define REGPARM(n) __attribute__((regparm(n)))
+#else
+#define NORET
+#endif
 
 /* declared in misc.c */
 typedef struct {char const *text; int value;} enum_item;
@@ -44,8 +47,8 @@
     double max,
     double phase);
 
-REGPARM(2) st_sample_t st_gcd(st_sample_t a, st_sample_t b);
-REGPARM(2) st_sample_t st_lcm(st_sample_t a, st_sample_t b);
+st_sample_t st_gcd(st_sample_t a, st_sample_t b);
+st_sample_t st_lcm(st_sample_t a, st_sample_t b);
 
 #ifndef HAVE_STRCASECMP
 int strcasecmp(const char *s1, const char *s2);