Skip to content

Commit

Permalink
Add ROCKSDB_LIBRARY_API macro to a few C APIs, to fix windows build
Browse files Browse the repository at this point in the history
Summary:
Windows build in AppVeyor is broken, I believe due to facebook#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 facebook#2309

Differential Revision: D5076992

Pulled By: sagar0

fbshipit-source-id: bf4ca063a53b5a9042ba9f655f7c60c268ea5748
  • Loading branch information
sagar0 authored and facebook-github-bot committed May 17, 2017
1 parent cb9392a commit 01ab7b5
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions include/rocksdb/c.h
Original file line number Diff line number Diff line change
Expand Up @@ -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" */
Expand Down

0 comments on commit 01ab7b5

Please sign in to comment.