Skip to content

Commit

Permalink
Fix attributes & missing include on microsoft windows.
Browse files Browse the repository at this point in the history
Signed-off-by: furby™ <devs@wabi.foundation>
  • Loading branch information
furby-tm committed Aug 28, 2024
1 parent 90faf23 commit ce77e3a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
22 changes: 11 additions & 11 deletions Sources/Arch/include/Arch/attributes.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions Sources/UsdVol/field3DAsset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit ce77e3a

Please sign in to comment.