Skip to content

Commit

Permalink
Tick-tock header functions
Browse files Browse the repository at this point in the history
Signed-off-by: methylDragon <[email protected]>
  • Loading branch information
methylDragon committed Jun 8, 2022
1 parent cd564fe commit 75eab9e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
3 changes: 3 additions & 0 deletions Migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ but with improved human-readability..
- **sdf/Types.hh**: The `Inertia` class has been deprecated. Please use the
`Inertial` class in the `gz-math` library.

- `ignitionVersion()` is deprecated and will be removed in future versions.
Use `gzVersion()` instead.

## libsdformat 11.x to 12.0

An error is now emitted instead of a warning for a file containing more than
Expand Down
8 changes: 4 additions & 4 deletions src/cmd/cmdsdformat.rb.in
Original file line number Diff line number Diff line change
Expand Up @@ -193,12 +193,12 @@ class Cmd
end

# Read the library version.
Importer.extern 'char* ignitionVersion()'
Importer.extern 'char* gzVersion()'
begin
plugin_version = Importer.ignitionVersion.to_s
plugin_version = Importer.gzVersion.to_s
rescue DLError
puts "Library error: Problem running 'ignitionVersion()' from #{plugin}."
exit(-1)
puts "Library error: Problem running 'gzVersion()' from #{plugin}."
exit(-1)
end

# Sanity check: Verify that the version of the yaml file matches the version
Expand Down
7 changes: 6 additions & 1 deletion src/ign.cc
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ extern "C" SDFORMAT_VISIBLE int cmdCheck(const char *_path)
}

//////////////////////////////////////////////////
extern "C" SDFORMAT_VISIBLE char *ignitionVersion()
extern "C" SDFORMAT_VISIBLE char *gzVersion()
{
#ifdef _MSC_VER
return _strdup(SDF_VERSION_FULL);
Expand All @@ -115,6 +115,11 @@ extern "C" SDFORMAT_VISIBLE char *ignitionVersion()
#endif
}

extern "C" SDFORMAT_VISIBLE char *ignitionVersion()
{
return gzVersion();
}

//////////////////////////////////////////////////
/// \brief Print the full description of the SDF spec.
/// \return 0 on success, -1 if SDF could not be initialized.
Expand Down
3 changes: 2 additions & 1 deletion src/ign.hh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ extern "C" SDFORMAT_VISIBLE int cmdCheck(const char *_path);

/// \brief External hook to read the library version.
/// \return C-string representing the version. Ex.: 0.1.2
extern "C" SDFORMAT_VISIBLE char *ignitionVersion();
extern "C" SDFORMAT_VISIBLE char SDF_DEPRECATED(13) *ignitionVersion();
extern "C" SDFORMAT_VISIBLE char *gzVersion();
}

#endif

0 comments on commit 75eab9e

Please sign in to comment.