Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions build_windows/VS10/db.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,10 @@
<ClCompile Include="..\..\src\os\os_addrinfo.c"/>
<ClCompile Include="..\..\src\os_windows\os_abs.c"/>
<ClCompile Include="..\..\src\os\os_alloc.c"/>
<ClCompile Include="..\..\src\os\os_atomic.c"/>
<ClCompile Include="..\..\src\os\os_aio.c"/>
<ClCompile Include="..\..\src\os\os_aio_iocp.c"/>
<ClCompile Include="..\..\src\os\os_aio_pool.c"/>
<ClCompile Include="..\..\src\os_windows\os_clock.c"/>
<ClCompile Include="..\..\src\os_windows\os_config.c"/>
<ClCompile Include="..\..\src\os_windows\os_cpu.c"/>
Expand Down
4 changes: 4 additions & 0 deletions build_windows/VS10/db_small.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,10 @@
<ClCompile Include="..\..\src\mutex\mut_win32.c"/>
<ClCompile Include="..\..\src\os\os_abort.c"/>
<ClCompile Include="..\..\src\os\os_alloc.c"/>
<ClCompile Include="..\..\src\os\os_atomic.c"/>
<ClCompile Include="..\..\src\os\os_aio.c"/>
<ClCompile Include="..\..\src\os\os_aio_iocp.c"/>
<ClCompile Include="..\..\src\os\os_aio_pool.c"/>
<ClCompile Include="..\..\src\os\os_ctime.c"/>
<ClCompile Include="..\..\src\os\os_pid.c"/>
<ClCompile Include="..\..\src\os\os_root.c"/>
Expand Down
4 changes: 4 additions & 0 deletions build_windows/VS8/db.vcproj
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,10 @@
<File RelativePath="..\..\src\os\os_addrinfo.c"/>
<File RelativePath="..\..\src\os_windows\os_abs.c"/>
<File RelativePath="..\..\src\os\os_alloc.c"/>
<File RelativePath="..\..\src\os\os_atomic.c"/>
<File RelativePath="..\..\src\os\os_aio.c"/>
<File RelativePath="..\..\src\os\os_aio_iocp.c"/>
<File RelativePath="..\..\src\os\os_aio_pool.c"/>
<File RelativePath="..\..\src\os_windows\os_clock.c"/>
<File RelativePath="..\..\src\os_windows\os_config.c"/>
<File RelativePath="..\..\src\os_windows\os_cpu.c"/>
Expand Down
4 changes: 4 additions & 0 deletions build_windows/VS8/db_small.vcproj
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,10 @@
<File RelativePath="..\..\src\mutex\mut_win32.c"/>
<File RelativePath="..\..\src\os\os_abort.c"/>
<File RelativePath="..\..\src\os\os_alloc.c"/>
<File RelativePath="..\..\src\os\os_atomic.c"/>
<File RelativePath="..\..\src\os\os_aio.c"/>
<File RelativePath="..\..\src\os\os_aio_iocp.c"/>
<File RelativePath="..\..\src\os\os_aio_pool.c"/>
<File RelativePath="..\..\src\os\os_ctime.c"/>
<File RelativePath="..\..\src\os\os_pid.c"/>
<File RelativePath="..\..\src\os\os_root.c"/>
Expand Down
9 changes: 7 additions & 2 deletions build_windows/db.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions src/dbinc/atomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,16 @@ typedef struct {
* Modification operations delegate to ENV-aware functions.
*/
#define atomic_read(p) __os_atomic_read(p)
/*
* atomic_init collides with the C++ <atomic> free function std::atomic_init
* (and C11 <stdatomic.h> atomic_init). MSVC's C++ standard library pulls
* <atomic> into any C++ translation unit, and the macro would rewrite that
* declaration -> compile failure. Berkeley DB only calls atomic_init() from
* C sources, so define the macro only for C.
*/
#if !defined(__cplusplus)
#define atomic_init(p, val) __os_atomic_init((p), (val))
#endif

/*
* atomic_read_relaxed: torn-read-free load with no ordering, for pure
Expand Down
9 changes: 7 additions & 2 deletions src/dbinc/db.in
Original file line number Diff line number Diff line change
Expand Up @@ -2778,16 +2778,21 @@ typedef struct {
*
* The global variables dbrdonly, dirf and pagf were not retained when 4BSD
* replaced the dbm interface with ndbm, and are not supported here.
*
* These unprefixed 4BSD names (delete, fetch, firstkey, nextkey, store, ...)
* are C-only historic aliases: they collide with C++ keywords and standard
* library member names (e.g. std::atomic<>::store, which MSVC's <atomic>
* pulls into any C++ translation unit). Suppress them for C++.
*/
#if !defined(__cplusplus)
#define dbminit(a) __db_dbm_init@DB_VERSION_UNIQUE_NAME@(a)
#define dbmclose __db_dbm_close@DB_VERSION_UNIQUE_NAME@
#if !defined(__cplusplus)
#define delete(a) __db_dbm_delete@DB_VERSION_UNIQUE_NAME@(a)
#endif
#define fetch(a) __db_dbm_fetch@DB_VERSION_UNIQUE_NAME@(a)
#define firstkey __db_dbm_firstkey@DB_VERSION_UNIQUE_NAME@
#define nextkey(a) __db_dbm_nextkey@DB_VERSION_UNIQUE_NAME@(a)
#define store(a, b) __db_dbm_store@DB_VERSION_UNIQUE_NAME@(a, b)
#endif

/*******************************************************
* Hsearch historic interface.
Expand Down
9 changes: 9 additions & 0 deletions src/os/os_atomic.c
Original file line number Diff line number Diff line change
Expand Up @@ -1895,6 +1895,15 @@ __os_atomic_thread_fence()
!defined(HAVE_ATOMIC_GCC_BUILTIN) && \
!defined(HAVE_ATOMIC_SYNC_BUILTIN)

/*
* The Interlocked* intrinsics take a `LONG volatile *`. We cast the address
* of db_atomic_t::value to that type through `interlocked_val` (matching
* mut_win32.c); it was referenced here but never defined for this TU.
*/
#ifndef interlocked_val
#define interlocked_val long volatile *
#endif

/*
* __os_atomic_init --
* Initialize an atomic variable (Windows).
Expand Down
Loading