Skip to content

Commit

Permalink
Conditionally include <assert.h> in DxilPipelineStateValidation.h (#6925
Browse files Browse the repository at this point in the history
)

DxilPipelineStateValidation.h is included from multiple environments.
Conditionally include <assert.h> here is to avoid overwriting the assert
that's using by the code which includes this header.

Fixes #6922
  • Loading branch information
lizhengxing authored Sep 19, 2024
1 parent 26ea670 commit 9bfbee6
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions include/dxc/DxilContainer/DxilPipelineStateValidation.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,23 @@
#ifndef __DXIL_PIPELINE_STATE_VALIDATION__H__
#define __DXIL_PIPELINE_STATE_VALIDATION__H__

// ------ Don't unconditionally #include <assert.h> here --------
// Since this header is included from multiple environments,
// Conditionally include <assert.h> here is to avoid overwriting
// the assert that's using by the code which includes this header.
//

#include "dxc/WinAdapter.h"
#ifndef assert
#include <assert.h>
#endif
#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

0 comments on commit 9bfbee6

Please sign in to comment.