clamav/win32/platform.h

77 lines
1.7 KiB
C
Raw Normal View History

2009-10-12 23:34:17 +02:00
#ifndef __PLATFORM_H
#define __PLATFORM_H
#include <winsock2.h>
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <io.h>
#include <direct.h>
2009-10-14 18:59:38 +02:00
#include <Ws2tcpip.h>
2009-10-15 02:39:29 +02:00
#include <process.h>
2009-10-12 23:34:17 +02:00
2009-10-13 20:14:52 +02:00
#include "gettimeofday.h"
2009-10-13 00:54:49 +02:00
#include "snprintf.h"
2009-10-14 18:59:38 +02:00
#include "net.h"
2009-10-15 02:39:29 +02:00
#include "w32_errno.h"
2009-10-16 20:10:34 +02:00
#include "w32_stat.h"
2009-10-13 00:54:49 +02:00
2009-10-13 20:14:52 +02:00
typedef unsigned short mode_t;
2009-10-15 02:39:29 +02:00
2009-10-12 23:34:17 +02:00
#define strcasecmp lstrcmpi
#define strncasecmp strnicmp
2009-10-12 23:36:13 +02:00
#define mkdir(path, mode) mkdir(path)
2009-10-15 02:39:29 +02:00
#define sleep(sex) Sleep(sex)
#define getuid() 0
#define getgid() 0
char *strptime(const char *s, const char *format, struct tm *tm);
2009-10-12 23:35:32 +02:00
2009-10-14 18:59:38 +02:00
#define socket w32_socket
2009-10-15 02:39:29 +02:00
#define getsockopt w32_getsockopt
#define setsockopt w32_setsockopt
#define bind w32_bind
2009-10-14 18:59:38 +02:00
#define connect w32_connect
#define send w32_send
2009-10-15 02:39:29 +02:00
#define recv w32_recv
#define closesocket w32_closesocket
#define getservbyname w32_getservbyname
#define getaddrinfo w32_getaddrinfo
#define freeaddrinfo w32_freeaddrinfo
#define inet_ntop w32_inet_ntop
#define gethostbyname w32_gethostbyname
#define select w32_select
2009-10-14 18:59:38 +02:00
2009-10-15 02:39:29 +02:00
#define getpid GetCurrentProcessId
2009-10-13 20:14:52 +02:00
2009-10-12 23:35:32 +02:00
#define PATH_MAX 32767
2009-10-12 23:36:13 +02:00
#define SEARCH_LIBDIR ""
2009-10-12 23:35:32 +02:00
2009-10-12 23:34:17 +02:00
#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 "\\"
2009-10-20 19:44:45 +02:00
#undef DATADIR
#undef CONFDIR
__declspec(dllimport) extern const char *DATADIR;
__declspec(dllimport) extern const char *CONFDIR;
__declspec(dllimport) extern const char *CONFDIR_CLAMD;
__declspec(dllimport) extern const char *CONFDIR_FRESHCLAM;
__declspec(dllimport) extern const char *CONFDIR_MILTER;
#undef HAVE_CONFIG_H
2009-10-12 23:34:17 +02:00
#endif /* __PLATFORM_H */