mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-09 20:29:10 +02:00
Make the 'this_line_location' hack more reliable
It shouldn't be done if it's not needed.
This commit is contained in:
@@ -13,6 +13,10 @@ Versioning](https://semver.org/spec/v2.0.0.html).
|
|||||||
- Changed architecture to use one less socket.
|
- Changed architecture to use one less socket.
|
||||||
- Removed dependency on 32-bit Boost.Filesystem.
|
- Removed dependency on 32-bit Boost.Filesystem.
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Made the plugin and host detection slightly more robust.
|
||||||
|
|
||||||
## [1.1.4] - 2020-05-12
|
## [1.1.4] - 2020-05-12
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|||||||
+10
-3
@@ -200,9 +200,16 @@ fs::path get_this_file_location() {
|
|||||||
// on both Ubuntu 18.04 and 20.04, but not on Arch based distros.
|
// on both Ubuntu 18.04 and 20.04, but not on Arch based distros.
|
||||||
// Under Linux a path starting with two slashes is treated the same as
|
// Under Linux a path starting with two slashes is treated the same as
|
||||||
// a path starting with only a single slash, but Wine will refuse to
|
// a path starting with only a single slash, but Wine will refuse to
|
||||||
// load any files when the path starts with two slashes. Prepending
|
// load any files when the path starts with two slashes. The easiest
|
||||||
// `/` to a pad coerces theses two slashes into a single slash.
|
// way to work around this if this happens is to just add another
|
||||||
return "/" / boost::dll::this_line_location();
|
// leading slash and then normalize the path, since three or more
|
||||||
|
// slashes will be coerced into a single slash.
|
||||||
|
fs::path this_file = boost::dll::this_line_location();
|
||||||
|
if (this_file.string().find("//") == 0) {
|
||||||
|
this_file = ("/" / this_file).lexically_normal();
|
||||||
|
}
|
||||||
|
|
||||||
|
return this_file;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string get_wine_version() {
|
std::string get_wine_version() {
|
||||||
|
|||||||
Reference in New Issue
Block a user