fixed compiling with msvc
Modified: trunk/reactos/subsys/system/dhcp/include/dhcpd.h
Modified: trunk/reactos/subsys/system/dhcp/include/rosdhcp.h
Modified: trunk/reactos/subsys/system/dhcp/util.c
_____
Modified: trunk/reactos/subsys/system/dhcp/include/dhcpd.h
--- trunk/reactos/subsys/system/dhcp/include/dhcpd.h 2005-10-17
23:38:24 UTC (rev 18544)
+++ trunk/reactos/subsys/system/dhcp/include/dhcpd.h 2005-10-18
00:00:27 UTC (rev 18545)
@@ -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 <winsock2.h>
#include <iphlpapi.h>
-#include "stdint.h"
+#include <stdint.h>
#define IFNAMSIZ MAX_INTERFACE_NAME_LEN
#define ETH_ALEN 6
#define ETHER_ADDR_LEN ETH_ALEN
+
+#include <pshpack1.h>
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 <poppack.h>
struct ip
{
@@ -92,9 +103,17 @@
#define USE_SOCKET_RECEIVE
#define USE_SOCKET_SEND
+#if defined (_MSC_VER)
+#include <types.h>
+#include <stat.h>
+#include <time.h>
+#include <stddef.h>
+#else
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/time.h>
+#endif
+
#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
@@ -286,12 +305,14 @@
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;
_____
Modified: trunk/reactos/subsys/system/dhcp/include/rosdhcp.h
--- trunk/reactos/subsys/system/dhcp/include/rosdhcp.h 2005-10-17
23:38:24 UTC (rev 18544)
+++ trunk/reactos/subsys/system/dhcp/include/rosdhcp.h 2005-10-18
00:00:27 UTC (rev 18545)
@@ -32,7 +32,14 @@
#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 *));
_____
Modified: trunk/reactos/subsys/system/dhcp/util.c
--- trunk/reactos/subsys/system/dhcp/util.c 2005-10-17 23:38:24 UTC
(rev 18544)
+++ trunk/reactos/subsys/system/dhcp/util.c 2005-10-18 00:00:27 UTC
(rev 18545)
@@ -10,6 +10,8 @@
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 @@
DPRINT1("ERROR: %s\n", buf);
}
+#endif
+
int16_t getShort( unsigned char *data ) {
return (int16_t) ntohs(*(int16_t*) data);
}
Show replies by date