about summary refs log tree commit diff
path: root/string
diff options
context:
space:
mode:
Diffstat (limited to 'string')
-rw-r--r--string/Makefile2
-rw-r--r--string/Versions6
-rw-r--r--string/bits/string2.h16
-rw-r--r--string/string-inlines.c28
4 files changed, 45 insertions, 7 deletions
diff --git a/string/Makefile b/string/Makefile
index d0e3c8e83b..cb6475a1fe 100644
--- a/string/Makefile
+++ b/string/Makefile
@@ -39,7 +39,7 @@ routines	:= strcat strchr strcmp strcoll strcpy strcspn		\
 			             delete extract insert stringify	\
 				     addsep replace)			\
 		   envz basename					\
-		   strcoll_l strxfrm_l
+		   strcoll_l strxfrm_l string-inlines
 
 tests		:= tester inl-tester noinl-tester testcopy test-ffs	\
 		   tst-strlen stratcliff tst-svc tst-inlcall
diff --git a/string/Versions b/string/Versions
index 48562e9e4c..d324e2e2ab 100644
--- a/string/Versions
+++ b/string/Versions
@@ -57,6 +57,12 @@ libc {
     strcasestr; strverscmp;
   }
   GLIBC_2.1.1 {
+    # extern inline functions used by <bits/string2.h>
+    __mempcpy_small; __stpcpy_small; __strcspn_c1; __strcspn_c2; __strcspn_c3;
+    __strcpy_small; __strspn_c1; __strspn_c2; __strspn_c3; __strpbrk_c2; 
+    __strpbrk_c3; __strsep_1c; __strsep_2c; __strsep_3c; __strsep_g; 
+    __strtok_r_1c; 
+
     # s*
     strchrnul; __strverscmp;
   }
diff --git a/string/bits/string2.h b/string/bits/string2.h
index 4d67c57a77..fdfa32dc2c 100644
--- a/string/bits/string2.h
+++ b/string/bits/string2.h
@@ -39,10 +39,12 @@
    We must use here macros instead of inline functions since the
    trick won't work with the later.  */
 
-#ifdef __cplusplus
-# define __STRING_INLINE inline
-#else
-# define __STRING_INLINE extern __inline
+#ifndef __STRING_INLINE
+# ifdef __cplusplus
+#  define __STRING_INLINE inline
+# else
+#  define __STRING_INLINE extern __inline
+# endif
 #endif
 
 #if _STRING_ARCH_unaligned
@@ -939,7 +941,7 @@ __strpbrk_c3 (__const char *__s, char __accept1, char __accept2,
 #endif
 
 
-#ifdef __USE_GNU
+#if defined __USE_GNU && !defined _FORCE_INLINES
 # ifndef _HAVE_STRING_ARCH_strnlen
 __STRING_INLINE size_t strnlen (__const char *__string, size_t __maxlen);
 __STRING_INLINE size_t
@@ -1151,6 +1153,8 @@ __strsep_g (char **__s, __const char *__reject)
 
 #endif /* Use misc. or use GNU.  */
 
-#undef __STRING_INLINE
+#ifndef _FORCE_INLINES
+# undef __STRING_INLINE
+#endif
 
 #endif /* No string inlines.  */
diff --git a/string/string-inlines.c b/string/string-inlines.c
new file mode 100644
index 0000000000..6406ba357f
--- /dev/null
+++ b/string/string-inlines.c
@@ -0,0 +1,28 @@
+/* Copyright (C) 1999 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+/*  <bits/string.h> and <bits/string2.h> declare some extern inline
+    functions.  These functions are declared additionally here if
+    inlining is not possible.  */
+
+#define __USE_STRING_INLINES
+#define _FORCE_INLINES
+#define __STRING_INLINE /* empty */
+
+#include <string.h>
+