mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-28 02:11:43 +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:
@@ -38,20 +38,20 @@ class Preferences : public ErrorBase {
|
||||
static Preferences* GetInstance();
|
||||
|
||||
std::vector<std::string> GetKeys();
|
||||
std::string GetString(llvm::StringRef key, llvm::StringRef defaultValue = "");
|
||||
int GetInt(llvm::StringRef key, int defaultValue = 0);
|
||||
double GetDouble(llvm::StringRef key, double defaultValue = 0.0);
|
||||
float GetFloat(llvm::StringRef key, float defaultValue = 0.0);
|
||||
bool GetBoolean(llvm::StringRef key, bool defaultValue = false);
|
||||
int64_t GetLong(llvm::StringRef key, int64_t defaultValue = 0);
|
||||
void PutString(llvm::StringRef key, llvm::StringRef value);
|
||||
void PutInt(llvm::StringRef key, int value);
|
||||
void PutDouble(llvm::StringRef key, double value);
|
||||
void PutFloat(llvm::StringRef key, float value);
|
||||
void PutBoolean(llvm::StringRef key, bool value);
|
||||
void PutLong(llvm::StringRef key, int64_t value);
|
||||
bool ContainsKey(llvm::StringRef key);
|
||||
void Remove(llvm::StringRef key);
|
||||
std::string GetString(wpi::StringRef key, wpi::StringRef defaultValue = "");
|
||||
int GetInt(wpi::StringRef key, int defaultValue = 0);
|
||||
double GetDouble(wpi::StringRef key, double defaultValue = 0.0);
|
||||
float GetFloat(wpi::StringRef key, float defaultValue = 0.0);
|
||||
bool GetBoolean(wpi::StringRef key, bool defaultValue = false);
|
||||
int64_t GetLong(wpi::StringRef key, int64_t defaultValue = 0);
|
||||
void PutString(wpi::StringRef key, wpi::StringRef value);
|
||||
void PutInt(wpi::StringRef key, int value);
|
||||
void PutDouble(wpi::StringRef key, double value);
|
||||
void PutFloat(wpi::StringRef key, float value);
|
||||
void PutBoolean(wpi::StringRef key, bool value);
|
||||
void PutLong(wpi::StringRef key, int64_t value);
|
||||
bool ContainsKey(wpi::StringRef key);
|
||||
void Remove(wpi::StringRef key);
|
||||
|
||||
protected:
|
||||
Preferences();
|
||||
|
||||
Reference in New Issue
Block a user