OSSP CVS Repository

ossp - Check-in [2511]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 2511
Date: 2002-Aug-14 15:34:01 (local)
2002-Aug-14 13:34:01 (UTC)
User:rse
Branch:
Comment: fix tai_op() and add support for gmtime_r under Solaris
Tickets:
Inspections:
Files:
ossp-pkg/tai/tai.ac      1.1 -> 1.2     1 inserted, 0 deleted
ossp-pkg/tai/tai_lib.c      1.5 -> 1.6     7 inserted, 6 deleted

ossp-pkg/tai/tai.ac 1.1 -> 1.2

--- tai.ac       2002/04/18 09:10:46     1.1
+++ tai.ac       2002/08/14 13:34:01     1.2
@@ -34,6 +34,7 @@
 
 AC_DEFUN(TAI_CHECK_ALL,[
     #   check for system functions
+    CFLAGS="$CFLAGS -D_REENTRANT"
     AC_CHECK_FUNCS(gmtime_r timegm)
 ])
 


ossp-pkg/tai/tai_lib.c 1.5 -> 1.6

--- tai_lib.c    2002/05/29 08:32:53     1.5
+++ tai_lib.c    2002/08/14 13:34:01     1.6
@@ -254,12 +254,13 @@
         s1 = tai1->tai_sec + (60 * tai1->tai_min) + (60 * 60 * tai1->tai_hour) + (60 * 60 * 24 * tai1->tai_yday) + (60 * 60 * 24 * 365 * tai1->tai_year) + tai1->tai_gmtoff;
         s2 = tai2->tai_sec + (60 * tai2->tai_min) + (60 * 60 * tai2->tai_hour) + (60 * 60 * 24 * tai2->tai_yday) + (60 * 60 * 24 * 365 * tai2->tai_year) + tai2->tai_gmtoff;
         switch (op) {
-            case TAI_OP_NE: rc = s2 != s1 ? TAI_OK: TAI_FALSE;
-            case TAI_OP_EQ: rc = s2 == s1 ? TAI_OK: TAI_FALSE;
-            case TAI_OP_LT: rc = s2 <  s1 ? TAI_OK: TAI_FALSE;
-            case TAI_OP_LE: rc = s2 <= s1 ? TAI_OK: TAI_FALSE;
-            case TAI_OP_GT: rc = s2 >  s1 ? TAI_OK: TAI_FALSE;
-            case TAI_OP_GE: rc = s2 >= s1 ? TAI_OK: TAI_FALSE;
+            case TAI_OP_NE: rc = (s2 != s1 ? TAI_OK : TAI_FALSE); break;
+            case TAI_OP_EQ: rc = (s2 == s1 ? TAI_OK : TAI_FALSE); break;
+            case TAI_OP_LT: rc = (s2 <  s1 ? TAI_OK : TAI_FALSE); break;
+            case TAI_OP_LE: rc = (s2 <= s1 ? TAI_OK : TAI_FALSE); break;
+            case TAI_OP_GT: rc = (s2 >  s1 ? TAI_OK : TAI_FALSE); break;
+            case TAI_OP_GE: rc = (s2 >= s1 ? TAI_OK : TAI_FALSE); break;
+            default: break; /* FIXME */
         }
     }
     va_end(ap); 

CVSTrac 2.0.1