aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1992-09-12 08:45:46 +0000
committerRichard Stallman <rms@gnu.org>1992-09-12 08:45:46 +0000
commit9bd23d2c954318dfe201afc37c9dbca98856040b (patch)
tree7ec1acb9474d43990d7fc100bd45f342f195b2d1 /gcc
parentbb3facc561fb0822545e1a8748be14650f3d1086 (diff)
downloadgcc-9bd23d2c954318dfe201afc37c9dbca98856040b.zip
gcc-9bd23d2c954318dfe201afc37c9dbca98856040b.tar.gz
gcc-9bd23d2c954318dfe201afc37c9dbca98856040b.tar.bz2
(__gcc_bcmp): New function, in cond on L__gcc_bcmp.
From-SVN: r2110
Diffstat (limited to 'gcc')
-rw-r--r--gcc/libgcc2.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc/libgcc2.c b/gcc/libgcc2.c
index 432cf93..70286cc 100644
--- a/gcc/libgcc2.c
+++ b/gcc/libgcc2.c
@@ -975,7 +975,30 @@ __fixunssfsi (SFtype a)
#undef unsigned
#undef float
#undef double
+
+#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
+
#ifdef L_varargs
#ifdef __i860__
#if defined(__svr4__) || defined(__alliant__)