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

Add TF_PP_SEQ_FOR_EACH and TF_PP_SEQ_SIZE macros #2833

Merged
merged 1 commit into from
Dec 15, 2023

Conversation

nvmkuruc
Copy link
Collaborator

@nvmkuruc nvmkuruc commented Nov 28, 2023

Description of Change(s)

This PR adds TF_PP_SEQ_FOR_EACH and TF_PP_SEQ_SIZE which can operate on sequences of parenthetically separated elements. ((x)(y)(z)(w) is a sequence of four elements: x, y, z, and w). Their implementation is similar to their variadic counterparts. They are aided by two new private helpers _TF_PP_SEQ_HEAD and _TF_PP_SEQ_TAIL which can be used to pop the first element off the sequence and apply an operation like a macro.

pyStaticTokens.h requires a global data argument for TF_PP_SEQ_FOR_EACH even though it's generally unused. A future PR will update the static token macros to use TF_PP_SEQ_FOR_EACH.

As the sequence operations support the static token macros, they need to support more elements than their variadic equivalents. (HdTokens currently contains over eighty tokens.) The chosen macro's size limit of 229 is underneath the MSVC's recursive macro limit of 256.

Fixes Issue(s)

  • I have verified that all unit tests pass with the proposed changes
  • I have submitted a signed Contributor License Agreement

@jesschimein
Copy link
Collaborator

Filed as internal issue #USD-9002

@pixar-oss pixar-oss merged commit 89ca16f into PixarAnimationStudios:dev Dec 15, 2023
5 checks passed
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.

3 participants