Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • sight sight
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 121
    • Issues 121
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 13
    • Merge requests 13
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Sight
  • sightsight
  • Merge requests
  • !871

fix(io): serializer registration is not unique

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Michaël KUGLER requested to merge 1027-fix-io-serializer-registration-is-not-unique into dev Jan 24, 2023
  • Overview 1
  • Commits 1
  • Pipelines 1
  • Changes 1

Description

SIGHT_REGISTER_SERIALIZER macro is originally made unique based on the LINE keyword, which refers to the line number in the file, where the macro is situated. This works well for declaring the variable inside because it is static, thus we ensure it does not conflict inside the compile target. However, this is also used to make the class declaration unique, but it may not if the line number is identical inside the compile target.

As release inlines all, the line is different each time, and it can work fine.

For debug, if the macro is at the same line number, the macro is no more unique.

To solve this, we reused the same pattern used in other registration macro. The class declaration is made unique thanks to a template specialisation with the registered data type.

Closes #1027 (closed)

How to test it?

Put SIGHT_REGISTER_SERIALIZER on the same line in two different data with serialization and verify that both serializers are registered.

Edited Jan 24, 2023 by Flavien BRIDAULT
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: 1027-fix-io-serializer-registration-is-not-unique