[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[MiNT] rindex cleanup
Hello.
The attached patch for the MiNTLib defines the rindex alias for strrchr in a
more portable way.
Actually, this is the only change required to successfully compile the
MiNTLib using the ELF object file format ;-)
Please commit it using the following comment:
----------------------------------------------------------------------
Define the rindex alias for strrchr in a more portable way.
Contributed by Vincent Riviere.
----------------------------------------------------------------------
--
Vincent Rivière
diff -x CVS -aurN mintlib.orig/string/strrchr.c mintlib/string/strrchr.c
--- mintlib.orig/string/strrchr.c 2009-05-17 18:13:06.812500000 +0200
+++ mintlib/string/strrchr.c 2009-10-04 15:17:42.000000000 +0200
@@ -4,17 +4,6 @@
/*
* strrchr - find last occurrence of a character in a string
*/
-#ifdef __GNUC__
-__asm__(".stabs \"_rindex\",5,0,0,_strrchr"); /* dept of clean tricks */
-#else
-char *
-rindex(s, charwanted)
- const char *s;
- int charwanted;
-{
- return strrchr(s, charwanted);
-}
-#endif
char * /* found char, or NULL if none */
strrchr(s, charwanted)
@@ -32,3 +21,5 @@
return((char *)--s);
return (char *)place;
}
+
+strong_alias (strrchr, rindex)