aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorJeffrey Altman <jaltman@secure-endpoints.com>2005-11-15 00:16:17 +0000
committerJeffrey Altman <jaltman@secure-endpoints.com>2005-11-15 00:16:17 +0000
commite9f59ca61ff224908576959a2cf394b63d05c462 (patch)
tree4647cb42e407e4e8935c9d7ef8aed17a8ec1140a /src/include
parentafe2c8a8eb1f6c66796b78f127ab03a12dc84e90 (diff)
downloadkrb5-e9f59ca61ff224908576959a2cf394b63d05c462.zip
krb5-e9f59ca61ff224908576959a2cf394b63d05c462.tar.gz
krb5-e9f59ca61ff224908576959a2cf394b63d05c462.tar.bz2
* Correct function prototypes that should have been using
krb5_timestamp in order to prevent type conflicts if krb5_timestamp ever becomes a 64-bit value * Force the use of 32-bit time_t with Microsoft's VS 2005 compiler on 32-bit platforms * Test for inclusion of krb5.h before k5-int.h ticket: 2883 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17488 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/include')
-rw-r--r--src/include/ChangeLog19
-rw-r--r--src/include/k5-int.h4
-rw-r--r--src/include/krb5.hin12
-rw-r--r--src/include/win-mac.h35
4 files changed, 58 insertions, 12 deletions
diff --git a/src/include/ChangeLog b/src/include/ChangeLog
index 8861315..65db747 100644
--- a/src/include/ChangeLog
+++ b/src/include/ChangeLog
@@ -1,5 +1,24 @@
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
2005-07-01 Ken Raeburn <raeburn@mit.edu>
diff --git a/src/include/k5-int.h b/src/include/k5-int.h
index 7a3e8f9..3f8c60d 100644
--- a/src/include/k5-int.h
+++ b/src/include/k5-int.h
@@ -77,6 +77,10 @@
#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"
/*
diff --git a/src/include/krb5.hin b/src/include/krb5.hin
index ff17139..eaaedec 100644
--- a/src/include/krb5.hin
+++ b/src/include/krb5.hin
@@ -1802,11 +1802,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,
@@ -2275,19 +2275,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 */
diff --git a/src/include/win-mac.h b/src/include/win-mac.h
index 9ffb123..ea53cf1 100644
--- a/src/include/win-mac.h
+++ b/src/include/win-mac.h
@@ -33,8 +33,27 @@
#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
@@ -53,12 +72,16 @@
#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