wasCSharpSQLite – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | #define SQLITE_OS_WIN |
2 | |||
3 | namespace Community.CsharpSqlite |
||
4 | { |
||
5 | public partial class Sqlite3 |
||
6 | { |
||
7 | /* |
||
8 | ** 2007 August 28 |
||
9 | ** |
||
10 | ** The author disclaims copyright to this source code. In place of |
||
11 | ** a legal notice, here is a blessing: |
||
12 | ** |
||
13 | ** May you do good and not evil. |
||
14 | ** May you find forgiveness for yourself and forgive others. |
||
15 | ** May you share freely, never taking more than you give. |
||
16 | ** |
||
17 | ************************************************************************* |
||
18 | ** |
||
19 | ** This file contains the common header for all mutex implementations. |
||
20 | ** The sqliteInt.h header #includes this file so that it is available |
||
21 | ** to all source files. We break it out in an effort to keep the code |
||
22 | ** better organized. |
||
23 | ** |
||
24 | ** NOTE: source files should *not* #include this header file directly. |
||
25 | ** Source files should #include the sqliteInt.h file and let that file |
||
26 | ** include this one indirectly. |
||
27 | ************************************************************************* |
||
28 | ** Included in SQLite3 port to C#-SQLite; 2008 Noah B Hart |
||
29 | ** C#-SQLite is an independent reimplementation of the SQLite software library |
||
30 | ** |
||
31 | ** SQLITE_SOURCE_ID: 2010-12-07 20:14:09 a586a4deeb25330037a49df295b36aaf624d0f45 |
||
32 | ** |
||
33 | ************************************************************************* |
||
34 | */ |
||
35 | |||
36 | |||
37 | /* |
||
38 | ** Figure out what version of the code to use. The choices are |
||
39 | ** |
||
40 | ** SQLITE_MUTEX_OMIT No mutex logic. Not even stubs. The |
||
41 | ** mutexes implemention cannot be overridden |
||
42 | ** at start-time. |
||
43 | ** |
||
44 | ** SQLITE_MUTEX_NOOP For single-threaded applications. No |
||
45 | ** mutual exclusion is provided. But this |
||
46 | ** implementation can be overridden at |
||
47 | ** start-time. |
||
48 | ** |
||
49 | ** SQLITE_MUTEX_PTHREADS For multi-threaded applications on Unix. |
||
50 | ** |
||
51 | ** SQLITE_MUTEX_W32 For multi-threaded applications on Win32. |
||
52 | ** |
||
53 | ** SQLITE_MUTEX_OS2 For multi-threaded applications on OS/2. |
||
54 | */ |
||
55 | |||
56 | //#if !SQLITE_THREADSAFE |
||
57 | //# define SQLITE_MUTEX_OMIT |
||
58 | //#endif |
||
59 | //#if SQLITE_THREADSAFE && !defined(SQLITE_MUTEX_NOOP) |
||
60 | //# if SQLITE_OS_UNIX |
||
61 | //# define SQLITE_MUTEX_PTHREADS |
||
62 | //# elif SQLITE_OS_WIN |
||
63 | //# define SQLITE_MUTEX_W32 |
||
64 | //# elif SQLITE_OS_OS2 |
||
65 | //# define SQLITE_MUTEX_OS2 |
||
66 | //# else |
||
67 | //# define SQLITE_MUTEX_NOOP |
||
68 | //# endif |
||
69 | //#endif |
||
70 | |||
71 | #if WINDOWS_PHONE && SQLITE_THREADSAFE |
||
72 | #error Cannot compile with both WINDOWS_PHONE and SQLITE_THREADSAFE |
||
73 | #endif |
||
74 | |||
75 | #if SQLITE_SILVERLIGHT && SQLITE_THREADSAFE |
||
76 | #error Cannot compile with both SQLITE_SILVERLIGHT and SQLITE_THREADSAFE |
||
77 | #endif |
||
78 | |||
79 | #if SQLITE_THREADSAFE && SQLITE_MUTEX_NOOP |
||
80 | #error Cannot compile with both SQLITE_THREADSAFE and SQLITE_MUTEX_NOOP |
||
81 | #endif |
||
82 | |||
83 | #if SQLITE_THREADSAFE && SQLITE_MUTEX_OMIT |
||
84 | #error Cannot compile with both SQLITE_THREADSAFE and SQLITE_MUTEX_OMIT |
||
85 | #endif |
||
86 | |||
87 | #if SQLITE_MUTEX_OMIT && SQLITE_MUTEX_NOOP |
||
88 | #error Cannot compile with both SQLITE_MUTEX_OMIT and SQLITE_MUTEX_NOOP |
||
89 | #endif |
||
90 | |||
91 | #if SQLITE_MUTEX_OMIT && SQLITE_MUTEX_W32 |
||
92 | #error Cannot compile with both SQLITE_MUTEX_OMIT and SQLITE_MUTEX_W32 |
||
93 | #endif |
||
94 | |||
95 | #if SQLITE_MUTEX_NOOP && SQLITE_MUTEX_W32 |
||
96 | #error Cannot compile with both SQLITE_MUTEX_NOOP and SQLITE_MUTEX_W32 |
||
97 | #endif |
||
98 | |||
99 | #if SQLITE_MUTEX_OMIT |
||
100 | /* |
||
101 | ** If this is a no-op implementation, implement everything as macros. |
||
102 | */ |
||
103 | public class sqlite3_mutex |
||
104 | { |
||
105 | } |
||
106 | static sqlite3_mutex mutex = null; //sqlite3_mutex sqlite3_mutex; |
||
107 | static sqlite3_mutex sqlite3MutexAlloc( int iType ) |
||
108 | { |
||
109 | return new sqlite3_mutex(); |
||
110 | }//#define sqlite3MutexAlloc(X) ((sqlite3_mutex*)8) |
||
111 | static sqlite3_mutex sqlite3_mutex_alloc( int iType ) |
||
112 | { |
||
113 | return new sqlite3_mutex(); |
||
114 | }//#define sqlite3_mutex_alloc(X) ((sqlite3_mutex*)8) |
||
115 | static void sqlite3_mutex_free( sqlite3_mutex m ) |
||
116 | { |
||
117 | } //#define sqlite3_mutex_free(X) |
||
118 | static void sqlite3_mutex_enter( sqlite3_mutex m ) |
||
119 | { |
||
120 | } //#define sqlite3_mutex_enter(X) |
||
121 | static int sqlite3_mutex_try( int iType ) |
||
122 | { |
||
123 | return SQLITE_OK; |
||
124 | } //#define sqlite3_mutex_try(X) SQLITE_OK |
||
125 | static void sqlite3_mutex_leave( sqlite3_mutex m ) |
||
126 | { |
||
127 | } //#define sqlite3_mutex_leave(X) |
||
128 | static bool sqlite3_mutex_held( sqlite3_mutex m ) |
||
129 | { |
||
130 | return true; |
||
131 | }//#define sqlite3_mutex_held(X) ((void)(X),1) |
||
132 | static bool sqlite3_mutex_notheld( sqlite3_mutex m ) |
||
133 | { |
||
134 | return true; |
||
135 | } //#define sqlite3_mutex_notheld(X) ((void)(X),1) |
||
136 | static int sqlite3MutexInit() |
||
137 | { |
||
138 | return SQLITE_OK; |
||
139 | } //#define sqlite3MutexInit() SQLITE_OK |
||
140 | static void sqlite3MutexEnd() |
||
141 | { |
||
142 | } //#define sqlite3MutexEnd() |
||
143 | #endif //* defined(SQLITE_MUTEX_OMIT) */ |
||
144 | } |
||
145 | } |