Merged from silc_1_0_branch.
[silc.git] / includes / silcwin32.h
1 /*
2
3   silcwin32.h
4
5   Author: Pekka Riikonen <priikone@silcnet.org>
6
7   Copyright (C) 2001 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 #define DLLAPI __declspec(dllimport)
40 #else
41 #define DLLAPI // Nada, we use .DEF
42 #endif
43 #endif
44
45 # Some winsock compatiblity requirements
46 #ifndef _WIN32_WINNT
47 #define _WIN32_WINNT 0x400
48 #else
49 #undef _WIN32_WINNT
50 #define _WIN32_WINNT 0x400
51 #endif /* _WIN32_WINNT */
52 #if !defined(SO_SYNCHRONOUS_NONALERT)
53 #define SO_SYNCHRONOUS_NONALERT 0x20
54 #endif
55 #if !defined(SO_OPENTYPE)
56 #define SO_OPENTYPE 0x7008
57 #endif
58
59 #undef inline
60 #define inline __inline
61
62 #undef sleep
63 #define sleep(x) Sleep((x) * 1000)
64
65 #endif