add GET_LAST_ERROR macro
[mech_eap.orig] / mech_eap / util.h
index 6fd31d7..5f0bc9d 100644 (file)
@@ -776,6 +776,8 @@ verifyTokenHeader(OM_uint32 *minor,
 
 #include <winbase.h>
 
+#define GSSEAP_GET_LAST_ERROR()                (GetLastError())
+
 #define GSSEAP_MUTEX                    CRITICAL_SECTION
 
 #define GSSEAP_MUTEX_INIT(m)            (InitializeCriticalSection((m)), 0)
@@ -785,10 +787,16 @@ verifyTokenHeader(OM_uint32 *minor,
 
 /* XXX yet to implement thread-local wrappers */
 
+#define GSSEAP_THREAD_ONCE              INIT_ONCE
+#define GSSEAP_ONCE(o, i)               InitOnceExecuteOnce((o), (i))
+#define GSSEAP_ONCE_INITIALIZER         INIT_ONCE_STATIC_INIT
+
 #else
 
 #include <pthread.h>
 
+#define GSSEAP_GET_LAST_ERROR()                (errno)
+
 #define GSSEAP_MUTEX                    pthread_mutex_t
 
 #define GSSEAP_MUTEX_INIT(m)            pthread_mutex_init((m), NULL)