+2002-05-24 Ken Raeburn <raeburn@mit.edu>
+
+ Reduce build-time per-system dependencies and krb5.h namespace
+ intrusions:
+ * krb5.hin: Don't include profile.h. Do include limits.h.
+ (krb5_int16, krb5_ui_2, krb5_int32, krb5_ui_4): Conditionalize on
+ the values of INT_MAX, LONG_MAX and SHRT_MAX.
+ (VALID_INT_BITS, VALID_UINT_BITS, SALT_TYPE_AFS_LENGTH,
+ SALT_TYPE_NO_LENGTH): Define in terms of INT_MAX and UINT_MAX.
+ (struct _profile_t): Declare forward.
+ (krb5_get_profile): Use struct _profile_t instead of profile_t in
+ declaration.
+ (krb5_ui_1): Delete.
+ * Makefile.in (krb5.h): Don't put SIZEOF macros into output.
+
2002-04-25 Ken Raeburn <raeburn@mit.edu>
* fake-addrinfo.h (GET_HOST_BY_NAME, GET_HOST_BY_ADDR)
krb5.h: krb5/autoconf.h $(srcdir)/krb5.hin krb5_err.h kdb5_err.h kv5m_err.h \
asn1_err.h
- echo "/* This is the prologue to krb5.h */" > krb5.h
- echo "/* Unfortunately some of these defines are compiler dependent */" >> krb5.h
+ echo "/* This file is generated, please don't edit it directly. */" > krb5.h
grep SIZEOF krb5/autoconf.h >> krb5.h
- echo "/* End of prologue section */" >> krb5.h
cat $(srcdir)/krb5.hin krb5_err.h kdb5_err.h kv5m_err.h \
asn1_err.h >> krb5.h
#endif
#endif
-#if defined(_WIN32) || defined(macintosh)
-#include <win-mac.h>
-#endif
-
#ifndef KRB5_CONFIG__
#ifndef KRB5_CALLCONV
#define KRB5_CALLCONV
#define KRB5_OLD_CRYPTO
#include <stdlib.h>
-
-/*
- * begin "error_def.h"
- */
-
-#include <profile.h>
-
-/*
- * end "error_def.h"
- */
+#include <limits.h> /* for *_MAX */
#if defined(__cplusplus) && !defined(KRB5INT_BEGIN_DECLS)
#define KRB5INT_BEGIN_DECLS extern "C" {
KRB5INT_BEGIN_DECLS
+/* from profile.h */
+struct _profile_t;
+/* typedef struct _profile_t *profile_t; */
+
/*
* begin wordsize.h
*/
*/
typedef unsigned char krb5_octet;
-typedef unsigned char krb5_ui_1;
-#if (SIZEOF_INT == 2)
+#if INT_MAX == 0x7fff
typedef int krb5_int16;
typedef unsigned int krb5_ui_2;
-#define VALID_INT_BITS 0x7fff
-#define VALID_UINT_BITS 0xffff
-#elif (SIZEOF_SHORT == 2)
+#elif SHRT_MAX == 0x7fff
typedef short krb5_int16;
typedef unsigned short krb5_ui_2;
#else
- ?==error: undefined 16 bit type
+#error undefined 16 bit type
#endif
-#if (SIZEOF_INT == 4)
+#if INT_MAX == 0x7fffffffL
typedef int krb5_int32;
typedef unsigned int krb5_ui_4;
-#define VALID_INT_BITS 0x7fffffff
-#define VALID_UINT_BITS 0xffffffff
-#elif (SIZEOF_LONG == 4)
+#elif LONG_MAX == 0x7fffffffL
typedef long krb5_int32;
typedef unsigned long krb5_ui_4;
-#elif (SIZEOF_SHORT == 4)
+#elif SHRT_MAX == 0x7fffffffL
typedef short krb5_int32;
typedef unsigned short krb5_ui_4;
#else
- ?== error: undefined 32 bit type
+#error: undefined 32 bit type
#endif
+#define VALID_INT_BITS INT_MAX
+#define VALID_UINT_BITS UINT_MAX
+
#define KRB5_INT32_MAX 2147483647
/* this strange form is necessary since - is a unary operator, not a sign
indicator */
* We also overload for an unset salt type length - which is also -1, but
* hey, why not....
*/
-#define SALT_TYPE_AFS_LENGTH VALID_UINT_BITS
-#define SALT_TYPE_NO_LENGTH VALID_UINT_BITS
+#define SALT_TYPE_AFS_LENGTH UINT_MAX
+#define SALT_TYPE_NO_LENGTH UINT_MAX
typedef void * krb5_pointer;
typedef void const * krb5_const_pointer;
krb5_error_code KRB5_CALLCONV
krb5_get_profile
- (krb5_context, profile_t *);
+ (krb5_context, struct _profile_t * /* profile_t */ *);
#if KRB5_PRIVATE
krb5_error_code krb5_send_tgs