mirror of
https://github.com/openharmony/third_party_spirv-headers.git
synced 2026-07-19 23:03:32 -04:00
Merge pull request #261 from ProkopRandacek/master
Include bool type if not already defined
This commit is contained in:
@@ -1856,6 +1856,9 @@ typedef enum SpvOp_ {
|
||||
} SpvOp;
|
||||
|
||||
#ifdef SPV_ENABLE_UTILITY_CODE
|
||||
#ifndef __cplusplus
|
||||
#include <stdbool.h>
|
||||
#endif
|
||||
inline void SpvHasResultAndType(SpvOp opcode, bool *hasResult, bool *hasResultType) {
|
||||
*hasResult = *hasResultType = false;
|
||||
switch (opcode) {
|
||||
|
||||
@@ -1852,6 +1852,9 @@ enum Op {
|
||||
};
|
||||
|
||||
#ifdef SPV_ENABLE_UTILITY_CODE
|
||||
#ifndef __cplusplus
|
||||
#include <stdbool.h>
|
||||
#endif
|
||||
inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) {
|
||||
*hasResult = *hasResultType = false;
|
||||
switch (opcode) {
|
||||
|
||||
@@ -1852,6 +1852,9 @@ enum class Op : unsigned {
|
||||
};
|
||||
|
||||
#ifdef SPV_ENABLE_UTILITY_CODE
|
||||
#ifndef __cplusplus
|
||||
#include <stdbool.h>
|
||||
#endif
|
||||
inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) {
|
||||
*hasResult = *hasResultType = false;
|
||||
switch (opcode) {
|
||||
|
||||
@@ -513,6 +513,9 @@ namespace {
|
||||
}
|
||||
|
||||
out << "#ifdef SPV_ENABLE_UTILITY_CODE" << std::endl;
|
||||
out << "#ifndef __cplusplus" << std::endl;
|
||||
out << "#include <stdbool.h>" << std::endl;
|
||||
out << "#endif" << std::endl;
|
||||
out << "inline void " << pre() << "HasResultAndType(" << pre() << opName << " opcode, bool *hasResult, bool *hasResultType) {" << std::endl;
|
||||
out << " *hasResult = *hasResultType = false;" << std::endl;
|
||||
out << " switch (opcode) {" << std::endl;
|
||||
|
||||
Reference in New Issue
Block a user