BeeCrypt  4.2.1
win.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2000, 2001, 2002, 2005 X-Way Rights BV
3  * Copyright (c) 2009 Bob Deblier
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  *
19  */
20 
26 #ifndef _BEECRYPT_WIN_H
27 #define _BEECRYPT_WIN_H
28 
29 #define _REENTRANT
30 
31 #if !defined(_WIN32_WINNT)
32 # define _WIN32_WINNT 0x0400
33 #endif
34 
35 #include <windows.h>
36 
37 #define WORDS_BIGENDIAN 0
38 
39 #if __MWERKS__
40 # if __INTEL__
41 # else
42 # error Unknown CPU type in MetroWerks CodeWarrior
43 # endif
44 #elif defined(_MSC_VER)
45 # if defined(_M_IX86)
46 # define ROTL32(x, s) _rotl(x, s)
47 # define ROTR32(x, s) _rotr(x, s)
48 # else
49 # error Unknown CPU type in Microsoft Visual C
50 # endif
51 #else
52 # error Unknown compiler for WIN32
53 #endif
54 
55 #if defined(_MSC_VER) || __MWERKS__
56 # include <stdio.h>
57 # include <stdlib.h>
58 # include <string.h>
59 
60 # define HAVE_ASSERT_H 1
61 
62 # define HAVE_ERRNO_H 1
63 # define HAVE_CTYPE_H 1
64 # define HAVE_FCNTL_H 1
65 # define HAVE_TIME_H 1
66 
67 # define HAVE_SYS_TYPES_H 0
68 # define HAVE_SYS_TIME_H 0
69 
70 # define HAVE_THREAD_H 0
71 # define HAVE_SYNCH_H 0
72 # define HAVE_PTHREAD_H 0
73 # define HAVE_SEMAPHORE_H 0
74 
75 # define HAVE_TERMIO_H 0
76 # define HAVE_SYS_AUDIOIO_H 0
77 # define HAVE_SYS_IOCTL_H 0
78 # define HAVE_SYS_SOUNDCARD_H 0
79 
80 # define HAVE_GETTIMEOFDAY 0
81 # define HAVE_GETHRTIME 0
82 
83 # define HAVE_DEV_TTY 0
84 # define HAVE_DEV_AUDIO 0
85 # define HAVE_DEV_DSP 0
86 # define HAVE_DEV_RANDOM 0
87 # define HAVE_DEV_URANDOM 0
88 # define HAVE_DEV_TTY 0
89 #else
90 # error Not set up for this compiler
91 #endif
92 
93 #if __MWERKS__
94 
95 # define HAVE_SYS_STAT_H 0
96 
97 # define HAVE_LONG_LONG 1
98 # define HAVE_UNSIGNED_LONG_LONG 1
99 
100 # define HAVE_64_BIT_INT 1
101 # define HAVE_64_BIT_UINT 1
102 
103 # define SIZEOF_SIZE_T 4 /* not sure about this one */
104 # define SIZEOF_UNSIGNED_LONG 4
105 
106 typedef char int8_t;
107 typedef short int16_t;
108 typedef long int32_t;
109 typedef long long int64_t;
110 
111 typedef unsigned char uint8_t;
112 typedef unsigned short uint16_t;
113 typedef unsigned long uint32_t;
114 typedef unsigned long long uint64_t;
115 
116 #elif defined(_MSC_VER)
117 
118 # define HAVE_SYS_STAT_H 1
119 
120 # define HAVE_LONG_LONG 0
121 # define HAVE_UNSIGNED_LONG_LONG 0
122 
123 # define HAVE_64_BIT_INT 1
124 # define HAVE_64_BIT_UINT 1
125 
126 # define SIZEOF_SIZE_T 4
127 # define SIZEOF_UNSIGNED_LONG 4
128 
129 typedef signed char int8_t;
130 typedef signed short int16_t;
131 typedef signed int int32_t;
132 typedef signed __int64 int64_t;
133 
134 typedef unsigned char uint8_t;
135 typedef unsigned short uint16_t;
136 typedef unsigned int uint32_t;
137 typedef unsigned __int64 uint64_t;
138 
139 typedef long off_t;
140 
141 #endif
142 
143 #define MP_WBITS 32U
144 
145 typedef HANDLE bc_cond_t;
146 typedef HANDLE bc_mutex_t;
147 typedef HANDLE bc_thread_t;
148 typedef DWORD bc_threadid_t;
149 
150 #endif
HANDLE bc_mutex_t
Definition: win.h:146
HANDLE bc_thread_t
Definition: win.h:147
HANDLE bc_cond_t
Definition: win.h:145
DWORD bc_threadid_t
Definition: win.h:148