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

pegtl: fix namespace problems #3282

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion pxr/base/pegtl/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ This file defines the namespace name that PEGTL uses:
#include "pxr/pxr.h"

#if PXR_USE_NAMESPACES
#define PXR_PEGTL_NAMESPACE PXR_INTERNAL_NS ## _pegtl
#define PXR_PEGTL_impl_PASTE2(x, y) x ## y
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could TF_PP_CAT be used instead?

#define PXR_PEGTL_impl_PASTE(x, y) PXR_PEGTL_impl_PASTE2(x, y)
#define PXR_PEGTL_NAMESPACE PXR_PEGTL_impl_PASTE(PXR_INTERNAL_NS, _pegtl)
#else
#define PXR_PEGTL_NAMESPACE pxr_pegtl
#endif
Expand Down
3 changes: 3 additions & 0 deletions pxr/base/pegtl/build-workaround.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,8 @@
// adding this, an "empty" .so gets built and other libs can link it.

#include "pxr/base/arch/export.h"
#include "pxr/base/pegtl/pegtl/config.hpp"

namespace PXR_PEGTL_NAMESPACE {
ARCH_EXPORT int __pxr_pegtl_workaround__;
}
4 changes: 3 additions & 1 deletion pxr/base/pegtl/pegtl/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
#include "pxr/pxr.h"

#if PXR_USE_NAMESPACES
#define PXR_PEGTL_NAMESPACE PXR_INTERNAL_NS ## _pegtl
#define PXR_PEGTL_impl_PASTE2(x, y) x ## y
#define PXR_PEGTL_impl_PASTE(x, y) PXR_PEGTL_impl_PASTE2(x, y)
#define PXR_PEGTL_NAMESPACE PXR_PEGTL_impl_PASTE(PXR_INTERNAL_NS, _pegtl)
#else
#define PXR_PEGTL_NAMESPACE pxr_pegtl
#endif
Expand Down