Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xcode16 build fix #2585

Open
wants to merge 28 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
576c558
Xcode16 build fix
marchcat Sep 17, 2024
705fd68
Make `LLPointer` equality comparisons accept not-identical types.
nat-goodspeed Sep 24, 2024
1a682de
LLConstPointer<T> is the same as LLPointer<const T>.
nat-goodspeed Sep 24, 2024
98c829a
Use copy-and-swap idiom for LLPointer's assignment operators.
nat-goodspeed Sep 25, 2024
5d7b3ab
Explain why apparently redundant LLPointer methods are necessary.
nat-goodspeed Sep 25, 2024
4b2b94f
Merge pull request #2681 from secondlife/nat/xcode-16
marchcat Sep 25, 2024
55df732
Merge branch 'develop' into marchcat/xcode-16
nat-goodspeed Sep 25, 2024
dc0c6d3
Adapt `fsyspath` for C++20 conventions.
nat-goodspeed Sep 26, 2024
988a0fd
Fix a few more fsyspath conversions, removing explicit u8string().
nat-goodspeed Sep 26, 2024
015ff3d
#include <cmath> rather than "math.h" to avoid lerp() conflict.
nat-goodspeed Sep 26, 2024
6400284
Ditch our own (conflicting) definition of the lerp() function.
nat-goodspeed Sep 26, 2024
6ac59d1
Fix GCC ambiguous-reversed-operator errors for `LLKeyData` compares.
nat-goodspeed Sep 26, 2024
d7f6b96
Reinstate our lerp() function, avoid "math.h" header.
nat-goodspeed Sep 26, 2024
15dad13
Set continue-on-error for linux builds
marchcat Sep 26, 2024
452e074
Remove whitespace for pre-commit
marchcat Sep 26, 2024
8a6da4d
Rename our lerp() to flerp(); call where MSVC balks at std::lerp().
nat-goodspeed Sep 26, 2024
b043ed4
Merge remote branch 'develop' into marchcat/xcode-16
nat-goodspeed Sep 26, 2024
fcfcca9
Ditch last instances of LL_LIBRARY_INCLUDE.
nat-goodspeed Sep 26, 2024
d3833b6
Fix lerp issues and eliminate flerp in favor of std::lerp (#2712)
Ansariel Sep 27, 2024
a2b76b6
Migrate ~LLPointer()'s peculiar warning case to llpointer.cpp.
nat-goodspeed Sep 27, 2024
d39c862
Automate memory management in JPEG2KEncode and JPEG2KDecode.
nat-goodspeed Sep 27, 2024
c7cef95
Allow Windows and Mac builds to succeed despite Linux failure.
nat-goodspeed Sep 27, 2024
51fb298
Try again to let Windows and Mac succeed despite Linux failure.
nat-goodspeed Sep 27, 2024
ecc2ada
lltexlayerparams.h uses std::atomic<bool>, so #include <atomic>
nat-goodspeed Sep 27, 2024
5c9d60c
Linux GCC prefers the explicit std::string::assign() call.
nat-goodspeed Sep 27, 2024
1c78829
Introduce owning_ptr<T>; use it for JPEG2KEncode and JPEG2KDecode.
nat-goodspeed Sep 27, 2024
cf2f482
Slightly streamline owning_ptr class definition.
nat-goodspeed Sep 27, 2024
71e89d6
Merge pull request #2714 from secondlife/nat/xcode-16
nat-goodspeed Sep 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,11 @@ jobs:
needs: setup
strategy:
matrix:
runner: [windows-large, macos-12-xl]
runner: [windows-large, macos-14-xlarge]
configuration: ${{ fromJSON(needs.setup.outputs.configurations) }}
include:
- runner: linux-large
marchcat marked this conversation as resolved.
Show resolved Hide resolved
continue-on-error: true
configuration: ReleaseOS
runs-on: ${{ matrix.runner }}
outputs:
Expand All @@ -71,7 +72,7 @@ jobs:
# autobuild-package.xml.
AUTOBUILD_VCS_INFO: "true"
AUTOBUILD_VSVER: "170"
DEVELOPER_DIR: "/Applications/Xcode_14.0.1.app/Contents/Developer"
DEVELOPER_DIR: "/Applications/Xcode_16.0.app/Contents/Developer"
# Ensure that Linden viewer builds engage Bugsplat.
BUGSPLAT_DB: ${{ needs.setup.outputs.bugsplat_db }}
build_coverity: false
Expand Down
3 changes: 3 additions & 0 deletions indra/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ else()
set( USE_AUTOBUILD_3P ON )
endif()

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

include(Variables)
include(BuildVersion)

Expand Down
56 changes: 36 additions & 20 deletions indra/llcommon/fsyspath.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
#if ! defined(LL_FSYSPATH_H)
#define LL_FSYSPATH_H

#include <boost/iterator/transform_iterator.hpp>
#include <filesystem>
#include <string>
#include <string_view>

// While std::filesystem::path can be directly constructed from std::string on
// both Posix and Windows, that's not what we want on Windows. Per
Expand All @@ -33,42 +36,55 @@
// char"), the "native narrow encoding" isn't UTF-8, so file paths containing
// non-ASCII characters get mangled.
//
// Once we're building with C++20, we could pass a UTF-8 std::string through a
// vector<char8_t> to engage std::filesystem::path's own UTF-8 conversion. But
// sigh, as of 2024-04-03 we're not yet there.
//
// Anyway, encapsulating the important UTF-8 conversions in our own subclass
// allows us to migrate forward to C++20 conventions without changing
// referencing code.
// Encapsulating the important UTF-8 conversions in our own subclass allows us
// to migrate forward to C++20 conventions without changing referencing code.

class fsyspath: public std::filesystem::path
{
using super = std::filesystem::path;

// In C++20 (__cpp_lib_char8_t), std::filesystem::u8path() is deprecated.
// std::filesystem::path(iter, iter) performs UTF-8 conversions when the
// value_type of the iterators is char8_t. While we could copy into a
// temporary std::u8string and from there into std::filesystem::path, to
// minimize string copying we'll define a transform_iterator that accepts
// a std::string_view::iterator and dereferences to char8_t.
struct u8ify
{
char8_t operator()(char c) const { return char8_t(c); }
};
using u8iter = boost::transform_iterator<u8ify, std::string_view::iterator>;

public:
// default
fsyspath() {}
// construct from UTF-8 encoded std::string
fsyspath(const std::string& path): super(std::filesystem::u8path(path)) {}
// construct from UTF-8 encoded const char*
fsyspath(const char* path): super(std::filesystem::u8path(path)) {}
// construct from UTF-8 encoded string
fsyspath(const std::string& path): fsyspath(std::string_view(path)) {}
fsyspath(const char* path): fsyspath(std::string_view(path)) {}
fsyspath(std::string_view path):
super(u8iter(path.begin(), u8ify()), u8iter(path.end(), u8ify()))
{}
// construct from existing path
fsyspath(const super& path): super(path) {}

fsyspath& operator=(const super& p) { super::operator=(p); return *this; }
fsyspath& operator=(const std::string& p)
{
super::operator=(std::filesystem::u8path(p));
return *this;
}
fsyspath& operator=(const char* p)
fsyspath& operator=(const super& p) { super::operator=(p); return *this; }
fsyspath& operator=(const std::string& p) { return (*this) = std::string_view(p); }
fsyspath& operator=(const char* p) { return (*this) = std::string_view(p); }
fsyspath& operator=(std::string_view p)
{
super::operator=(std::filesystem::u8path(p));
assign(u8iter(p.begin(), u8ify()), u8iter(p.end(), u8ify()));
return *this;
}

// shadow base-class string() method with UTF-8 aware method
std::string string() const { return super::u8string(); }
std::string string() const
{
// Short of forbidden type punning, I see no way to avoid copying this
// std::u8string to a std::string.
auto u8str{ super::u8string() };
// from https://github.com/tahonermann/char8_t-remediation/blob/master/char8_t-remediation.h#L180-L182
return { u8str.begin(), u8str.end() };
}
// On Posix systems, where value_type is already char, this operator
// std::string() method shadows the base class operator string_type()
// method. But on Windows, where value_type is wchar_t, the base class
Expand Down
20 changes: 8 additions & 12 deletions indra/llcommon/llkeybind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,22 +123,18 @@ LLKeyData& LLKeyData::operator=(const LLKeyData& rhs)
return *this;
}

bool LLKeyData::operator==(const LLKeyData& rhs)
bool LLKeyData::operator==(const LLKeyData& rhs) const
{
if (mMouse != rhs.mMouse) return false;
if (mKey != rhs.mKey) return false;
if (mMask != rhs.mMask) return false;
if (mIgnoreMasks != rhs.mIgnoreMasks) return false;
return true;
return
(mMouse == rhs.mMouse) &&
(mKey == rhs.mKey) &&
(mMask == rhs.mMask) &&
(mIgnoreMasks == rhs.mIgnoreMasks);
}

bool LLKeyData::operator!=(const LLKeyData& rhs)
bool LLKeyData::operator!=(const LLKeyData& rhs) const
{
if (mMouse != rhs.mMouse) return true;
if (mKey != rhs.mKey) return true;
if (mMask != rhs.mMask) return true;
if (mIgnoreMasks != rhs.mIgnoreMasks) return true;
return false;
return ! (*this == rhs);
}

bool LLKeyData::canHandle(const LLKeyData& data) const
Expand Down
4 changes: 2 additions & 2 deletions indra/llcommon/llkeybind.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ class LL_COMMON_API LLKeyData
bool empty() const { return isEmpty(); };
void reset();
LLKeyData& operator=(const LLKeyData& rhs);
bool operator==(const LLKeyData& rhs);
bool operator!=(const LLKeyData& rhs);
bool operator==(const LLKeyData& rhs) const;
bool operator!=(const LLKeyData& rhs) const;

bool canHandle(const LLKeyData& data) const;
bool canHandle(EMouseClickType mouse, KEY key, MASK mask) const;
Expand Down
Loading
Loading