Skip to content

Commit

Permalink
Remove assert.h include from DxilPipelineStateValidation.h
Browse files Browse the repository at this point in the history
DxilPipelineStateValidation.h is included from multiple environments. Don't include assert.h in it, otherwise it might overwrite the custom assert in the code that includes DxilPipelineStateValidation.h.

This fixes #6922
  • Loading branch information
lizhengxing committed Sep 19, 2024
1 parent e1bb926 commit 18751fd
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 6 deletions.
11 changes: 5 additions & 6 deletions include/dxc/DxilContainer/DxilPipelineStateValidation.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,19 @@
#ifndef __DXIL_PIPELINE_STATE_VALIDATION__H__
#define __DXIL_PIPELINE_STATE_VALIDATION__H__

// Don't include assert.h here.
// Since this header is included from multiple environments,
// it is necessary to define assert before this header is included.
// #include <assert.h>

#include "dxc/WinAdapter.h"
#include <assert.h>
#include <cstring>
#include <stdint.h>

namespace llvm {
class raw_ostream;
}

// Don't include assert.h here.
// Since this header is included from multiple environments,
// it is necessary to define assert before this header is included.
// #include <assert.h>

#ifndef UINT_MAX
#define UINT_MAX 0xffffffff
#endif
Expand Down
2 changes: 2 additions & 0 deletions lib/DxilContainer/DxilPipelineStateValidation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
// //
///////////////////////////////////////////////////////////////////////////////

#include <assert.h> // Needed for DxilPipelineStateValidation.h

#include "dxc/DxilContainer/DxilPipelineStateValidation.h"
#include "dxc/DXIL/DxilModule.h"
#include "dxc/DXIL/DxilResource.h"
Expand Down
2 changes: 2 additions & 0 deletions lib/DxilContainer/DxilRDATBuilder.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include <assert.h> // Needed for DxilPipelineStateValidation.h

#include "dxc/DxilContainer/DxilRDATBuilder.h"
#include "dxc/DxilContainer/DxilPipelineStateValidation.h"
#include "dxc/Support/FileIOHelper.h"
Expand Down
1 change: 1 addition & 0 deletions lib/DxilValidation/DxilContainerValidation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include "DxilValidationUtils.h"

#include <memory>
#include <assert.h> // Needed for DxilPipelineStateValidation.h

using std::unique_ptr;
using std::unordered_set;
Expand Down
1 change: 1 addition & 0 deletions lib/HLSL/DxcOptimizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
#include <algorithm>
#include <list> // should change this for string_table
#include <vector>
#include <assert.h> // Needed for DxilPipelineStateValidation.h

#include "llvm/PassPrinters/PassPrinters.h"

Expand Down
2 changes: 2 additions & 0 deletions tools/clang/tools/dxa/dxa.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
// //
///////////////////////////////////////////////////////////////////////////////

#include <assert.h> // Needed for DxilPipelineStateValidation.h

#include "dxc/Support/Global.h"
#include "dxc/Support/Unicode.h"
#include "dxc/Support/WinIncludes.h"
Expand Down
1 change: 1 addition & 0 deletions tools/clang/unittests/HLSL/OptimizerTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <sstream>
#include <string>
#include <vector>
#include <assert.h> // Needed for DxilPipelineStateValidation.h

// For DxilRuntimeReflection.h:
#include "dxc/Support/WinIncludes.h"
Expand Down

0 comments on commit 18751fd

Please sign in to comment.