Skip to content

Commit 5fd03ec

Browse files
committed
Add some missing headers and defines to support visual studio
Visual studio compatibility changes.
1 parent 11561cd commit 5fd03ec

File tree

6 files changed

+27
-12
lines changed

6 files changed

+27
-12
lines changed

contrib/win32/win32compat/cng_digest.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@
3636
typedef unsigned int u_int;
3737
typedef unsigned char u_char;
3838

39+
#ifndef __MINGW32__
40+
#define __attribute__(A)
41+
#ifndef define explicit_bzero
42+
#define explicit_bzero(p,l) memset((void *)(p),0,(size_t)(l))
43+
#endif
44+
#endif
3945

4046
#include <limits.h>
4147
#include <string.h>

contrib/win32/win32compat/homedirhelp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
2929
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3030
*/
31-
31+
#include <winsock2.h>
3232
#include <windows.h>
3333
#include <Lmcons.h>
3434
#include <Lm.h>

contrib/win32/win32compat/kerberos.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -166,38 +166,38 @@ void UninitMitKerberos()
166166
* KfW libs here.
167167
*/
168168

169-
KFW_CALL gss_indicate_mechs(OM_uint32 *a, gss_OID_set *b)
169+
OM_uint32 KRB5_CALLCONV gss_indicate_mechs(OM_uint32 *a, gss_OID_set *b)
170170
{
171171
return MitDispatch.gss_indicate_mechs(a, b);
172172
}
173173

174-
KFW_CALL gss_release_buffer(OM_uint32 *a, gss_buffer_t b)
174+
OM_uint32 KRB5_CALLCONV gss_release_buffer(OM_uint32 *a, gss_buffer_t b)
175175
{
176176
return MitDispatch.gss_release_buffer(a, b);
177177
}
178178

179-
KFW_CALL gss_display_status(OM_uint32 *a, OM_uint32 b, int c, gss_OID d,
179+
OM_uint32 KRB5_CALLCONV gss_display_status(OM_uint32 *a, OM_uint32 b, int c, gss_OID d,
180180
OM_uint32 *e, gss_buffer_t f)
181181
{
182182
return MitDispatch.gss_display_status(a, b, c, d, e, f);
183183
}
184184

185-
KFW_CALL gss_delete_sec_context(OM_uint32 *a, gss_ctx_id_t *b, gss_buffer_t c)
185+
OM_uint32 KRB5_CALLCONV gss_delete_sec_context(OM_uint32 *a, gss_ctx_id_t *b, gss_buffer_t c)
186186
{
187187
return MitDispatch.gss_delete_sec_context(a, b, c);
188188
}
189189

190-
KFW_CALL gss_release_name(OM_uint32 *a, gss_name_t *b)
190+
OM_uint32 KRB5_CALLCONV gss_release_name(OM_uint32 *a, gss_name_t *b)
191191
{
192192
return MitDispatch.gss_release_name(a, b);
193193
}
194194

195-
KFW_CALL gss_release_cred(OM_uint32 *a, gss_cred_id_t *b)
195+
OM_uint32 KRB5_CALLCONV gss_release_cred(OM_uint32 *a, gss_cred_id_t *b)
196196
{
197197
return MitDispatch.gss_release_cred(a, b);
198198
}
199199

200-
KFW_CALL gss_init_sec_context(OM_uint32 *a, gss_cred_id_t b,
200+
OM_uint32 KRB5_CALLCONV gss_init_sec_context(OM_uint32 *a, gss_cred_id_t b,
201201
gss_ctx_id_t *c, gss_name_t d,
202202
gss_OID e, OM_uint32 f,
203203
OM_uint32 g, gss_channel_bindings_t h,
@@ -208,12 +208,12 @@ KFW_CALL gss_init_sec_context(OM_uint32 *a, gss_cred_id_t b,
208208
return MitDispatch.gss_init_sec_context(a, b, c, d, e, f, g, h, i, j, k, l, m);
209209
}
210210

211-
KFW_CALL gss_import_name(OM_uint32 *a, gss_buffer_t b, gss_OID c, gss_name_t *d)
211+
OM_uint32 KRB5_CALLCONV gss_import_name(OM_uint32 *a, gss_buffer_t b, gss_OID c, gss_name_t *d)
212212
{
213213
return MitDispatch.gss_import_name(a, b, c, d);
214214
}
215215

216-
KFW_CALL gss_get_mic(OM_uint32 *a, gss_ctx_id_t b, gss_qop_t c,
216+
OM_uint32 KRB5_CALLCONV gss_get_mic(OM_uint32 *a, gss_ctx_id_t b, gss_qop_t c,
217217
gss_buffer_t d, gss_buffer_t e)
218218
{
219219
return MitDispatch.gss_get_mic(a, b, c, d, e);

contrib/win32/win32compat/lsalogon.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,18 @@
2929
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3030
*/
3131

32+
3233
#include "lsalogon.h"
3334
#include "Debug.h"
3435

3536
#include "includes.h"
3637
#include "log.h"
3738
#include "servconf.h"
3839

40+
41+
#define STATUS_LOGON_FAILURE ((NTSTATUS)0xC000006DL) // ntsubauth
42+
#define STATUS_NO_SUCH_PACKAGE ((NTSTATUS)0xC00000FEL)
43+
3944
extern ServerOptions options;
4045

4146
/*

contrib/win32/win32compat/win32auth.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,11 @@
4242
#include <AccCtrl.h>
4343
#include <Aclapi.h>
4444
#include "Debug.h"
45-
45+
#ifdef WIN32
46+
#define STATUS_OBJECT_NAME_NOT_FOUND ((NTSTATUS)0xC0000034L)
47+
#else
4648
#include <ddk/ntstatus.h>
49+
#endif
4750

4851
#ifdef __cplusplus
4952
extern "C" {

openbsd-compat/bsd-poll.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
#if !defined(HAVE_POLL)
2121

2222
#include <sys/types.h>
23-
#include <sys/time.h>
23+
/*#include <sys/time.h> */
24+
#include <time.h>
2425
#ifdef HAVE_SYS_SELECT_H
2526
# include <sys/select.h>
2627
#endif

0 commit comments

Comments
 (0)