Skip to content
This repository has been archived by the owner on Aug 30, 2022. It is now read-only.

Upgrade dynamic loading API #120

Merged
merged 7 commits into from
Aug 6, 2018
Merged

Conversation

isaachier
Copy link
Contributor

Which problem is this PR solving?

Short description of the changes

  • Update Hunter and upgrade dynamic loading API.

*errorCategory = static_cast<const void*>(
if (std::strcmp(opentracing_version, OPENTRACING_VERSION) != 0 ||
std::strcmp(opentracing_abi_version, OPENTRACING_ABI_VERSION) != 0) {
*error_category = static_cast<const void*>(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you want std::strcmp(opentracing_version, OPENTRACING_VERSION) != 0 in the comparison.

The point of adding the ABI version was to allow the plugin to work with other versions of OT if there's no ABI breakage.

The version is only passed in for the case that you might have some sort of incompatible semantic change in the future.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point.

const char* opentracing_abi_version,
const void** error_category,
void* error_message,
void** tracer_factory);
Copy link
Contributor

@rnburn rnburn Aug 1, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need this function exposed. The macro OPENTRACING_DECLARE_IMPL_FACTORY declares a variable function pointer (See for example how it's done in the LS tracer: https://github.com/lightstep/lightstep-tracer-cpp/blob/master/src/dynamic_load.cpp#L6)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the example!

@isaachier
Copy link
Contributor Author

@rnburn do you mind checking if everything looks OK? Thanks in advance.

{
assert(errorCategory != nullptr);
assert(tracerFactory != nullptr);
#ifndef JAEGERTRACING_WITH_YAML_CPP
*errorCategory =
static_cast<const void*>(&opentracing::dynamic_load_error_category());
static_cast<const void*>(&opentracing::dynamic_load_errorCategory());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dynamic_load_errorCategory?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lol I was camelcasing this stuff an must have messed that up. Surprised this built...

Signed-off-by: Isaac Hier <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants