Skip to content

Commit

Permalink
Fix include of makePyConstructor inside pxr ns.
Browse files Browse the repository at this point in the history
* Adjusts pxr namespace and Tf_MakePyConstructor not to wrap the import from within
  the opened scopes, but to instead open the namespaced scopes upon each individual
  independent iteration on BOOST_PP_ITERATE.
* Without this fix we recieve the following:
  error: redundant #include of module 'Tf' appears within namespace 'Pixar::Tf_MakePyConstructor':
  #include BOOST_PP_FILENAME_1
  ^
  Tf/makePyConstructor.h:108:1: note: namespace 'Pixar::Tf_MakePyConstructor' begins here:
  namespace Tf_MakePyConstructor {
  • Loading branch information
furby-tm committed Mar 15, 2024
1 parent 738019d commit 02a94c4
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/wabiverse/MetaverseKit",
"state" : {
"revision" : "0b302a0a6866d711ea67fc1d44b1e3cb561b3d68",
"version" : "1.5.9"
"revision" : "ef077ac89695d23e7843e37305fc3bb5ea32205d",
"version" : "1.6.0"
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ let package = Package(
),
],
dependencies: [
.package(url: "https://github.com/wabiverse/MetaverseKit", from: "1.5.9"),
.package(url: "https://github.com/wabiverse/MetaverseKit", from: "1.6.0"),
.package(url: "https://github.com/furby-tm/swift-bundler", from: "2.0.9"),
.package(url: "https://github.com/apple/swift-log.git", from: "1.5.3"),
.package(url: "https://github.com/apple/swift-syntax.git", from: "509.0.0"),
Expand Down
17 changes: 15 additions & 2 deletions Sources/Tf/include/Tf/makePyConstructor.h
Original file line number Diff line number Diff line change
Expand Up @@ -306,14 +306,18 @@ template <typename SIG> struct InitCtorWithBackReference;
template <typename SIG> struct InitCtorWithVarArgs;
template <typename SIG> struct NewCtor;
template <typename SIG> struct NewCtorWithClassReference;
} // namespace Tf_MakePyConstructor

PXR_NAMESPACE_CLOSE_SCOPE

#define BOOST_PP_ITERATION_LIMITS (0, TF_MAX_ARITY)
#define BOOST_PP_FILENAME_1 "Tf/makePyConstructor.h"
#include BOOST_PP_ITERATE()
/* comment needed for scons dependency scanner
#include "Tf/makePyConstructor.h"
*/

} // namespace Tf_MakePyConstructor
PXR_NAMESPACE_OPEN_SCOPE

template <typename T>
Tf_MakePyConstructor::InitVisitor<typename Tf_MakePyConstructor::InitCtor<T>>
Expand Down Expand Up @@ -406,6 +410,11 @@ PXR_NAMESPACE_CLOSE_SCOPE

#else // BOOST_PP_IS_ITERATING

PXR_NAMESPACE_OPEN_SCOPE

namespace Tf_MakePyConstructor
{

#define N BOOST_PP_ITERATION()

#define SIGNATURE R(BOOST_PP_ENUM_PARAMS(N, A))
Expand Down Expand Up @@ -587,7 +596,7 @@ struct NewCtorWithClassReference<SIGNATURE> : CtorBase<SIGNATURE> {
}
};

#endif
#endif /* N > 0 */

#undef N
#undef SIGNATURE
Expand All @@ -598,4 +607,8 @@ struct NewCtorWithClassReference<SIGNATURE> : CtorBase<SIGNATURE> {
#undef ARG_TYPE_STR_A
#undef EXTRACT_REQ_ARG_A

} // namespace Tf_MakePyConstructor

PXR_NAMESPACE_CLOSE_SCOPE

#endif // BOOST_PP_IS_ITERATING

0 comments on commit 02a94c4

Please sign in to comment.