diff --git a/pxr/base/arch/attributes.h b/pxr/base/arch/attributes.h index 41499eeb5e..ec2ea91f84 100644 --- a/pxr/base/arch/attributes.h +++ b/pxr/base/arch/attributes.h @@ -254,6 +254,17 @@ struct Arch_ConstructorEntry { }; \ 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) # include "pxr/base/arch/api.h" @@ -312,17 +323,6 @@ 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/pxr/base/tf/preprocessorUtils.h b/pxr/base/tf/preprocessorUtils.h index 9bb1aa836d..188889be27 100644 --- a/pxr/base/tf/preprocessorUtils.h +++ b/pxr/base/tf/preprocessorUtils.h @@ -46,7 +46,7 @@ #include #include #include -#if defined(ARCH_OS_WINDOWS) +#if defined(ARCH_COMPILER_MSVC) #include #include #include @@ -66,7 +66,7 @@ ARCH_PRAGMA_MACRO_TOO_FEW_ARGUMENTS /// /// \ingroup group_tf_Preprocessor /// \hideinitializer -#if defined(ARCH_OS_WINDOWS) +#if defined(ARCH_COMPILER_MSVC) #define TF_NUM_ARGS(...) \ BOOST_PP_IIF(BOOST_VMD_IS_EMPTY(__VA_ARGS__),\ 0, BOOST_PP_VARIADIC_SIZE(__VA_ARGS__)) @@ -189,7 +189,7 @@ ARCH_PRAGMA_MACRO_TOO_FEW_ARGUMENTS /// Exapnds to 1 if the argument is a tuple, and 0 otherwise. /// \ingroup group_tf_Preprocessor /// \hideinitializer -#if defined(ARCH_OS_WINDOWS) +#if defined(ARCH_COMPILER_MSVC) #define TF_PP_IS_TUPLE(sequence) \ BOOST_VMD_IS_TUPLE(sequence) #else diff --git a/pxr/usd/ar/asset.h b/pxr/usd/ar/asset.h index 20c1197e62..af332e52cd 100644 --- a/pxr/usd/ar/asset.h +++ b/pxr/usd/ar/asset.h @@ -45,10 +45,8 @@ class ArAsset { AR_API virtual ~ArAsset(); - AR_API ArAsset(const ArAsset&) = delete; - AR_API ArAsset& operator=(const ArAsset&) = delete; /// Returns size of the asset. diff --git a/pxr/usd/sdf/fileFormat.h b/pxr/usd/sdf/fileFormat.h index aea65cdbfc..0dff2c420f 100644 --- a/pxr/usd/sdf/fileFormat.h +++ b/pxr/usd/sdf/fileFormat.h @@ -256,7 +256,7 @@ class SdfFileFormat : public TfRefBase, public TfWeakBase, boost::noncopyable const SdfSchemaBase& schema); /// Disallow temporary SdfSchemaBase objects being passed to the c'tor. - SDF_API SdfFileFormat( + SdfFileFormat( const TfToken& formatId, const TfToken& versionString, const TfToken& target, @@ -280,7 +280,7 @@ class SdfFileFormat : public TfRefBase, public TfWeakBase, boost::noncopyable const SdfSchemaBase& schema); /// Disallow temporary SdfSchemaBase objects being passed to the c'tor. - SDF_API SdfFileFormat( + SdfFileFormat( const TfToken& formatId, const TfToken& versionString, const TfToken& target,