fuimaz / spserver

Automatically exported from code.google.com/p/spserver
Other
0 stars 0 forks source link

spmemvfs support for windows #29

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I'm using spmemvfs on windows too, but i had to change some code to make it
build and work in multi thread environment. Add this on top of spmemvfs.c:

[code]
#if ! defined(_WIN32)
 #include <pthread.h>
 #define spmem_critical_section_t         pthread_mutex_t
 #define spmem_init_critical_section      pthread_mutex_init
 #define spmem_destroy_critical_section   pthread_mutex_destroy
 #define spmem_enter_critical_section     pthread_mutex_lock
 #define spmem_exit_critical_section      pthread_mutex_unlock
 #define spmem_init_default_arg           NULL
#else
 #include <windows.h>
 #define __func__ __FUNCTION__
 #define spmem_critical_section           CRITICAL_SECTION
 #define spmem_init_critical_section      InitializeCriticalSectionAndSpinCount
 #define spmem_destroy_critical_section   DeleteCriticalSection
 #define spmem_enter_critical_section     EnterCriticalSection
 #define spmem_exit_critical_section      LeaveCriticalSection
 #define spmem_init_default_arg           0x80000400
#endif
[/code]

and replace every instance of pthread_mutex_* with spmem sersions.

Original issue reported on code.google.com by kunitoki on 18 Feb 2010 at 11:48

GoogleCodeExporter commented 9 years ago
Thanks for your patch.

The last spmemvfs has been moved to --
http://code.google.com/p/sphivedb/downloads/list

Replace pthread_mutex_t by sqlite_mutex, it should work on windows.
http://sphivedb.googlecode.com/files/spmemvfs-0.3.tar.gz

Original comment by stephen....@gmail.com on 20 Feb 2010 at 1:59