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
main
Sagar Vemuri 8 years ago committed by Facebook Github Bot
parent cb9392a094
commit 01ab7b528c
  1. 11
      include/rocksdb/c.h

@ -1348,16 +1348,17 @@ rocksdb_transaction_options_set_max_write_batch_size(
// to free memory that was malloc()ed // to free memory that was malloc()ed
extern ROCKSDB_LIBRARY_API void rocksdb_free(void* ptr); 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, rocksdb_t* db, const rocksdb_readoptions_t* options, const char* key,
size_t keylen, char** errptr); 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_t* db, const rocksdb_readoptions_t* options,
rocksdb_column_family_handle_t* column_family, const char* key, rocksdb_column_family_handle_t* column_family, const char* key,
size_t keylen, char** errptr); size_t keylen, char** errptr);
extern void rocksdb_pinnableslice_destroy(rocksdb_pinnableslice_t* v); extern ROCKSDB_LIBRARY_API void rocksdb_pinnableslice_destroy(
extern const char* rocksdb_pinnableslice_value(const rocksdb_pinnableslice_t* t, rocksdb_pinnableslice_t* v);
size_t* vlen); extern ROCKSDB_LIBRARY_API const char* rocksdb_pinnableslice_value(
const rocksdb_pinnableslice_t* t, size_t* vlen);
#ifdef __cplusplus #ifdef __cplusplus
} /* end extern "C" */ } /* end extern "C" */

Loading…
Cancel
Save