(__gcc_bcmp): New function, in cond on L__gcc_bcmp.
authorRichard Stallman <rms@gnu.org>
Sat, 12 Sep 1992 08:45:46 +0000 (08:45 +0000)
committerRichard Stallman <rms@gnu.org>
Sat, 12 Sep 1992 08:45:46 +0000 (08:45 +0000)
From-SVN: r2110

gcc/libgcc2.c

index 432cf93bd90a137d0e8f8e34f5df4b399b0b2478..70286cc5ec5f379c9857af11411ee13a996fea5e 100644 (file)
@@ -975,7 +975,30 @@ __fixunssfsi (SFtype a)
 #undef unsigned
 #undef float
 #undef double
+\f
+#ifdef L__gcc_bcmp
+
+/* Like bcmp except the sign is meaningful.
+   Reult is negative if S1 is less than S2,
+   positive if S1 is greater, 0 if S1 and S2 are equal.  */
 
+int
+__gcc_bcmp (s1, s2, size)
+     char *s1, *s2;
+     size_t size;
+{
+  while (size > 0)
+    {
+      char c1 = *s1++, c2 = *s2++;
+      if (c1 != c2)
+       return c1 - c2;
+      size--;
+    }
+  return 0;
+}
+
+#endif
+\f\f
 #ifdef L_varargs
 #ifdef __i860__
 #if defined(__svr4__) || defined(__alliant__)