From 71bc89ed452de3b5aa6356087280554e58ae4456 Mon Sep 17 00:00:00 2001 From: Kevin Koch Date: Tue, 22 Jan 2008 16:34:31 +0000 Subject: [PATCH] Make windows debug message line endings match the Mac endings. Windows needs k5-platform helper function declared explicitly. Change definition of ccs_pipe_t for windows. #define strdup -- it's now deprecated on windows. TargetVersion: 1.7 Component: krb5-libs Ticket: 5594 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20201 dc483132-0cff-0310-8789-dd5450dbe970 --- src/ccapi/common/cci_debugging.c | 12 +++++++++--- src/ccapi/lib/ccapi_context.c | 6 ++++++ src/ccapi/lib/ccapi_context.h | 5 +++++ src/ccapi/server/ccs_types.h | 8 +++++--- src/include/win-mac.h | 5 +++++ 5 files changed, 30 insertions(+), 6 deletions(-) diff --git a/src/ccapi/common/cci_debugging.c b/src/ccapi/common/cci_debugging.c index 4545b402e..e35926117 100644 --- a/src/ccapi/common/cci_debugging.c +++ b/src/ccapi/common/cci_debugging.c @@ -1,7 +1,7 @@ /* * $Header$ * - * Copyright 2006 Massachusetts Institute of Technology. + * Copyright 2007, 2008 Massachusetts Institute of Technology. * All Rights Reserved. * * Export of this software from the United States of America may @@ -27,6 +27,12 @@ #include "cci_common.h" #include "cci_os_debugging.h" +#ifdef WIN32 +char* eol = "\n"; +#else +char* eol = ""; +#endif + /* ------------------------------------------------------------------------ */ cc_int32 _cci_check_error (cc_int32 in_error, @@ -36,8 +42,8 @@ cc_int32 _cci_check_error (cc_int32 in_error, { /* Do not log for flow control errors or when there is no error at all */ if (in_error != ccNoError && in_error != ccIteratorEnd) { - cci_debug_printf ("%s() got %d at %s: %d", in_function, - in_error, in_file, in_line); + cci_debug_printf ("%s() got %d at %s: %d%s", in_function, + in_error, in_file, in_line, eol); } return in_error; diff --git a/src/ccapi/lib/ccapi_context.c b/src/ccapi/lib/ccapi_context.c index 7a165cf98..6bcbd239a 100644 --- a/src/ccapi/lib/ccapi_context.c +++ b/src/ccapi/lib/ccapi_context.c @@ -81,6 +81,12 @@ static cc_int32 cci_context_sync (cci_context_t in_context, MAKE_INIT_FUNCTION(cci_thread_init); +#ifdef WIN32 +void cci_thread_init_helper() { + cci_thread_init__auxinit(); + } +#endif + /* ------------------------------------------------------------------------ */ static int cci_thread_init (void) diff --git a/src/ccapi/lib/ccapi_context.h b/src/ccapi/lib/ccapi_context.h index 4ac0b06c3..a9989a126 100644 --- a/src/ccapi/lib/ccapi_context.h +++ b/src/ccapi/lib/ccapi_context.h @@ -75,4 +75,9 @@ cc_int32 ccapi_context_compare (cc_context_t in_context, cc_context_t in_compare_to_context, cc_uint32 *out_equal); +#ifdef WIN32 +void cci_thread_init_helper(); +#endif + + #endif /* CCAPI_CONTEXT_H */ diff --git a/src/ccapi/server/ccs_types.h b/src/ccapi/server/ccs_types.h index 56056b99e..a1e65a251 100644 --- a/src/ccapi/server/ccs_types.h +++ b/src/ccapi/server/ccs_types.h @@ -57,9 +57,10 @@ typedef mach_port_t ccs_pipe_t; /* Mach IPC port */ #else #ifdef WIN32 -/* On Windows, a pipe is the name of the endpoint to which to send the reply: */ -typedef char* ccs_pipe_t; -#define CCS_PIPE_NULL (char*)NULL +/* On Windows, a pipe is s struct: */ +#include "ccs_win_pipe.h" +typedef struct ccs_win_pipe_t* ccs_pipe_t; +#define CCS_PIPE_NULL (ccs_pipe_t)NULL #else typedef int ccs_pipe_t; /* Unix domain socket */ @@ -67,6 +68,7 @@ typedef int ccs_pipe_t; /* Unix domain socket */ #endif #endif + #ifdef TARGET_OS_MAC #pragma mark - #endif diff --git a/src/include/win-mac.h b/src/include/win-mac.h index 923fe6045..f77cd2b41 100644 --- a/src/include/win-mac.h +++ b/src/include/win-mac.h @@ -200,6 +200,11 @@ typedef _W64 int ssize_t; #define strncasecmp strnicmp #endif +/* VS2005 has deprecated strdup */ +#ifndef strdup +#define strdup _strdup +#endif + HINSTANCE get_lib_instance(void); #define GETSOCKNAME_ARG2_TYPE struct sockaddr -- 2.26.2