[PATCH] 'not' in include/time.h

Boris Kolpackov boris@kolpackov.net
Mon Mar 29 23:10:00 GMT 2004


Good day,

File include/time.h defines enum ptime_locale_status with one
of the enumerators named 'not'. Unfortunately 'not' is a c++
keyword so time.h is not valid c++. I realize that this file
is internal to glibc and strictly speaking has nothing to do
with c++ but some of us (notably me) do strange things and
would like to be able to compile some internals of glibc with 
c++ compiler. 

If it is not too much to ask, I attached a patch that changes 
'not' to 'neither' in all related files (just three of them).
I realize that 'no' would perhaps be a better substitution but
unfortunately it would conflict with sysdeps/pthread/aio_misc.h. 

thanks,
-boris
-------------- next part --------------
diff -u -b -B --minimal -r glibc-orig/include/time.h glibc-new/include/time.h
--- glibc-orig/include/time.h	Mon Mar 29 16:44:24 2004
+++ glibc-new/include/time.h	Mon Mar 29 16:08:07 2004
@@ -84,10 +84,9 @@
 /* Determine CLK_TCK value.  */
 extern int __getclktck (void);
 
-
 /* strptime support.  */
 /* Status of lookup: do we use the locale data or the raw data?  */
-enum ptime_locale_status { not, loc, raw };
+enum ptime_locale_status { neither, loc, raw };
 
 extern char * __strptime_internal (const char *rp, const char *fmt,
 				   struct tm *tm,
diff -u -b -B --minimal -r glibc-orig/time/strptime.c glibc-new/time/strptime.c
--- glibc-orig/time/strptime.c	Mon Mar 29 16:44:05 2004
+++ glibc-new/time/strptime.c	Mon Mar 29 16:08:28 2004
@@ -33,7 +33,7 @@
      const char *format;
      struct tm *tm;
 {
-  enum ptime_locale_status decided = not;
+  enum ptime_locale_status decided = neither;
   return __strptime_internal (buf, format, tm, &decided, -1,
 			      _NL_CURRENT_LOCALE);
 }
diff -u -b -B --minimal -r glibc-orig/time/strptime_l.c glibc-new/time/strptime_l.c
--- glibc-orig/time/strptime_l.c	Mon Mar 29 16:44:05 2004
+++ glibc-new/time/strptime_l.c	Mon Mar 29 16:09:48 2004
@@ -330,7 +330,7 @@
 		{
 		  if (match_string (_NL_CURRENT (LC_TIME, DAY_1 + cnt), rp))
 		    {
-		      if (*decided == not
+		      if (*decided == neither
 			  && strcmp (_NL_CURRENT (LC_TIME, DAY_1 + cnt),
 				     weekday_name[cnt]))
 			*decided = loc;
@@ -338,7 +338,7 @@
 		    }
 		  if (match_string (_NL_CURRENT (LC_TIME, ABDAY_1 + cnt), rp))
 		    {
-		      if (*decided == not
+		      if (*decided == neither
 			  && strcmp (_NL_CURRENT (LC_TIME, ABDAY_1 + cnt),
 				     ab_weekday_name[cnt]))
 			*decided = loc;
@@ -371,7 +371,7 @@
 		{
 		  if (match_string (_NL_CURRENT (LC_TIME, MON_1 + cnt), rp))
 		    {
-		      if (*decided == not
+		      if (*decided == neither
 			  && strcmp (_NL_CURRENT (LC_TIME, MON_1 + cnt),
 				     month_name[cnt]))
 			*decided = loc;
@@ -379,7 +379,7 @@
 		    }
 		  if (match_string (_NL_CURRENT (LC_TIME, ABMON_1 + cnt), rp))
 		    {
-		      if (*decided == not
+		      if (*decided == neither
 			  && strcmp (_NL_CURRENT (LC_TIME, ABMON_1 + cnt),
 				     ab_month_name[cnt]))
 			*decided = loc;
@@ -414,7 +414,7 @@
 		}
 	      else
 		{
-		  if (*decided == not &&
+		  if (*decided == neither &&
 		      strcmp (_NL_CURRENT (LC_TIME, D_T_FMT), HERE_D_T_FMT))
 		    *decided = loc;
 		  want_xday = 1;
@@ -460,7 +460,7 @@
 		}
 	      else
 		{
-		  if (*decided == not
+		  if (*decided == neither
 		      && strcmp (_NL_CURRENT (LC_TIME, D_FMT), HERE_D_FMT))
 		    *decided = loc;
 		  want_xday = 1;
@@ -555,7 +555,7 @@
 		}
 	      else
 		{
-		  if (*decided == not &&
+		  if (*decided == neither &&
 		      strcmp (_NL_CURRENT (LC_TIME, T_FMT_AMPM),
 			      HERE_T_FMT_AMPM))
 		    *decided = loc;
@@ -1056,7 +1056,7 @@
   enum ptime_locale_status decided;
 
 #ifdef _NL_CURRENT
-  decided = not;
+  decided = neither;
 #else
   decided = raw;
 #endif
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 652 bytes
Desc: Digital signature
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20040329/ca310ff7/attachment.sig>


More information about the Libc-alpha mailing list