Anope IRC Services  Version 2.0
anope_windows.h
Go to the documentation of this file.
1 /* POSIX emulation layer for Windows.
2  *
3  * Copyright (C) 2008-2011 Robin Burchell <w00t@inspircd.org>
4  * Copyright (C) 2008-2014 Anope Team <info@anope.org>
5  *
6  * Please read COPYING and README for further details.
7  *
8  * Based on the original code of Epona by Lara.
9  * Based on the original code of Services by Andy Church.
10  */
11 
12 #ifndef WINDOWS_H
13 #define WINDOWS_H
14 #ifdef _WIN32
15 
16 #define NOMINMAX
17 
18 #include <winsock2.h>
19 #include <ws2tcpip.h>
20 #include <windows.h>
21 #include <sys/timeb.h>
22 #include <direct.h>
23 
24 #ifdef MODULE_COMPILE
25 # define CoreExport __declspec(dllimport)
26 # define DllExport __declspec(dllexport)
27 #else
28 # define CoreExport __declspec(dllexport)
29 # define DllExport __declspec(dllimport)
30 #endif
31 
32 #define MARK_DEPRECATED
33 
34 #if GETTEXT_FOUND
35 /* Undefine some functions libintl defines */
36 # undef snprintf
37 # undef vsnprintf
38 # undef printf
39 #endif
40 
41 #define snprintf _snprintf
42 /* VS2008 hates having this define before its own */
43 #define vsnprintf _vsnprintf
44 
45 #define anope_close windows_close
46 
47 #define stat _stat
48 #define S_ISREG(x) ((x) & _S_IFREG)
49 
50 #ifdef EINPROGRESS
51 # undef EINPROGRESS
52 #endif
53 #define EINPROGRESS WSAEWOULDBLOCK
54 
55 #include "socket.h"
56 #include "dir/dir.h"
57 #include "dl/dl.h"
58 #include "pipe/pipe.h"
59 #include "pthread/pthread.h"
60 #include "sigaction/sigaction.h"
61 
62 typedef int ssize_t;
63 
64 namespace Anope
65 {
66  class string;
67 }
68 
69 extern CoreExport void OnStartup();
70 extern CoreExport void OnShutdown();
71 extern CoreExport USHORT WindowsGetLanguage(const char *lang);
72 extern CoreExport int gettimeofday(timeval *tv, void *);
73 extern CoreExport Anope::string GetWindowsVersion();
74 extern CoreExport bool SupportedWindowsVersion();
75 extern int setenv(const char *name, const char *value, int overwrite);
76 extern int unsetenv(const char *name);
77 extern int mkstemp(char *input);
78 extern void getcwd(char *buf, size_t sz);
79 
80 #endif // _WIN32
81 #endif // WINDOWS_H
std::basic_string< char, ci_char_traits, std::allocator< char > > string
Definition: hashcomp.h:133
#define CoreExport
Definition: services.h:62
Anope::string name
Definition: access.cpp:22
Definition: anope.h:20