Allow extern mode for redismodule.h #6330
Closed
mnunberg wants to merge 2 commits intoredis:unstablefrom
Closed
Conversation
This fixes the redismodule.h file to use proper extern semantics, where symbols are only declared in the header file, but defined in a source file elsewhere. This functionality is by default disabled unless the symbol `REDISMODULE_USE_EXTERN` is defined in the preprocessor. When `REDISMODULE_USE_EXTERN` is defined, the `RedisModule_XXX` functions are declared as `extern`, meaning they are simply declarations for the function pointers. The user needs to define them somewhere else, using the `REDISMODULE_INIT_SYMBOLS()` macro. This should be done once and only once, in a source file, for the entire executable or library.
This confuses C++ applications
Contributor
Author
Contributor
Author
Contributor
|
The version here: https://github.com/RedisLabs/RedisModulesSDK/blob/rafi-modsdk1/redismodule.h |
rafie
added a commit
to rafie/redis
that referenced
this pull request
Nov 20, 2019
* Introduced REDISMODULE_INIT_SYMBOLS macro, to allow including redismodule.h in several source files (this is a breaking change) * Avoid double-mentions of APIs by using X-macro * Support inclusion from C++ sources See also redis#6330
rafie
added a commit
to rafie/redis
that referenced
this pull request
Nov 22, 2019
* Introduced REDISMODULE_INIT_SYMBOLS macro, to allow including redismodule.h in several source files (this is a breaking change) * Avoid double-mentions of APIs by using X-macro * Support inclusion from C++ sources See also redis#6330
rafie
added a commit
to rafie/redis
that referenced
this pull request
Nov 28, 2019
* Allow including redismodule.h in several source files, by declaring API function vars weak [i.e., __attribute__ ((weak))]. * Avoid double-mentions of APIs by using X-macro acrobatics * Allow for API extensions via REDISMODULE_XAPI_EXTENSIONS macro * Removed explicit REGISTER_API-s from module.c * Support inclusion from C++ sources See also redis#6330
Member
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.