about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2001-04-11 05:42:12 +0000
committerUlrich Drepper <drepper@redhat.com>2001-04-11 05:42:12 +0000
commitb982085b4d1b5611521ffdf3f331ad0a2d4161a0 (patch)
treeccf15d434dcdc1cf53bb63d961b4e5d23d5fd5d1
parent28966366a22c307ffc7c56721c8ed6da3cdc7768 (diff)
downloadglibc-b982085b4d1b5611521ffdf3f331ad0a2d4161a0.tar.gz
glibc-b982085b4d1b5611521ffdf3f331ad0a2d4161a0.tar.xz
glibc-b982085b4d1b5611521ffdf3f331ad0a2d4161a0.zip
If we compile RPC thread safe, allow rpcgen to generate thread safe code.
-rw-r--r--locale/tst-C-locale.c42
-rw-r--r--sunrpc/rpc_main.c2
2 files changed, 44 insertions, 0 deletions
diff --git a/locale/tst-C-locale.c b/locale/tst-C-locale.c
index 257ee3b347..7bafcc58b7 100644
--- a/locale/tst-C-locale.c
+++ b/locale/tst-C-locale.c
@@ -24,6 +24,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <wchar.h>
+#include <wctype.h>
 
 
 static int
@@ -386,6 +387,7 @@ run_test (const char *locname)
 	  CLASSTEST (upper);
 	  CLASSTEST (xdigit);
 
+	  /* Character mapping tests.  */
 #define MAPTEST(name) \
 	  if (to##name (c) != __to##name##_l (c, loc))			      \
 	    {								      \
@@ -398,6 +400,46 @@ run_test (const char *locname)
 	  MAPTEST (upper);
 	}
 
+      /* Character class tests, this time for wide characters.  Note that
+	 this only works because we know that the internal encoding is
+	 UCS4.  */
+      for (c = 0; c < 128; ++c)
+	{
+#define CLASSTEST(name) \
+	  if (isw##name (c) != __isw##name##_l (c, loc))		      \
+	    {								      \
+	      printf ("isw%s('\\%o') != __isw%s_l('\\%o')\n",		      \
+		      #name, c, #name, c);				      \
+	      result = 1;						      \
+	    }
+	  CLASSTEST (alnum);
+	  CLASSTEST (alpha);
+	  CLASSTEST (blank);
+	  CLASSTEST (cntrl);
+	  CLASSTEST (digit);
+	  CLASSTEST (lower);
+	  CLASSTEST (graph);
+	  CLASSTEST (print);
+	  CLASSTEST (punct);
+	  CLASSTEST (space);
+	  CLASSTEST (upper);
+	  CLASSTEST (xdigit);
+
+	  /* Character mapping tests.  Note that
+	     this only works because we know that the internal encoding is
+	     UCS4.  */
+#define MAPTEST(name) \
+	  if (tow##name (c) != __tow##name##_l (c, loc))		      \
+	    {								      \
+	      printf ("tow%s('\\%o') != __tow%s_l('\\%o'): '\\%o' vs '\\%o'\n",\
+		      #name, c, #name, c,				      \
+		      tow##name (c), __tow##name##_l (c, loc));		      \
+	      result = 1;						      \
+	    }
+	  MAPTEST (lower);
+	  MAPTEST (upper);
+	}
+
       __freelocale (loc);
     }
 
diff --git a/sunrpc/rpc_main.c b/sunrpc/rpc_main.c
index d43b69d8bc..fb5f5f811f 100644
--- a/sunrpc/rpc_main.c
+++ b/sunrpc/rpc_main.c
@@ -1357,6 +1357,7 @@ parseargs (int argc, const char *argv[], struct commandline *cmd)
   cmd->Scflag = flag['C'];
   cmd->makefileflag = flag['M'];
 
+#ifndef _RPC_THREAD_SAFE_
   if (mtflag || newstyle)
     {
       /* glibc doesn't support these flags.  */
@@ -1364,6 +1365,7 @@ parseargs (int argc, const char *argv[], struct commandline *cmd)
 	       _("This implementation doesn't support newstyle or MT-safe code!\n"));
       return (0);
     }
+#endif
   if (tirpcflag)
     {
       pmflag = inetdflag ? 0 : 1;    /* pmflag or inetdflag is always TRUE */