Skip to content

Commit 62e24f1

Browse files
author
Daniel Kroening
authored
Merge pull request #2853 from diffblue/gethostbyname-windows
include correct header for hostent
2 parents 6f5d7c4 + 8be9671 commit 62e24f1

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/ansi-c/library/netdb.c

+13
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
/* FUNCTION: gethostbyname */
22

3+
#ifdef _MSC_VER
4+
#include <windows.h>
5+
#else
36
#include <netdb.h>
7+
#endif
48

59
__CPROVER_bool __VERIFIER_nondet___CPROVER_bool();
610

@@ -25,6 +29,12 @@ struct hostent *gethostbyname(const char *name)
2529

2630
/* FUNCTION: gethostbyaddr */
2731

32+
#ifdef _MSC_VER
33+
#include <windows.h>
34+
#else
35+
#include <netdb.h>
36+
#endif
37+
2838
__CPROVER_bool __VERIFIER_nondet___CPROVER_bool();
2939

3040
struct hostent *gethostbyaddr(const void *addr, socklen_t len, int type)
@@ -46,6 +56,9 @@ struct hostent *gethostbyaddr(const void *addr, socklen_t len, int type)
4656

4757
/* FUNCTION: gethostent */
4858

59+
// There does not appear to be a Windows variant of gethostent
60+
#include <netdb.h>
61+
4962
__CPROVER_bool __VERIFIER_nondet___CPROVER_bool();
5063

5164
struct hostent *gethostent(void)

0 commit comments

Comments
 (0)