From 7a8bb97527b57514a600dc8a091e2846dad9c4cd Mon Sep 17 00:00:00 2001 From: Tom Yu Date: Sat, 15 Jun 2002 00:37:58 +0000 Subject: [PATCH] * krb524.h: Updated C++ protection to not interfere with emacs auto indentation and added KRB524_PRIVATE macro for Mac OS X to control visibility of function prototypes * krb524.h: Added C++ protection and Mac pragmas * krb524.h, cnv_tkt_skey.c, conv_creds.c, conv_princ.c, encode.c, misc.c, sendmsg.c: Updated header paths on Mac OS X so that we correctly include the autogenerated krb524.h * conv_creds.c, cnv_tkt_skey.c: added cast to remove warning. * krb524.h: Updated to new Mac OS header layout. * sendmsg.c: k5-int.h should be included as a local header [pullups from 1-2-2-branch] git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14507 dc483132-0cff-0310-8789-dd5450dbe970 --- src/krb524/ChangeLog | 20 ++++++++++++++++ src/krb524/cnv_tkt_skey.c | 9 ++++++-- src/krb524/conv_creds.c | 8 +++++-- src/krb524/conv_princ.c | 5 ++++ src/krb524/encode.c | 6 ++++- src/krb524/krb524.h | 48 +++++++++++++++++++++++++++++++++++++-- src/krb524/sendmsg.c | 5 ++++ 7 files changed, 94 insertions(+), 7 deletions(-) diff --git a/src/krb524/ChangeLog b/src/krb524/ChangeLog index 02109c0b4..4fa5f572f 100644 --- a/src/krb524/ChangeLog +++ b/src/krb524/ChangeLog @@ -1,3 +1,23 @@ +2002-06-14 Alexandra Ellwood + + * krb524.h: Updated C++ protection to not interfere with emacs + auto indentation and added KRB524_PRIVATE macro for Mac OS X to + control visibility of function prototypes + + * krb524.h: Added C++ protection and Mac pragmas + + * krb524.h, cnv_tkt_skey.c, conv_creds.c, conv_princ.c, encode.c, + misc.c, sendmsg.c: Updated header paths on Mac OS X so that we + correctly include the autogenerated krb524.h + + * conv_creds.c, cnv_tkt_skey.c: added cast to remove warning. + + * krb524.h: Updated to new Mac OS header layout. + + * sendmsg.c: k5-int.h should be included as a local header + + [pullups from 1-2-2-branch] + 2002-06-13 Ken Raeburn * Makefile.in (WINLIBS): Use ws2_32.lib instead of wsock32.lib. diff --git a/src/krb524/cnv_tkt_skey.c b/src/krb524/cnv_tkt_skey.c index 00452eeea..f34ea6f44 100644 --- a/src/krb524/cnv_tkt_skey.c +++ b/src/krb524/cnv_tkt_skey.c @@ -30,9 +30,14 @@ #include #include #endif - +#if TARGET_OS_MAC +#include +#include +#include "cr_tkt.h" +#else #include #include "krb524.h" +#endif static int krb524int_krb_create_ticket(KTEXT, unsigned int, char *, char *, char *, long, @@ -109,7 +114,7 @@ int krb524_convert_tkt_skey(context, v5tkt, v4tkt, v5_skey, v4_skey, fprintf(stderr, "v5 session keyblock type %d length %d != C_Block size %d\n", v5etkt->session->enctype, v5etkt->session->length, - sizeof(C_Block)); + (int) sizeof(C_Block)); krb5_free_enc_tkt_part(context, v5etkt); v5tkt->enc_part2 = NULL; return KRB524_BADKEY; diff --git a/src/krb524/conv_creds.c b/src/krb524/conv_creds.c index 582733ebe..01e91bb44 100644 --- a/src/krb524/conv_creds.c +++ b/src/krb524/conv_creds.c @@ -29,9 +29,13 @@ #else #include #endif +#if TARGET_OS_MAC +#include +#include +#else #include - #include "krb524.h" +#endif krb5_error_code krb524_convert_creds_plain (krb5_context context, krb5_creds *v5creds, @@ -99,7 +103,7 @@ krb524_convert_creds_plain(context, v5creds, v4creds) if (krb524_debug) fprintf(stderr, "v5 session keyblock length %d != C_Block size %d\n", v5creds->keyblock.length, - sizeof(C_Block)); + (int) sizeof(C_Block)); return KRB524_BADKEY; } else memcpy(v4creds->session, (char *) v5creds->keyblock.contents, diff --git a/src/krb524/conv_princ.c b/src/krb524/conv_princ.c index f52c0dd13..83447317a 100644 --- a/src/krb524/conv_princ.c +++ b/src/krb524/conv_princ.c @@ -21,8 +21,13 @@ */ #include "krb5.h" +#if TARGET_OS_MAC +#include +#include +#else #include #include "krb524.h" +#endif int krb524_convert_princs(context, client, server, pname, pinst, prealm, sname, sinst, srealm) diff --git a/src/krb524/encode.c b/src/krb524/encode.c index 448efd993..c20c2281b 100644 --- a/src/krb524/encode.c +++ b/src/krb524/encode.c @@ -34,9 +34,13 @@ #include #endif - +#if TARGET_OS_MAC +#include +#include +#else #include #include "krb524.h" +#endif /* * I'm sure that this is reinventing the wheel, but I don't know where diff --git a/src/krb524/krb524.h b/src/krb524/krb524.h index cf9d62e82..4c6a07eac 100644 --- a/src/krb524/krb524.h +++ b/src/krb524/krb524.h @@ -26,8 +26,39 @@ #define KRB524_SERVICE "krb524" #define KRB524_PORT 4444 -#include "krb524_err.h" - +#if defined(macintosh) || (defined(__MACH__) && defined(__APPLE__)) + #include + #include + #include + #ifndef KRB524_PRIVATE /* Allow e.g. build system to override */ + #define KRB524_PRIVATE 0 + #endif +#else + #include "krb524_err.h" + #ifndef KRB524_PRIVATE + #define KRB524_PRIVATE 1 + #endif +#endif + +#if defined(__cplusplus) && !defined(KRB524INT_BEGIN_DECLS) +#define KRB524INT_BEGIN_DECLS extern "C" { +#define KRB524INT_END_DECLS } +#else +#define KRB524INT_BEGIN_DECLS +#define KRB524INT_END_DECLS +#endif + +#if TARGET_OS_MAC + #if defined(__MWERKS__) + #pragma import on + #pragma enumsalwaysint on + #endif + #pragma options align=mac68k +#endif + +KRB524INT_BEGIN_DECLS + +#if KRB524_PRIVATE extern int krb524_debug; int krb524_convert_tkt_skey @@ -47,11 +78,13 @@ int krb524_convert_princs int krb524_convert_creds_addr (krb5_context context, krb5_creds *v5creds, CREDENTIALS *v4creds, struct sockaddr *saddr); +#endif /* KRB524_PRIVATE */ int krb524_convert_creds_kdc (krb5_context context, krb5_creds *v5creds, CREDENTIALS *v4creds); +#if KRB524_PRIVATE /* conv_tkt.c */ int krb524_convert_tkt @@ -77,5 +110,16 @@ void krb524_init_ets int krb524_sendto_kdc (krb5_context context, const krb5_data * message, const krb5_data * realm, krb5_data * reply); +#endif /* KRB524_PRIVATE */ + +#if TARGET_OS_MAC + #if defined(__MWERKS__) + #pragma enumsalwaysint reset + #pragma import reset + #endif + #pragma options align=reset +#endif + +KRB524INT_END_DECLS #endif /* __KRB524_H__ */ diff --git a/src/krb524/sendmsg.c b/src/krb524/sendmsg.c index aac8f915e..ef6e996dc 100644 --- a/src/krb524/sendmsg.c +++ b/src/krb524/sendmsg.c @@ -39,8 +39,13 @@ #include #include +#if TARGET_OS_MAC +#include +#include +#else #include #include "krb524.h" +#endif /* * krb524_sendto_kdc: -- 2.26.2