Fossil SCM

Cherry-pick [http://www.sqlite.org/src/info/2037442c582e51d85967bc911ea4a412eb4da573|2037442c58]: Fix compilation on Cygwin when SQLITE_MAX_WORKER_THREADS is greater than zero.

jan.nijtmans 2015-01-22 10:27 trunk
Commit 0eae9d3cbd71477c2868b9de95a8a6f79d594c7c
1 file changed +13 -2
+13 -2
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -19870,10 +19870,21 @@
1987019870
# define SQLITE_WIN32_VOLATILE
1987119871
#else
1987219872
# define SQLITE_WIN32_VOLATILE volatile
1987319873
#endif
1987419874
19875
+/*
19876
+** For some Windows sub-platforms, the _beginthreadex() / _endthreadex()
19877
+** functions are not available (e.g. those not using MSVC, Cygwin, etc).
19878
+*/
19879
+#if SQLITE_OS_WIN && !SQLITE_OS_WINCE && !SQLITE_OS_WINRT && \
19880
+ SQLITE_THREADSAFE>0 && !defined(__CYGWIN__)
19881
+# define SQLITE_OS_WIN_THREADS 1
19882
+#else
19883
+# define SQLITE_OS_WIN_THREADS 0
19884
+#endif
19885
+
1987519886
#endif /* _OS_WIN_H_ */
1987619887
1987719888
/************** End of os_win.h **********************************************/
1987819889
/************** Continuing where we left off in mutex_w32.c ******************/
1987919890
#endif
@@ -22433,11 +22444,11 @@
2243322444
#endif /* SQLITE_OS_UNIX && defined(SQLITE_MUTEX_PTHREADS) */
2243422445
/******************************** End Unix Pthreads *************************/
2243522446
2243622447
2243722448
/********************************* Win32 Threads ****************************/
22438
-#if SQLITE_OS_WIN && !SQLITE_OS_WINCE && !SQLITE_OS_WINRT && SQLITE_THREADSAFE>0
22449
+#if SQLITE_OS_WIN_THREADS
2243922450
2244022451
#define SQLITE_THREADS_IMPLEMENTED 1 /* Prevent the single-thread code below */
2244122452
#include <process.h>
2244222453
2244322454
/* A running thread */
@@ -22526,11 +22537,11 @@
2252622537
if( rc==WAIT_OBJECT_0 ) *ppOut = p->pResult;
2252722538
sqlite3_free(p);
2252822539
return (rc==WAIT_OBJECT_0) ? SQLITE_OK : SQLITE_ERROR;
2252922540
}
2253022541
22531
-#endif /* SQLITE_OS_WIN && !SQLITE_OS_WINCE && !SQLITE_OS_WINRT */
22542
+#endif /* SQLITE_OS_WIN_THREADS */
2253222543
/******************************** End Win32 Threads *************************/
2253322544
2253422545
2253522546
/********************************* Single-Threaded **************************/
2253622547
#ifndef SQLITE_THREADS_IMPLEMENTED
2253722548
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -19870,10 +19870,21 @@
19870 # define SQLITE_WIN32_VOLATILE
19871 #else
19872 # define SQLITE_WIN32_VOLATILE volatile
19873 #endif
19874
 
 
 
 
 
 
 
 
 
 
 
19875 #endif /* _OS_WIN_H_ */
19876
19877 /************** End of os_win.h **********************************************/
19878 /************** Continuing where we left off in mutex_w32.c ******************/
19879 #endif
@@ -22433,11 +22444,11 @@
22433 #endif /* SQLITE_OS_UNIX && defined(SQLITE_MUTEX_PTHREADS) */
22434 /******************************** End Unix Pthreads *************************/
22435
22436
22437 /********************************* Win32 Threads ****************************/
22438 #if SQLITE_OS_WIN && !SQLITE_OS_WINCE && !SQLITE_OS_WINRT && SQLITE_THREADSAFE>0
22439
22440 #define SQLITE_THREADS_IMPLEMENTED 1 /* Prevent the single-thread code below */
22441 #include <process.h>
22442
22443 /* A running thread */
@@ -22526,11 +22537,11 @@
22526 if( rc==WAIT_OBJECT_0 ) *ppOut = p->pResult;
22527 sqlite3_free(p);
22528 return (rc==WAIT_OBJECT_0) ? SQLITE_OK : SQLITE_ERROR;
22529 }
22530
22531 #endif /* SQLITE_OS_WIN && !SQLITE_OS_WINCE && !SQLITE_OS_WINRT */
22532 /******************************** End Win32 Threads *************************/
22533
22534
22535 /********************************* Single-Threaded **************************/
22536 #ifndef SQLITE_THREADS_IMPLEMENTED
22537
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -19870,10 +19870,21 @@
19870 # define SQLITE_WIN32_VOLATILE
19871 #else
19872 # define SQLITE_WIN32_VOLATILE volatile
19873 #endif
19874
19875 /*
19876 ** For some Windows sub-platforms, the _beginthreadex() / _endthreadex()
19877 ** functions are not available (e.g. those not using MSVC, Cygwin, etc).
19878 */
19879 #if SQLITE_OS_WIN && !SQLITE_OS_WINCE && !SQLITE_OS_WINRT && \
19880 SQLITE_THREADSAFE>0 && !defined(__CYGWIN__)
19881 # define SQLITE_OS_WIN_THREADS 1
19882 #else
19883 # define SQLITE_OS_WIN_THREADS 0
19884 #endif
19885
19886 #endif /* _OS_WIN_H_ */
19887
19888 /************** End of os_win.h **********************************************/
19889 /************** Continuing where we left off in mutex_w32.c ******************/
19890 #endif
@@ -22433,11 +22444,11 @@
22444 #endif /* SQLITE_OS_UNIX && defined(SQLITE_MUTEX_PTHREADS) */
22445 /******************************** End Unix Pthreads *************************/
22446
22447
22448 /********************************* Win32 Threads ****************************/
22449 #if SQLITE_OS_WIN_THREADS
22450
22451 #define SQLITE_THREADS_IMPLEMENTED 1 /* Prevent the single-thread code below */
22452 #include <process.h>
22453
22454 /* A running thread */
@@ -22526,11 +22537,11 @@
22537 if( rc==WAIT_OBJECT_0 ) *ppOut = p->pResult;
22538 sqlite3_free(p);
22539 return (rc==WAIT_OBJECT_0) ? SQLITE_OK : SQLITE_ERROR;
22540 }
22541
22542 #endif /* SQLITE_OS_WIN_THREADS */
22543 /******************************** End Win32 Threads *************************/
22544
22545
22546 /********************************* Single-Threaded **************************/
22547 #ifndef SQLITE_THREADS_IMPLEMENTED
22548

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button