pull up r17488 from trunk. This breaks the unix build; corrected by
authorTom Yu <tlyu@mit.edu>
Mon, 28 Nov 2005 21:51:13 +0000 (21:51 +0000)
committerTom Yu <tlyu@mit.edu>
Mon, 28 Nov 2005 21:51:13 +0000 (21:51 +0000)
ticket #3236.

ticket: 2883
version_fixed: 1.4.4

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/krb5-1-4@17502 dc483132-0cff-0310-8789-dd5450dbe970

src/include/ChangeLog
src/include/k5-int.h
src/include/krb5.hin
src/include/win-mac.h
src/lib/krb5/os/ChangeLog
src/lib/krb5/os/timeofday.c
src/lib/krb5/os/toffset.c
src/lib/krb5/os/ustime.c

index 6c62c9214b583e131b53b20a280e2820010d1cf4..053378315823fba7a6e8c9d838511194a6fe8b8c 100644 (file)
@@ -1,3 +1,22 @@
+2005-10-20  Jeffrey Altman <jaltman@mit.edu>
+
+       * win-mac.h: 
+          - Add definitions for int64_t and uint64_t
+         - Force the use of 32-bit time_t on 32-bit Windows
+          - Correct the definition of MAX_SIZE to use the value
+            of SIZE_MAX which is defined in limits.h
+          - Add check to ensure that 32-bit time_t is forced
+            only when k5-int.h has been loaded.
+        * k5-int.h:
+          - Add check to ensure that k5-int.h is loaded before
+            krb5.h
+        * krb5.hin:
+          - Modify prototypes of functions that take krb5_int32
+            when they are really passing krb5_timestamp values
+            krb5_us_timeofday, krb5_timeofday, krb5_set_real_time,
+            krb5_set_debugging_time, krb5_get_time_offsets,
+            krb5_set_time_offsets
+
 2005-10-20  Jeffrey Altman <jaltman@mit.edu>
 
        * win-mac.h: Add definitions for int32_t and uint32_t
index 8d2262ac9aebe49ead7730b7218fd3255bfbc424..dcb08d5dae82abc620b91fab7a0324053f6eda59 100644 (file)
 #ifndef _KRB5_INT_H
 #define _KRB5_INT_H
 
