Skip to content

Commit f6fc459

Browse files
committed
SceneCacheFileFormat : Fix MSVC "warning C4003: not enough arguments for function-like macro invocation
- This came back after upgrading to MSVC 2019 and the latest USD. Despite USD trying to handle suppressing this warning, it seems to be stubborn and continues to be raised without further efforts. - Using `ARCH_PRAGMA_*` is a bit cleaner and gracefully degrades to a no-op on non-Windows builds.
1 parent c9e1bc3 commit f6fc459

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

contrib/IECoreUSD/src/IECoreUSD/SceneCacheFileFormat.cpp

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@
4949
#include "pxr/base/tf/registryManager.h"
5050
#include "pxr/base/tf/staticData.h"
5151

52+
ARCH_PRAGMA_PUSH
53+
ARCH_PRAGMA_MACRO_TOO_FEW_ARGUMENTS
54+
5255
#include "pxr/pxr.h"
5356

5457
#include "pxr/usd/sdf/layer.h"
@@ -57,6 +60,8 @@
5760
#include "pxr/usd/usd/usdaFileFormat.h"
5861
#include "pxr/usd/usdGeom/tokens.h"
5962

63+
ARCH_PRAGMA_POP
64+
6065
#include "boost/assign.hpp"
6166

6267
#include <iostream>
@@ -73,13 +78,12 @@ using std::string;
7378
// to be accessible.
7479
PXR_NAMESPACE_OPEN_SCOPE
7580

76-
#ifdef _MSC_VER
77-
#pragma warning( disable:4003 ) // Following USD's lead, disable warning about not enough parameters for macro
78-
#endif
81+
ARCH_PRAGMA_PUSH
82+
ARCH_PRAGMA_MACRO_TOO_FEW_ARGUMENTS
83+
7984
TF_DEFINE_PUBLIC_TOKENS( UsdSceneCacheFileFormatTokens, USD_SCENE_CACHE_FILE_FORMAT_TOKENS );
80-
#ifdef _MSC_VER
81-
#pragma warning( default:4003 )
82-
#endif
85+
86+
ARCH_PRAGMA_POP
8387

8488
TF_REGISTRY_FUNCTION(TfType)
8589
{

0 commit comments

Comments
 (0)