Merged silc_1_0_branch to trunk.
[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; either version 2 of the License, or
12   (at your option) any later version.
13
14   This program is distributed in the hope that it will be useful,
15   but WITHOUT ANY WARRANTY; without even the implied warranty of
16   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17   GNU General Public License for more details.
18
19 */
20 /* Native WIN32 specific includes and definitions. */
21
22 #ifndef SILCWIN32_H
23 #define SILCWIN32_H
24
25 #include <windows.h>
26 #include <io.h>
27 #include <process.h>
28
29 #define snprintf _snprintf
30 #define vsnprintf _vsnprintf
31
32 #ifdef WIN32
33 #define strcasecmp stricmp
34 #define strncasecmp strncmp
35 #endif
36
37 #ifdef WIN32
38 #ifndef DLL
39 #ifndef _LIB
40 #define DLLAPI __declspec(dllimport)
41 #else
42 #define DLLAPI  /* Nada, we use .DEF */
43 #endif
44 #else
45 #define DLLAPI  /* Nada, we use .DEF */
46 #endif
47 #endif
48
49 /* Some winsock compatiblity requirements */
50 #ifndef _WIN32_WINNT
51 #define _WIN32_WINNT 0x400
52 #else
53 #undef _WIN32_WINNT
54 #define _WIN32_WINNT 0x400
55 #endif /* _WIN32_WINNT */
56 #if !defined(SO_SYNCHRONOUS_NONALERT)
57 #define SO_SYNCHRONOUS_NONALERT 0x20
58 #endif
59 #if !defined(SO_OPENTYPE)
60 #define SO_OPENTYPE 0x7008
61 #endif
62
63 #undef inline
64 #define inline __inline
65
66 #undef sleep
67 #define sleep(x) Sleep((x) * 1000)
68
69 #endif