Skip to content

Commit 7bd3fe1

Browse files
committed
CIndexStoreDB: correct dllstorage annotation
The `INDEXSTORE_PUBLIC` macro was guarding based on `_MSC_VER` which is a check for MSVC's compiler which is incorrect. This annotation has nothing to do with the MSVC compiler but rather the PE/COFF file format. Adjust that to `_WIN32` as an alias for Windows. Furthermore, correct the annotation - the functions should be given dllexport storage when building IndexStoreDB, and dllimport storage when building code which uses IndexStoreDB (unless it is statically built).
1 parent 7cf04b8 commit 7bd3fe1

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

include/CIndexStoreDB/CIndexStoreDB.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,14 @@
2626
#endif
2727

2828
#ifndef INDEXSTOREDB_PUBLIC
29-
# if defined (_MSC_VER)
30-
# define INDEXSTOREDB_PUBLIC __declspec(dllimport)
29+
# if defined(_WIN32) && defined(_DLL)
30+
# if defined(CIndexStoreDB_EXPORTS)
31+
# define INDEXSTOREDB_PUBLIC __declspec(dllexport)
32+
# else
33+
# define INDEXSTOREDB_PUBLIC __declspec(dllimport)
34+
# endif
3135
# else
32-
# define INDEXSTOREDB_PUBLIC
36+
# define INDEXSTOREDB_PUBLIC
3337
# endif
3438
#endif
3539

0 commit comments

Comments
 (0)