xref: /sqlite-3.40.0/src/os_setup.h (revision f74b9e09)
1 /*
2 ** 2013 November 25
3 **
4 ** The author disclaims copyright to this source code.  In place of
5 ** a legal notice, here is a blessing:
6 **
7 **    May you do good and not evil.
8 **    May you find forgiveness for yourself and forgive others.
9 **    May you share freely, never taking more than you give.
10 **
11 ******************************************************************************
12 **
13 ** This file contains code that is specific to Windows.
14 */
15 #ifndef _OS_SETUP_H_
16 #define _OS_SETUP_H_
17 
18 /*
19 ** Figure out if we are dealing with Unix, Windows, or some other operating
20 ** system.
21 **
22 ** After the following block of preprocess macros, all of SQLITE_OS_UNIX,
23 ** SQLITE_OS_WIN, and SQLITE_OS_OTHER will defined to either 1 or 0.  One of
24 ** the four will be 1.  The other three will be 0.
25 */
26 #if defined(SQLITE_OS_OTHER)
27 #  if SQLITE_OS_OTHER==1
28 #    undef SQLITE_OS_UNIX
29 #    define SQLITE_OS_UNIX 0
30 #    undef SQLITE_OS_WIN
31 #    define SQLITE_OS_WIN 0
32 #  else
33 #    undef SQLITE_OS_OTHER
34 #  endif
35 #endif
36 #if !defined(SQLITE_OS_UNIX) && !defined(SQLITE_OS_OTHER)
37 #  define SQLITE_OS_OTHER 0
38 #  ifndef SQLITE_OS_WIN
39 #    if defined(_WIN32) || defined(WIN32) || defined(__CYGWIN__) || \
40         defined(__MINGW32__) || defined(__BORLANDC__)
41 #      define SQLITE_OS_WIN 1
42 #      define SQLITE_OS_UNIX 0
43 #    else
44 #      define SQLITE_OS_WIN 0
45 #      define SQLITE_OS_UNIX 1
46 #    endif
47 #  else
48 #    define SQLITE_OS_UNIX 0
49 #  endif
50 #else
51 #  ifndef SQLITE_OS_WIN
52 #    define SQLITE_OS_WIN 0
53 #  endif
54 #endif
55 
56 #endif /* _OS_SETUP_H_ */
57