Skip to content

Commit cb5f98a

Browse files
committed
libc: Rename ERROR to RPC_ERROR to avoid conflict in windows build
Somehow conflict with define in wingdi.h. Fix build failures: [ 52%] Building CXX object projects/offload/plugins-nextgen/common/CMakeFiles/PluginCommon.dir/src/RPC.cpp.obj In file included from ...llvm\offload\plugins-nextgen\common\src\RPC.cpp:16: ...\llvm\libc\shared\rpc.h(48,3): error: expected identifier 48 | ERROR = 0x1000, | ^ c:\Program files (x86)\Windows Kits\10\include\10.0.22000.0\um\wingdi.h(118,29): note: expanded from macro 'ERROR' 118 | #define ERROR 0 | ^ ...\llvm\offload\plugins-nextgen\common\src\RPC.cpp(75,17): error: expected unqualified-id 75 | return rpc::ERROR; | ^ c:\Program files (x86)\Windows Kits\10\include\10.0.22000.0\um\wingdi.h(118,29): note: expanded from macro 'ERROR' 118 | #define ERROR 0 | ^ 2 errors generated.
1 parent 61ab36a commit cb5f98a

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

libc/shared/rpc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ namespace rpc {
4545
/// Generic codes that can be used whem implementing the server.
4646
enum Status {
4747
SUCCESS = 0x0,
48-
ERROR = 0x1000,
48+
RPC_ERROR = 0x1000,
4949
UNHANDLED_OPCODE = 0x1001,
5050
};
5151

libc/utils/gpu/server/rpc_server.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ rpc::Status handle_libc_opcodes(rpc::Server::Port &port, uint32_t num_lanes) {
455455
case 64:
456456
return handle_port_impl<64>(port);
457457
default:
458-
return rpc::ERROR;
458+
return rpc::RPC_ERROR;
459459
}
460460
}
461461
} // namespace rpc

offload/plugins-nextgen/common/src/RPC.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ static rpc::Status handle_offload_opcodes(plugin::GenericDeviceTy &Device,
7272
else if (NumLanes == 64)
7373
return handle_offload_opcodes<64>(Device, Port);
7474
else
75-
return rpc::ERROR;
75+
return rpc::RPC_ERROR;
7676
}
7777

7878
RPCServerTy::RPCServerTy(plugin::GenericPluginTy &Plugin)

0 commit comments

Comments
 (0)