Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix signature of prototypes of FbcSpeciesPlugin #189

Merged
merged 3 commits into from
Dec 22, 2021

Conversation

giordano
Copy link
Contributor

Description

There is a mismatch between the signature of these functions in the header
files (here they use SBasePlugin_t * fbc) and their implementations (here they
use FbcSBasePlugin_t * fbc), as a result the C API does not correctly export
these functions because they get C++ name mangling.

The change was introduced in 64763c3 without the corresponding change in the header file.

Motivation and Context

Issue reported in #182 (comment). See JuliaPackaging/Yggdrasil#4100 (comment) for a confirmation that this patch fixes the issue.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Change in documentation

Checklist:

  • I have updated all documentation necessary.
  • I have checked spelling in (new) comments.

Testing

  • Testing is done automatically and codecov shows test coverage
  • This cannot be tested automatically

There is a mismatch between the signature of these functions in the header
files (here they use `SBasePlugin_t * fbc`) and their implementations (here they
use `FbcSBasePlugin_t * fbc`), as a result the C API does not correctly export
these functions because they get C++ name mangling.
@fbergmann
Copy link
Member

thanks

@giordano
Copy link
Contributor Author

Uhm, FbcReactionPlugin_unsetLowerFluxBound is completely missing the prototype in src/sbml/packages/fbc/extension/FbcReactionPlugin.h 🤔

@giordano
Copy link
Contributor Author

Ok, with the latest patch I get:

% nm  x86_64-linux-gnu-cxx11/lib/libsbml.so | grep 'Fbc.*Plugin_'
00000000004c01c0 T FbcModelPlugin_addFluxBound
00000000004c0490 T FbcModelPlugin_addGeneProduct
00000000004c0220 T FbcModelPlugin_addObjective
00000000004c5700 T FbcModelPlugin_addUserDefinedConstraint
00000000004c2a30 T FbcModelPlugin_createUserDefinedConstraint
00000000004c0280 T FbcModelPlugin_getActiveObjectiveId
00000000004c01e0 T FbcModelPlugin_getFluxBound
00000000004c04b0 T FbcModelPlugin_getGeneProduct
00000000004c04f0 T FbcModelPlugin_getListOfUserDefinedConstraints
00000000004c0200 T FbcModelPlugin_getNumFluxBounds
00000000004c04d0 T FbcModelPlugin_getNumGeneProducts
00000000004c0260 T FbcModelPlugin_getNumObjectives
00000000004c0770 T FbcModelPlugin_getNumUserDefinedConstraints
00000000004c0240 T FbcModelPlugin_getObjective
00000000004c0790 T FbcModelPlugin_getStrict
00000000004c5340 T FbcModelPlugin_getUserDefinedConstraint
00000000004c5380 T FbcModelPlugin_getUserDefinedConstraintById
00000000004c0510 T FbcModelPlugin_getUserDefinedConstraintByLowerBound
00000000004c0640 T FbcModelPlugin_getUserDefinedConstraintByUpperBound
00000000004c5740 T FbcModelPlugin_removeUserDefinedConstraint
00000000004c5820 T FbcModelPlugin_removeUserDefinedConstraintById
00000000004c0360 T FbcModelPlugin_setActiveObjectiveId
00000000004c07d0 T FbcModelPlugin_setStrict
00000000004c76c0 T FbcReactionPlugin_getGeneProductAssociation
00000000004c72c0 T FbcReactionPlugin_getLowerFluxBound
00000000004c6ef0 T FbcReactionPlugin_getUpperFluxBound
00000000004c7690 T FbcReactionPlugin_isSetGeneProductAssociation
00000000004c7360 T FbcReactionPlugin_isSetLowerFluxBound
00000000004c6f90 T FbcReactionPlugin_isSetUpperFluxBound
00000000004c76e0 T FbcReactionPlugin_setGeneProductAssociation
00000000004c73b0 T FbcReactionPlugin_setLowerFluxBound
00000000004c6fe0 T FbcReactionPlugin_setUpperFluxBound
00000000004c7630 T FbcReactionPlugin_unsetLowerFluxBound
00000000004c7260 T FbcReactionPlugin_unsetUpperFluxBound
00000000004cb980 T FbcSBasePlugin_addKeyValuePair
00000000004cb5d0 T FbcSBasePlugin_createKeyValuePair
00000000004cb690 T FbcSBasePlugin_getKeyValuePair
00000000004cb6d0 T FbcSBasePlugin_getKeyValuePairById
00000000004caeb0 T FbcSBasePlugin_getListOfKeyValuePairs
00000000004caed0 T FbcSBasePlugin_getNumKeyValuePairs
00000000004cb9c0 T FbcSBasePlugin_removeKeyValuePair
00000000004cba30 T FbcSBasePlugin_removeKeyValuePairById
00000000004cd0c0 T FbcSpeciesPlugin_getCharge
00000000004cd100 T FbcSpeciesPlugin_getChargeAsDouble
00000000004cd2a0 T FbcSpeciesPlugin_getChemicalFormula
00000000004cd140 T FbcSpeciesPlugin_isSetCharge
00000000004cd340 T FbcSpeciesPlugin_isSetChemicalFormula
00000000004cd190 T FbcSpeciesPlugin_setCharge
00000000004cd1d0 T FbcSpeciesPlugin_setChargeAsDouble
00000000004cd390 T FbcSpeciesPlugin_setChemicalFormula
00000000004cd210 T FbcSpeciesPlugin_unsetCharge
00000000004cd530 T FbcSpeciesPlugin_unsetChemicalFormula

All Fbc*Plugin C symbols seem to be exported correctly now.

Copy link
Member

@fbergmann fbergmann left a comment

Choose a reason for hiding this comment

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

thank you for catching these

@fbergmann fbergmann merged commit 78df833 into sbmlteam:development Dec 22, 2021
@giordano giordano deleted the mg/fbcspeciesplugin-c-api branch December 22, 2021 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants