From 1fafe35e81518f2d6bbd45fa8a7aa50a3681551c Mon Sep 17 00:00:00 2001 From: Rafael Sadowski Date: Mon, 18 Dec 2023 00:39:31 +0100 Subject: Source: Restore compilation on OpenBSD We cannot use `OpenBSD` as a name, it is defined in `sys/param.h`. --- Source/cmComputeLinkInformation.cxx | 4 ++-- Source/cmComputeLinkInformation.h | 2 +- Source/cmFindLibraryCommand.cxx | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx index 1b69f6e..e7bef68 100644 --- a/Source/cmComputeLinkInformation.cxx +++ b/Source/cmComputeLinkInformation.cxx @@ -260,7 +260,7 @@ cmComputeLinkInformation::cmComputeLinkInformation( , Config(config) { // Check whether to recognize OpenBSD-style library versioned names. - this->OpenBSD = this->Makefile->GetState()->GetGlobalPropertyAsBool( + this->IsOpenBSD = this->Makefile->GetState()->GetGlobalPropertyAsBool( "FIND_LIBRARY_USE_OPENBSD_VERSIONING"); // Allocate internals. @@ -1574,7 +1574,7 @@ std::string cmComputeLinkInformation::CreateExtensionRegex( libext += ')'; // Add an optional OpenBSD-style version or major.minor.version component. - if (this->OpenBSD || type == LinkShared) { + if (this->IsOpenBSD || type == LinkShared) { libext += "(\\.[0-9]+)*"; } diff --git a/Source/cmComputeLinkInformation.h b/Source/cmComputeLinkInformation.h index 3ee995f..2a06530 100644 --- a/Source/cmComputeLinkInformation.h +++ b/Source/cmComputeLinkInformation.h @@ -254,7 +254,7 @@ private: std::unique_ptr OrderRuntimeSearchPath; bool OldLinkDirMode; - bool OpenBSD; + bool IsOpenBSD; bool LinkDependsNoShared; bool RuntimeUseChrpath; bool NoSONameUsesPath; diff --git a/Source/cmFindLibraryCommand.cxx b/Source/cmFindLibraryCommand.cxx index df77ad0..9df7665 100644 --- a/Source/cmFindLibraryCommand.cxx +++ b/Source/cmFindLibraryCommand.cxx @@ -207,7 +207,7 @@ struct cmFindLibraryHelper std::string BestPath; // Support for OpenBSD shared library naming: lib.so.. - bool OpenBSD; + bool IsOpenBSD; bool DebugMode; @@ -320,7 +320,7 @@ cmFindLibraryHelper::cmFindLibraryHelper(std::string debugName, cmMakefile* mf, this->RegexFromList(this->SuffixRegexStr, this->Suffixes); // Check whether to use OpenBSD-style library version comparisons. - this->OpenBSD = this->Makefile->GetState()->GetGlobalPropertyAsBool( + this->IsOpenBSD = this->Makefile->GetState()->GetGlobalPropertyAsBool( "FIND_LIBRARY_USE_OPENBSD_VERSIONING"); } @@ -390,7 +390,7 @@ void cmFindLibraryHelper::AddName(std::string const& name) std::string regex = cmStrCat('^', this->PrefixRegexStr); this->RegexFromLiteral(regex, name); regex += this->SuffixRegexStr; - if (this->OpenBSD) { + if (this->IsOpenBSD) { regex += "(\\.[0-9]+\\.[0-9]+)?"; } regex += "$"; @@ -472,7 +472,7 @@ bool cmFindLibraryHelper::CheckDirectoryForName(std::string const& path, size_type suffix = this->GetSuffixIndex(name.Regex.match(2)); unsigned int major = 0; unsigned int minor = 0; - if (this->OpenBSD) { + if (this->IsOpenBSD) { sscanf(name.Regex.match(3).c_str(), ".%u.%u", &major, &minor); } if (this->BestPath.empty() || prefix < bestPrefix || -- cgit v0.12