diff --git a/reactos/subsys/system/dhcp/include/dhcpd.h b/reactos/subsys/system/dhcp/include/dhcpd.h index 1434021afe1..5f0c8bd6c99 100644 --- a/reactos/subsys/system/dhcp/include/dhcpd.h +++ b/reactos/subsys/system/dhcp/include/dhcpd.h @@ -42,20 +42,31 @@ #ifndef DHCPD_H #define DHCPD_H +#if defined (_MSC_VER) +#pragma warning( once : 4103 ) +#endif + +#if !defined(ssize_t) +#define ssize_t long +#endif + #include #include -#include "stdint.h" +#include #define IFNAMSIZ MAX_INTERFACE_NAME_LEN #define ETH_ALEN 6 #define ETHER_ADDR_LEN ETH_ALEN + +#include struct ether_header { u_int8_t ether_dhost[ETH_ALEN]; /* destination eth addr */ u_int8_t ether_shost[ETH_ALEN]; /* source ether addr */ u_int16_t ether_type; /* packet type ID field */ -} __attribute__ ((__packed__)); +} ; +#include struct ip { @@ -92,9 +103,17 @@ struct udphdr { #define USE_SOCKET_RECEIVE #define USE_SOCKET_SEND +#if defined (_MSC_VER) +#include +#include +#include +#include +#else #include #include #include +#endif + #include #include #include @@ -286,12 +305,14 @@ void do_packet(struct interface_info *, struct dhcp_packet *, int, unsigned int, struct iaddr, struct hardware *); /* errwarn.c */ +#if defined (__GNUC__) extern int warnings_occurred; void error(char *, ...) __attribute__ ((__format__ (__printf__, 1, 2))); int warning(char *, ...) __attribute__ ((__format__ (__printf__, 1, 2))); int note(char *, ...) __attribute__ ((__format__ (__printf__, 1, 2))); int debug(char *, ...) __attribute__ ((__format__ (__printf__, 1, 2))); int parse_warn(char *, ...) __attribute__ ((__format__ (__printf__, 1, 2))); +#endif /* conflex.c */ extern int lexline, lexchar; diff --git a/reactos/subsys/system/dhcp/include/rosdhcp.h b/reactos/subsys/system/dhcp/include/rosdhcp.h index f27d0462e72..aaedbab51ca 100644 --- a/reactos/subsys/system/dhcp/include/rosdhcp.h +++ b/reactos/subsys/system/dhcp/include/rosdhcp.h @@ -32,7 +32,14 @@ typedef u_int32_t uintTIME; #define TIME uintTIME #include "dhcpd.h" +#if (_MSC_VER < 900) || defined(__STDC__) +#define inline +#else +#define inline __inline +#endif + #define INLINE inline + #define PROTO(x) x typedef void (*handler_t) PROTO ((struct packet *)); diff --git a/reactos/subsys/system/dhcp/util.c b/reactos/subsys/system/dhcp/util.c index 339c87aeadc..2194c0c3b08 100644 --- a/reactos/subsys/system/dhcp/util.c +++ b/reactos/subsys/system/dhcp/util.c @@ -10,6 +10,8 @@ char *piaddr( struct iaddr addr ) { return inet_ntoa( sa.sin_addr ); } +#if defined (__GNUC__) + int note( char *format, ... ) { va_list arg_begin; va_start( arg_begin, format ); @@ -72,6 +74,8 @@ void error( char *format, ... ) { DPRINT1("ERROR: %s\n", buf); } +#endif + int16_t getShort( unsigned char *data ) { return (int16_t) ntohs(*(int16_t*) data); }