Skip to content
New issue

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

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

Already on GitHub? # to your account

Remove the flag BASE from string_utilities.h #837

Merged
merged 6 commits into from
Feb 13, 2023

Conversation

bcoconni
Copy link
Member

For some reasons the file string_utilities.h was meant to be used both as a header and as a c++ source file. The flag BASE had to be defined when the source code of the functions was to be compiled. Otherwise, when BASE was not defined, only the function signatures were used as if the file was a "pure" header file. This was like so since the file string_utilities.h had been included in JSBSim in June 2009.

This PR is meant to remove this unusual process: string_utilities is split into a pair of .h and .cpp files just like the rest of the code base.

  • Only function signatures are kept in string_utilities.h
  • The C++ code is moved in string_utilities.cpp
  • The flag BASE is removed from the code base.
  • All the functions from string_utilities.h are prepended by JSBSIM_API to allow calling them in unit tests while JSBSim is compiled as a DLL.
  • Because all the functions are now exported, they have been moved to the JSBSim namespace to avoid name collisions with other libraries.

@codecov
Copy link

codecov bot commented Feb 12, 2023

Codecov Report

Merging #837 (c875e39) into master (08a3ae5) will not change coverage.
The diff coverage is 98.11%.

@@           Coverage Diff           @@
##           master     #837   +/-   ##
=======================================
  Coverage   22.37%   22.37%           
=======================================
  Files         168      167    -1     
  Lines       19535    19535           
=======================================
  Hits         4371     4371           
  Misses      15164    15164           
Impacted Files Coverage Δ
src/FGJSBBase.cpp 87.50% <ø> (ø)
src/input_output/FGXMLElement.cpp 47.33% <ø> (ø)
src/input_output/FGfdmSocket.cpp 0.00% <ø> (ø)
src/input_output/string_utilities.cpp 97.36% <98.11%> (+1.71%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@agodemar agodemar merged commit ec99f79 into JSBSim-Team:master Feb 13, 2023
@bcoconni bcoconni deleted the remove_BASE_flag branch February 13, 2023 19:51
bcoconni added a commit to bcoconni/jsbsim that referenced this pull request Apr 8, 2023
* Remove the BASE flag.

* Remove locale specific tests.

* Code clean up

* Fix DLL import for MinGW.

* Further fixes for MinGW.

* Simplify the build of unit tests.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants