win32/platform.h
853b6e5d
 #ifndef __PLATFORM_H
 #define __PLATFORM_H
 
 #include <winsock2.h>
 #include <windows.h>
 #include <stdio.h>
 #include <stdlib.h>
02daaed6
 #include <io.h>
52671b83
 #include <fcntl.h>
02daaed6
 #include <direct.h>
ccbb5182
 #include <Ws2tcpip.h>
853b6e5d
 #include <process.h>
02daaed6
 
6c02910d
 #ifdef __cplusplus
 extern "C"
 {
 #endif
 
ad0afaf1
 #include "gettimeofday.h"
de61678c
 #include "snprintf.h"
ccbb5182
 #include "net.h"
f7c0a571
 #include "w32_errno.h"
5387e64b
 #include "w32_stat.h"
f642d53c
 #include "random.h"
8ab47ebe
 #include "utf8_util.h"
de61678c
 
6c02910d
 #ifdef __cplusplus
 }
 #else
ad0afaf1
 typedef unsigned short mode_t;
853b6e5d
 #endif
f7c0a571
 
256dc519
 #ifdef _WIN64
 #define SIZEOF_VOID_P 8
 #else
 #define SIZEOF_VOID_P 4
 #endif
 
02daaed6
 #define strcasecmp lstrcmpi
 #define strncasecmp strnicmp
b3722aeb
 #define mkdir(path, mode) mkdir(path)
b11c4362
 #define sleep(sex) Sleep(1000*(sex))
f7c0a571
 #define getuid() 0
 #define getgid() 0
 
 char *strptime(const char *s, const char *format, struct tm *tm);
13829b14
 
f642d53c
 #define srand w32_srand
 #define rand w32_rand
ccbb5182
 #define socket w32_socket
f7c0a571
 #define getsockopt w32_getsockopt
 #define setsockopt w32_setsockopt
 #define bind w32_bind
3b074c78
 #define listen w32_listen
 #define accept w32_accept
ccbb5182
 #define connect w32_connect
3b074c78
 #define shutdown w32_shutdown
ccbb5182
 #define send w32_send
f7c0a571
 #define recv w32_recv
 #define closesocket w32_closesocket
 #define getservbyname w32_getservbyname
853b6e5d
 #define getaddrinfo w32_getaddrinfo
6b7abaa7
 #ifdef gai_strerror
 #undef gai_strerror
 #endif
6591b483
 #define gai_strerror w32_strerror
f7c0a571
 #define freeaddrinfo w32_freeaddrinfo
 #define inet_ntop w32_inet_ntop
b6187b63
 #define inet_ntoa w32_inet_ntoa
 #define getpeername w32_getpeername
f7c0a571
 #define select w32_select
1c4d9a22
 #define poll w32_poll
3b074c78
 #define strerror w32_strerror
 #define strerror_r w32_strerror_r
853b6e5d
 #define ftruncate _chsize
f7c0a571
 #define getpid GetCurrentProcessId
ad0afaf1
 
13829b14
 #define PATH_MAX 32767
b3722aeb
 #define SEARCH_LIBDIR ""
6591b483
 #define WORDS_BIGENDIAN 0
 #define EAI_SYSTEM 0
13829b14
 
02daaed6
 #ifndef MIN
 #define MIN(a, b)	(((a) < (b)) ? (a) : (b))
 #endif
 #ifndef MAX
 #define MAX(a,b)	(((a) > (b)) ? (a) : (b))
 #endif
 
 #ifndef HAVE_IN_PORT_T
 typedef	unsigned	short	in_port_t;
 #endif
 
 #ifndef HAVE_IN_ADDR_T
 typedef	unsigned	int	in_addr_t;
 #endif
 
 #define PATHSEP "\\"
 
52671b83
 void w32_glob(int *argc_ptr, char ***argv_ptr);
 
e46b546c
 #undef DATADIR
 #undef CONFDIR
3b857f14
 #if !defined(THIS_IS_LIBCLAMAV) && defined(_MSC_VER)
 #define LIBCLAMAV_EXPORT __declspec(dllimport)
 #else
 #define LIBCLAMAV_EXPORT
 #endif
 LIBCLAMAV_EXPORT extern const char *DATADIR;
 LIBCLAMAV_EXPORT extern const char *CONFDIR;
 LIBCLAMAV_EXPORT extern const char *CONFDIR_CLAMD;
 LIBCLAMAV_EXPORT extern const char *CONFDIR_FRESHCLAM;
 LIBCLAMAV_EXPORT extern const char *CONFDIR_MILTER;
e46b546c
 #undef HAVE_CONFIG_H
 
a0b5adcc
 #ifdef OUT
 #undef OUT
 #endif
 
52671b83
 int real_main(int, char**);
 #define main main(int argc, char **argv) { _setmode(_fileno(stdin), _O_BINARY); w32_glob(&argc, &argv); return real_main(argc, argv); }; int real_main
 
a0b5adcc
 #endif /* __PLATFORM_H */
6591b483