Skip to content

Commit

Permalink
Merge pull request #318 from steinbergmedia/support-c++23-with-xcode15
Browse files Browse the repository at this point in the history
Support c++23 with xcode15

(cherry picked from commit b3beb68)
  • Loading branch information
scheffle committed Jan 11, 2024
1 parent 6e803a4 commit 01f5baa
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 5 deletions.
2 changes: 1 addition & 1 deletion vstgui/lib/cdrawcontext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,7 @@ void CDrawContext::fillRadialGradient (CGraphicsPath* path, const CGradient& gra
CGraphicsPath* CDrawContext::createGraphicsPath ()
{
if (impl->device)
return new CGraphicsPath (impl->device->getGraphicsPathFactory ());
return new CGraphicsPath (impl->device->getGraphicsPathFactory (), nullptr);
return nullptr;
}

Expand Down
3 changes: 1 addition & 2 deletions vstgui/lib/cgraphicspath.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,7 @@ class CGraphicsPath : public AtomicReferenceCounted
CRect getBoundingBox ();
//@}

CGraphicsPath (const PlatformGraphicsPathFactoryPtr& factory,
PlatformGraphicsPathPtr&& path = nullptr);
CGraphicsPath (const PlatformGraphicsPathFactoryPtr& factory, PlatformGraphicsPathPtr&& path);
~CGraphicsPath () noexcept override;

const PlatformGraphicsPathPtr& getPlatformPath (PlatformGraphicsPathFillMode fillMode);
Expand Down
23 changes: 23 additions & 0 deletions vstgui/lib/cstring.h
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,9 @@ class UTF8StringView
bool operator== (const UTF8StringPtr otherString) const;
bool operator!= (const UTF8StringPtr otherString) const;
bool operator== (UTF8StringView otherString) const;
bool operator!= (UTF8StringView otherString) const;
bool operator== (const UTF8String& otherString) const;
bool operator!= (const UTF8String& otherString) const;
operator const UTF8StringPtr () const;
//-----------------------------------------------------------------------------
private:
Expand Down Expand Up @@ -463,6 +466,26 @@ inline bool UTF8StringView::operator== (UTF8StringView otherString) const
return operator==(otherString.str);
}

//------------------------------------------------------------------------
inline bool UTF8StringView::operator!= (UTF8StringView otherString) const
{
if (byteCount && otherString.byteCount && *byteCount != *otherString.byteCount)
return true;
return operator!= (otherString.str);
}

//------------------------------------------------------------------------
inline bool UTF8StringView::operator== (const UTF8String& otherString) const
{
return otherString == str;
}

//------------------------------------------------------------------------
inline bool UTF8StringView::operator!= (const UTF8String& otherString) const
{
return otherString != str;
}

//-----------------------------------------------------------------------------
inline UTF8StringView::operator const UTF8StringPtr () const
{
Expand Down
6 changes: 4 additions & 2 deletions vstgui/lib/platform/mac/cgbitmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,8 @@ CGImageRef CGBitmap::getCGImage ()
size_t rowBytes = getBytesPerRow ();
size_t bitDepth = 32;

CGBitmapInfo bitmapInfo = kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Big;
CGBitmapInfo bitmapInfo =
static_cast<CGBitmapInfo> (kCGImageAlphaPremultipliedFirst) | kCGBitmapByteOrder32Big;
image = CGImageCreate (static_cast<size_t> (size.x), static_cast<size_t> (size.y), 8, bitDepth, rowBytes, GetCGColorSpace (), bitmapInfo, bitsDataProvider, nullptr, false, kCGRenderingIntentDefault);
dirty = false;
}
Expand Down Expand Up @@ -300,7 +301,8 @@ CGContextRef CGBitmap::createCGContext ()
}
if (bits)
{
CGBitmapInfo bitmapInfo = kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Big;
CGBitmapInfo bitmapInfo =
static_cast<CGBitmapInfo> (kCGImageAlphaPremultipliedFirst) | kCGBitmapByteOrder32Big;
context = CGBitmapContextCreate (bits,
static_cast<size_t> (size.x),
static_cast<size_t> (size.y),
Expand Down
1 change: 1 addition & 0 deletions vstgui/lib/platform/mac/macfactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class MacFactory final : public IPlatformFactory
{
public:
MacFactory (CFBundleRef bundle);
~MacFactory () noexcept override;

CFBundleRef getBundle () const noexcept;

Expand Down
2 changes: 2 additions & 0 deletions vstgui/lib/platform/mac/macfactory.mm
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@
mach_timebase_info (&impl->timebaseInfo);
}

MacFactory::~MacFactory () noexcept = default;

//-----------------------------------------------------------------------------
CFBundleRef MacFactory::getBundle () const noexcept
{
Expand Down

0 comments on commit 01f5baa

Please sign in to comment.