mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-22 01:11: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:
@@ -7,9 +7,9 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <llvm/StringRef.h>
|
||||
#include <llvm/Twine.h>
|
||||
#include <support/mutex.h>
|
||||
#include <wpi/StringRef.h>
|
||||
#include <wpi/Twine.h>
|
||||
#include <wpi/mutex.h>
|
||||
|
||||
#include "Base.h"
|
||||
#include "Error.h"
|
||||
@@ -82,35 +82,35 @@ class ErrorBase {
|
||||
|
||||
virtual Error& GetError();
|
||||
virtual const Error& GetError() const;
|
||||
virtual void SetErrnoError(const llvm::Twine& contextMessage,
|
||||
llvm::StringRef filename, llvm::StringRef function,
|
||||
virtual void SetErrnoError(const wpi::Twine& contextMessage,
|
||||
wpi::StringRef filename, wpi::StringRef function,
|
||||
int lineNumber) const;
|
||||
virtual void SetImaqError(int success, const llvm::Twine& contextMessage,
|
||||
llvm::StringRef filename, llvm::StringRef function,
|
||||
virtual void SetImaqError(int success, const wpi::Twine& contextMessage,
|
||||
wpi::StringRef filename, wpi::StringRef function,
|
||||
int lineNumber) const;
|
||||
virtual void SetError(Error::Code code, const llvm::Twine& contextMessage,
|
||||
llvm::StringRef filename, llvm::StringRef function,
|
||||
virtual void SetError(Error::Code code, const wpi::Twine& contextMessage,
|
||||
wpi::StringRef filename, wpi::StringRef function,
|
||||
int lineNumber) const;
|
||||
virtual void SetErrorRange(Error::Code code, int32_t minRange,
|
||||
int32_t maxRange, int32_t requestedValue,
|
||||
const llvm::Twine& contextMessage,
|
||||
llvm::StringRef filename, llvm::StringRef function,
|
||||
const wpi::Twine& contextMessage,
|
||||
wpi::StringRef filename, wpi::StringRef function,
|
||||
int lineNumber) const;
|
||||
virtual void SetWPIError(const llvm::Twine& errorMessage, Error::Code code,
|
||||
const llvm::Twine& contextMessage,
|
||||
llvm::StringRef filename, llvm::StringRef function,
|
||||
virtual void SetWPIError(const wpi::Twine& errorMessage, Error::Code code,
|
||||
const wpi::Twine& contextMessage,
|
||||
wpi::StringRef filename, wpi::StringRef function,
|
||||
int lineNumber) const;
|
||||
virtual void CloneError(const ErrorBase& rhs) const;
|
||||
virtual void ClearError() const;
|
||||
virtual bool StatusIsFatal() const;
|
||||
static void SetGlobalError(Error::Code code,
|
||||
const llvm::Twine& contextMessage,
|
||||
llvm::StringRef filename, llvm::StringRef function,
|
||||
const wpi::Twine& contextMessage,
|
||||
wpi::StringRef filename, wpi::StringRef function,
|
||||
int lineNumber);
|
||||
static void SetGlobalWPIError(const llvm::Twine& errorMessage,
|
||||
const llvm::Twine& contextMessage,
|
||||
llvm::StringRef filename,
|
||||
llvm::StringRef function, int lineNumber);
|
||||
static void SetGlobalWPIError(const wpi::Twine& errorMessage,
|
||||
const wpi::Twine& contextMessage,
|
||||
wpi::StringRef filename,
|
||||
wpi::StringRef function, int lineNumber);
|
||||
static Error& GetGlobalError();
|
||||
|
||||
protected:
|
||||
|
||||
Reference in New Issue
Block a user