From 94dd438a76a104814bde8b53317e5987eb071a75 Mon Sep 17 00:00:00 2001 From: Luke Howard Date: Thu, 15 Sep 2011 01:23:42 +1000 Subject: [PATCH] Windows acceptor build fixes Windows will require C++ clean FreeRADIUS headers another Windows acceptor-side fix Conflicts: moonshot/mech_eap/util.h --- libradsec | 2 +- moonshot/mech_eap/gssapiP_eap.h | 4 ++++ moonshot/mech_eap/util.h | 10 +++++++--- moonshot/mech_eap/util_attr.cpp | 5 +++-- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/libradsec b/libradsec index ade6c4f..484c9a4 160000 --- a/libradsec +++ b/libradsec @@ -1 +1 @@ -Subproject commit ade6c4fa17f837504a3902296d4b4f636e28b51e +Subproject commit 484c9a475f12fc615d70df4420ccbc7e9a693f5f diff --git a/moonshot/mech_eap/gssapiP_eap.h b/moonshot/mech_eap/gssapiP_eap.h index fb6d73e..b2271d8 100644 --- a/moonshot/mech_eap/gssapiP_eap.h +++ b/moonshot/mech_eap/gssapiP_eap.h @@ -93,8 +93,10 @@ typedef const gss_OID_desc *gss_const_OID; /* FreeRADIUS headers */ #ifdef __cplusplus extern "C" { +#ifndef WIN32 #define operator fr_operator #endif +#endif #include #include @@ -104,7 +106,9 @@ extern "C" { #include #include #ifdef __cplusplus +#ifndef WIN32 #undef operator +#endif } #endif #endif /* GSSEAP_ENABLE_ACCEPTOR */ diff --git a/moonshot/mech_eap/util.h b/moonshot/mech_eap/util.h index ae83923..1ebc452 100644 --- a/moonshot/mech_eap/util.h +++ b/moonshot/mech_eap/util.h @@ -776,25 +776,27 @@ verifyTokenHeader(OM_uint32 *minor, #include -#define GSSEAP_GET_LAST_ERROR() (GetLastError()) +#define GSSEAP_GET_LAST_ERROR() (GetLastError()) /* XXX FIXME */ #define GSSEAP_MUTEX CRITICAL_SECTION #define GSSEAP_MUTEX_INIT(m) (InitializeCriticalSection((m)), 0) #define GSSEAP_MUTEX_DESTROY(m) DeleteCriticalSection((m)) #define GSSEAP_MUTEX_LOCK(m) EnterCriticalSection((m)) #define GSSEAP_MUTEX_UNLOCK(m) LeaveCriticalSection((m)) +#define GSSEAP_ONCE_LEAVE do { return TRUE; } while (0) /* Thread-local is handled separately */ #define GSSEAP_THREAD_ONCE INIT_ONCE -#define GSSEAP_ONCE(o, i) InitOnceExecuteOnce((o), (i)) +#define GSSEAP_ONCE_CALLBACK(cb) BOOL CALLBACK cb(PINIT_ONCE InitOnce, PVOID Parameter, PVOID *Context) +#define GSSEAP_ONCE(o, i) InitOnceExecuteOnce((o), (i), NULL, NULL) #define GSSEAP_ONCE_INITIALIZER INIT_ONCE_STATIC_INIT #else #include -#define GSSEAP_GET_LAST_ERROR() (errno) +#define GSSEAP_GET_LAST_ERROR() (errno) #define GSSEAP_MUTEX pthread_mutex_t #define GSSEAP_MUTEX_INIT(m) pthread_mutex_init((m), NULL) @@ -808,8 +810,10 @@ verifyTokenHeader(OM_uint32 *minor, #define GSSEAP_SETSPECIFIC(k, d) pthread_setspecific((k), (d)) #define GSSEAP_THREAD_ONCE pthread_once_t +#define GSSEAP_ONCE_CALLBACK(cb) void cb(void) #define GSSEAP_ONCE(o, i) pthread_once((o), (i)) #define GSSEAP_ONCE_INITIALIZER PTHREAD_ONCE_INIT +#define GSSEAP_ONCE_LEAVE do { } while (0) #endif /* WIN32 */ diff --git a/moonshot/mech_eap/util_attr.cpp b/moonshot/mech_eap/util_attr.cpp index 9496863..d24615d 100644 --- a/moonshot/mech_eap/util_attr.cpp +++ b/moonshot/mech_eap/util_attr.cpp @@ -46,8 +46,7 @@ static GSSEAP_THREAD_ONCE gssEapAttrProvidersInitOnce = GSSEAP_ONCE_INITIALIZER; static OM_uint32 gssEapAttrProvidersInitStatus = GSS_S_UNAVAILABLE; -static void -gssEapAttrProvidersInitInternal(void) +GSSEAP_ONCE_CALLBACK(gssEapAttrProvidersInitInternal) { OM_uint32 major, minor; @@ -74,6 +73,8 @@ cleanup: #endif gssEapAttrProvidersInitStatus = major; + + GSSEAP_ONCE_LEAVE; } static OM_uint32 -- 2.1.4