mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
Move entirety of llvm namespace to wpi namespace.
During shared library loading, a different libLLVM can be pulled in, causing llvm symbols from dependent libraries to resolve to that library instead of this one. This has been seen in the wild with the Mesa OpenGL implementation in JavaFX applications (see wpilibsuite/shuffleboard#361). This is clearly a very breaking change. For some level of backwards compatibility, a namespace alias from llvm to wpi is performed in the "llvm" headers. Unfortunately, forward declarations of llvm classes will still break, but compilers seem to generate clear error messages in those cases ("namespace alias 'llvm' not allowed here, assuming 'wpi'"). This change also moves all the wpiutil headers to a single "wpi" subdirectory from the previously split "llvm", "support", "tcpsockets", and "udpsockets". Shim headers will be added for backwards compatibility in a later commit.
This commit is contained in:
@@ -50,7 +50,7 @@ class Message {
|
||||
|
||||
// Message data accessors. Callers are responsible for knowing what data is
|
||||
// actually provided for a particular message.
|
||||
llvm::StringRef str() const { return m_str; }
|
||||
wpi::StringRef str() const { return m_str; }
|
||||
std::shared_ptr<Value> value() const { return m_value; }
|
||||
unsigned int id() const { return m_id; }
|
||||
unsigned int flags() const { return m_flags; }
|
||||
@@ -79,10 +79,10 @@ class Message {
|
||||
}
|
||||
|
||||
// Create messages with data
|
||||
static std::shared_ptr<Message> ClientHello(llvm::StringRef self_id);
|
||||
static std::shared_ptr<Message> ClientHello(wpi::StringRef self_id);
|
||||
static std::shared_ptr<Message> ServerHello(unsigned int flags,
|
||||
llvm::StringRef self_id);
|
||||
static std::shared_ptr<Message> EntryAssign(llvm::StringRef name,
|
||||
wpi::StringRef self_id);
|
||||
static std::shared_ptr<Message> EntryAssign(wpi::StringRef name,
|
||||
unsigned int id,
|
||||
unsigned int seq_num,
|
||||
std::shared_ptr<Value> value,
|
||||
@@ -94,9 +94,9 @@ class Message {
|
||||
unsigned int flags);
|
||||
static std::shared_ptr<Message> EntryDelete(unsigned int id);
|
||||
static std::shared_ptr<Message> ExecuteRpc(unsigned int id, unsigned int uid,
|
||||
llvm::StringRef params);
|
||||
wpi::StringRef params);
|
||||
static std::shared_ptr<Message> RpcResponse(unsigned int id, unsigned int uid,
|
||||
llvm::StringRef result);
|
||||
wpi::StringRef result);
|
||||
|
||||
Message(const Message&) = delete;
|
||||
Message& operator=(const Message&) = delete;
|
||||
|
||||
Reference in New Issue
Block a user