From 01ab7b528c96a5eea84336564a1b006a1e673a74 Mon Sep 17 00:00:00 2001 From: Sagar Vemuri Date: Wed, 17 May 2017 10:10:22 -0700 Subject: [PATCH] Add ROCKSDB_LIBRARY_API macro to a few C APIs, to fix windows build Summary: Windows build in AppVeyor is broken, I believe due to https://github.com/facebook/rocksdb/pull/2254. Error messages: ``` c_test.obj : error LNK2019: unresolved external symbol rocksdb_get_pinned referenced in function CheckPinGet [C:\projects\rocksdb\build\c_test.vcxproj] c_test.obj : error LNK2019: unresolved external symbol rocksdb_get_pinned_cf referenced in function CheckPinGetCF [C:\projects\rocksdb\build\c_test.vcxproj] c_test.obj : error LNK2019: unresolved external symbol rocksdb_pinnableslice_destroy referenced in function CheckPinGet [C:\projects\rocksdb\build\c_test.vcxproj] c_test.obj : error LNK2019: unresolved external symbol rocksdb_pinnableslice_value referenced in function CheckPinGet [C:\projects\rocksdb\build\c_test.vcxproj] C:\projects\rocksdb\build\Debug\c_test.exe : fatal error LNK1120: 4 unresolved externals [C:\projects\rocksdb\build\c_test.vcxproj] ``` See, for example: https://ci.appveyor.com/project/Facebook/rocksdb/build/1.0.4420 Closes https://github.com/facebook/rocksdb/pull/2309 Differential Revision: D5076992 Pulled By: sagar0 fbshipit-source-id: bf4ca063a53b5a9042ba9f655f7c60c268ea5748 --- include/rocksdb/c.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/include/rocksdb/c.h b/include/rocksdb/c.h index 7981ff339..24fec04a5 100644 --- a/include/rocksdb/c.h +++ b/include/rocksdb/c.h @@ -1348,16 +1348,17 @@ rocksdb_transaction_options_set_max_write_batch_size( // to free memory that was malloc()ed extern ROCKSDB_LIBRARY_API void rocksdb_free(void* ptr); -extern rocksdb_pinnableslice_t* rocksdb_get_pinned( +extern ROCKSDB_LIBRARY_API rocksdb_pinnableslice_t* rocksdb_get_pinned( rocksdb_t* db, const rocksdb_readoptions_t* options, const char* key, size_t keylen, char** errptr); -extern rocksdb_pinnableslice_t* rocksdb_get_pinned_cf( +extern ROCKSDB_LIBRARY_API rocksdb_pinnableslice_t* rocksdb_get_pinned_cf( rocksdb_t* db, const rocksdb_readoptions_t* options, rocksdb_column_family_handle_t* column_family, const char* key, size_t keylen, char** errptr); -extern void rocksdb_pinnableslice_destroy(rocksdb_pinnableslice_t* v); -extern const char* rocksdb_pinnableslice_value(const rocksdb_pinnableslice_t* t, - size_t* vlen); +extern ROCKSDB_LIBRARY_API void rocksdb_pinnableslice_destroy( + rocksdb_pinnableslice_t* v); +extern ROCKSDB_LIBRARY_API const char* rocksdb_pinnableslice_value( + const rocksdb_pinnableslice_t* t, size_t* vlen); #ifdef __cplusplus } /* end extern "C" */