e3f9b4552e781ff5275dbb5d199067f2c0cf281b
[silc.git] / includes / silcwin32.h
1 /*
2
3   silcwin32.h
4
5   Author: Pekka Riikonen <priikone@silcnet.org>
6
7   Copyright (C) 2001 - 2003 Pekka Riikonen
8
9   This program is free software; you can redistribute it and/or modify
10   it under the terms of the GNU General Public License as published by
11   the Free Software Foundation; version 2 of the License.
12
13   This program is distributed in the hope that it will be useful,
14   but WITHOUT ANY WARRANTY; without even the implied warranty of
15   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16   GNU General Public License for more details.
17
18 */
19 /* Native WIN32 specific includes and definitions. */
20
21 #ifndef SILCWIN32_H
22 #define SILCWIN32_H
23
24 #include <windows.h>
25 #include <io.h>
26 #include <process.h>
27 #include <fcntl.h>
28 #include <assert.h>
29
30 #if defined(HAVE_SILCDEFS_H)
31 #include "regexpr.h"
32 #endif /* HAVE_SILCDEFS_H */
33
34 #define snprintf _snprintf
35 #define vsnprintf _vsnprintf
36
37 #ifdef WIN32
38 #define strcasecmp stricmp
39 #define strncasecmp strncmp
40 #endif
41
42 #ifdef WIN32
43 #ifndef DLL
44 #ifndef _LIB
45 #define DLLAPI __declspec(dllimport)
46 #else
47 #define DLLAPI  /* Nada, we use .DEF */
48 #endif
49 #else
50 #define DLLAPI  /* Nada, we use .DEF */
51 #endif
52 #endif
53
54 /* Some winsock compatiblity requirements */
55 #ifndef _WIN32_WINNT
56 #define _WIN32_WINNT 0x400
57 #else
58 #undef _WIN32_WINNT
59 #define _WIN32_WINNT 0x400
60 #endif /* _WIN32_WINNT */
61 #if !defined(SO_SYNCHRONOUS_NONALERT)
62 #define SO_SYNCHRONOUS_NONALERT 0x20
63 #endif
64 #if !defined(SO_OPENTYPE)
65 #define SO_OPENTYPE 0x7008
66 #endif
67
68 #undef inline
69 #define inline __inline
70
71 #undef sleep
72 #define sleep(x) Sleep((x) * 1000)
73
74 #endif