+#ifdef KRB5_GENERAL__
+#error krb5.h included before k5-int.h
+#endif /* KRB5_GENERAL__ */
+
 #include "osconf.h"
 
 /*
index 46f3a143d14b8147420bc9c8781de58db84eaa5e..5cd61364c499c4e77d478efea09a84035dcba676 100644 (file)
@@ -1792,11 +1792,11 @@ void KRB5_CALLCONV krb5_free_cksumtypes
 /* From krb5/os but needed but by the outside world */
 krb5_error_code KRB5_CALLCONV krb5_us_timeofday
        (krb5_context,
-               krb5_int32 *,
+               krb5_timestamp *,
                krb5_int32 * );
 krb5_error_code KRB5_CALLCONV krb5_timeofday
        (krb5_context,
-               krb5_int32 * );
+               krb5_timestamp * );
                 /* get all the addresses of this host */
 krb5_error_code KRB5_CALLCONV krb5_os_localaddr
        (krb5_context,
@@ -2265,19 +2265,19 @@ krb5_error_code krb5_make_fulladdr
 #endif
 
 krb5_error_code KRB5_CALLCONV krb5_set_real_time
-       (krb5_context, krb5_int32, krb5_int32);
+       (krb5_context, krb5_timestamp, krb5_int32);
 
 #if KRB5_PRIVATE
 krb5_error_code krb5_set_debugging_time
-       (krb5_context, krb5_int32, krb5_int32);
+       (krb5_context, krb5_timestamp, krb5_int32);
 krb5_error_code krb5_use_natural_time
        (krb5_context);
 #endif
 krb5_error_code KRB5_CALLCONV krb5_get_time_offsets
-       (krb5_context, krb5_int32 *, krb5_int32 *);
+       (krb5_context, krb5_timestamp *, krb5_int32 *);
 #if KRB5_PRIVATE
 krb5_error_code krb5_set_time_offsets
-       (krb5_context, krb5_int32, krb5_int32);
+       (krb5_context, krb5_timestamp, krb5_int32);
 #endif
 
 /* str_conv.c */
index ec39b528f3f044c8ead0a53da4eaa1ab8699ada3..53999bbcdcb939d1a0f7df27a0d56e83a1f3c58a 100644 (file)
 #include <limits.h>
 
 #ifndef SIZE_MAX    /* in case Microsoft defines max size of size_t */
+#ifdef  MAX_SIZE    /* Microsoft defines MAX_SIZE as max size of size_t */
+#define SIZE_MAX MAX_SIZE
+#else
 #define SIZE_MAX UINT_MAX
 #endif
+#endif
+
+/* To ensure backward compatibility of the ABI use 32-bit time_t on 
+ * 32-bit Windows. 
+ */
+#ifdef _KRB5_INT_H
+#ifdef KRB5_GENERAL__
+#error krb5.h included before k5-int.h
+#endif /* KRB5_GENERAL__ */
+#if _INTEGRAL_MAX_BITS >= 64 && _MSC_VER >= 1400 && !defined(_WIN64) && !defined(_USE_32BIT_TIME_T)
+#if defined(_TIME_T_DEFINED) || defined(_INC_IO) || defined(_INC_TIME) || defined(_INC_WCHAR)
+#error time_t has been defined as a 64-bit integer which is incompatible with Kerberos on this platform.
+#endif /* _TIME_T_DEFINED */
+#define _USE_32BIT_TIME_T
+#endif 
+#endif
 
 #ifndef KRB5_CALLCONV
 #  define KRB5_CALLCONV __stdcall
 #ifndef KRB5_SYSTYPES__
 #define KRB5_SYSTYPES__
 #include <sys/types.h>
-typedef unsigned long  u_long;      /* Not part of sys/types.h on the pc */
-typedef unsigned int   u_int;
-typedef unsigned short u_short;
-typedef unsigned char  u_char;
-typedef unsigned int    uint32_t;
-typedef int             int32_t;
+typedef unsigned long   u_long;      /* Not part of sys/types.h on the pc */
+typedef unsigned int    u_int;
+typedef unsigned short  u_short;
+typedef unsigned char   u_char;
+typedef unsigned int     uint32_t;
+typedef int              int32_t;
+#if _INTEGRAL_MAX_BITS >= 64
+typedef unsigned __int64 uint64_t;
+typedef __int64          int64_t;
+#endif
 #endif /* KRB5_SYSTYPES__ */
 
 #define MAXHOSTNAMELEN  512
index 690750cf10a449f197d75a52ae14d46c8901851a..2c4efaecde9e92d0542907512d3c6198f5f177d3 100644 (file)
@@ -1,3 +1,15 @@
+2005-11-14  Jeffrey Altman <jaltman@mit.edu>
+
+       * toffset.c:  (krb5_set_real_time, krb5_set_debugging_time, 
+                       krb5_get_time_offsets, krb5_set_time_offsets)
+        * timeofday.c:(krb5_timeofday)
+        * ustime.c:   (krb5_us_timeofday)
+
+        Change type of "seconds" parameter from krb5_int32 to krb5_timestamp
+        This does not alter the ABI on existing platforms but will provide
+        consistency when we need to consider changing krb5_timestamp to a
+        64-bit value.
+
 2005-09-16  Tom Yu  <tlyu@mit.edu>
 
        * dnsglue.c (USE_RES_NINIT): Fix braino: define to 1, not empty
index 55dfe9b78e6ba6510f01af3feb65625b0803fcba..dcc75f56648282a6e1b1e30dcdcbf5ecbe3fee22 100644 (file)
@@ -33,7 +33,7 @@
 #include <time.h>
 
 krb5_error_code KRB5_CALLCONV
-krb5_timeofday(krb5_context context, register krb5_int32 *timeret)
+krb5_timeofday(krb5_context context, register krb5_timestamp *timeret)
 {
     krb5_os_context os_ctx = context->os_context;
     time_t tval;
index 4578f822af016c2ec8560d6a43cec20d76c826be..967b9d62be2aa2012fa72879eb0413d2b9795107 100644 (file)
@@ -36,7 +36,7 @@
  * routine
  */
 krb5_error_code KRB5_CALLCONV
-krb5_set_real_time(krb5_context context, krb5_int32 seconds, krb5_int32 microseconds)
+krb5_set_real_time(krb5_context context, krb5_timestamp seconds, krb5_int32 microseconds)
 {
     krb5_os_context os_ctx = context->os_context;
     krb5_int32 sec, usec;
@@ -58,7 +58,7 @@ krb5_set_real_time(krb5_context context, krb5_int32 seconds, krb5_int32 microsec
  * is useful for running the krb5 routines through test suites
  */
 krb5_error_code 
-krb5_set_debugging_time(krb5_context context, krb5_int32 seconds, krb5_int32 microseconds)
+krb5_set_debugging_time(krb5_context context, krb5_timestamp seconds, krb5_int32 microseconds)
 {
     krb5_os_context os_ctx = context->os_context;
 
@@ -87,7 +87,7 @@ krb5_use_natural_time(krb5_context context)
  * This routine returns the current time offsets in use.
  */
 krb5_error_code KRB5_CALLCONV
-krb5_get_time_offsets(krb5_context context, krb5_int32 *seconds, krb5_int32 *microseconds)
+krb5_get_time_offsets(krb5_context context, krb5_timestamp *seconds, krb5_int32 *microseconds)
 {
     krb5_os_context os_ctx = context->os_context;
 
@@ -103,7 +103,7 @@ krb5_get_time_offsets(krb5_context context, krb5_int32 *seconds, krb5_int32 *mic
  * This routine sets the time offsets directly.
  */
 krb5_error_code 
-krb5_set_time_offsets(krb5_context context, krb5_int32 seconds, krb5_int32 microseconds)
+krb5_set_time_offsets(krb5_context context, krb5_timestamp seconds, krb5_int32 microseconds)
 {
     krb5_os_context os_ctx = context->os_context;
 
index 65e92a04343e794e73672b6fe1bbaef6abf9dad5..ef923d387c2f77a5ce18cdd56c6c08c4bf76e689 100644 (file)
@@ -34,7 +34,7 @@
 #include "k5-int.h"
 
 krb5_error_code KRB5_CALLCONV
-krb5_us_timeofday(krb5_context context, krb5_int32 *seconds, krb5_int32 *microseconds)
+krb5_us_timeofday(krb5_context context, krb5_timestamp *seconds, krb5_int32 *microseconds)
 {
     krb5_os_context os_ctx = context->os_context;
     krb5_int32 sec, usec;