diff --git a/Sources/Arch/include/Arch/attributes.h b/Sources/Arch/include/Arch/attributes.h index cf436a251..78d57ac5c 100644 --- a/Sources/Arch/include/Arch/attributes.h +++ b/Sources/Arch/include/Arch/attributes.h @@ -249,17 +249,6 @@ struct Arch_ConstructorEntry { _priority}; \ static void _name(__VA_ARGS__) -#elif defined(ARCH_COMPILER_GCC) || defined(ARCH_COMPILER_CLANG) - -// The used attribute is required to prevent these apparently unused functions -// from being removed by the linker. -# define ARCH_CONSTRUCTOR(_name, _priority, ...) \ - __attribute__((used, section(".pxrctor"), constructor((_priority) + 100))) static void _name( \ - __VA_ARGS__) -# define ARCH_DESTRUCTOR(_name, _priority, ...) \ - __attribute__((used, section(".pxrdtor"), destructor((_priority) + 100))) static void _name( \ - __VA_ARGS__) - #elif defined(ARCH_OS_WINDOWS) // Entry for a constructor/destructor in the custom section. @@ -309,6 +298,17 @@ struct Arch_ConstructorInit { _ARCH_ENSURE_PER_LIB_INIT(Arch_ConstructorInit, _archCtorInit); \ static void _name(__VA_ARGS__) +#elif defined(ARCH_COMPILER_GCC) || defined(ARCH_COMPILER_CLANG) + +// The used attribute is required to prevent these apparently unused functions +// from being removed by the linker. +# define ARCH_CONSTRUCTOR(_name, _priority, ...) \ + __attribute__((used, section(".pxrctor"), constructor((_priority) + 100))) static void _name( \ + __VA_ARGS__) +# define ARCH_DESTRUCTOR(_name, _priority, ...) \ + __attribute__((used, section(".pxrdtor"), destructor((_priority) + 100))) static void _name( \ + __VA_ARGS__) + #else // Leave macros undefined so we'll fail to build on a new system/compiler diff --git a/Sources/UsdVol/field3DAsset.cpp b/Sources/UsdVol/field3DAsset.cpp index 8085c506f..4528c23f4 100644 --- a/Sources/UsdVol/field3DAsset.cpp +++ b/Sources/UsdVol/field3DAsset.cpp @@ -11,6 +11,8 @@ #include "Sdf/assetPath.h" #include "Sdf/types.h" +#include "Tf/registryManager.h" + PXR_NAMESPACE_OPEN_SCOPE // Register the schema with the TfType system.