From 1cf755b51cc643240f60131a8fac5e990cfa5e9f Mon Sep 17 00:00:00 2001 From: Neil Date: Mon, 25 Mar 2019 11:00:39 +1100 Subject: Use generic versions of ceil, floor, round, lround, trunc from . --- cocoa/ScintillaView.mm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'cocoa/ScintillaView.mm') diff --git a/cocoa/ScintillaView.mm b/cocoa/ScintillaView.mm index b32c549b1..116ea36e9 100644 --- a/cocoa/ScintillaView.mm +++ b/cocoa/ScintillaView.mm @@ -9,6 +9,8 @@ * This file is dual licensed under LGPL v2.1 and the Scintilla license (http://www.scintilla.org/License.txt). */ +#include + #include #include @@ -58,7 +60,7 @@ static NSCursor *cursorFromEnum(Window::Cursor cursor) { [super tile]; #if defined(MAC_OS_X_VERSION_10_14) - if (floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_13) { + if (std::floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_13) { NSRect frame = self.contentView.frame; frame.origin.x = self.verticalRulerView.requiredThickness; frame.size.width -= frame.origin.x; @@ -744,14 +746,14 @@ static NSCursor *cursorFromEnum(Window::Cursor cursor) { // Only snap for positions inside the document - allow outside // for overshoot. long lineHeight = mOwner.backend->WndProc(SCI_TEXTHEIGHT, 0, 0); - rc.origin.y = roundf(static_cast(rc.origin.y) / lineHeight) * lineHeight; + rc.origin.y = std::round(static_cast(rc.origin.y) / lineHeight) * lineHeight; } // Snap to whole points - on retina displays this avoids visual debris // when scrolling horizontally. if ((rc.origin.x > 0) && (NSMaxX(rc) < contentRect.size.width)) { // Only snap for positions inside the document - allow outside // for overshoot. - rc.origin.x = roundf(static_cast(rc.origin.x)); + rc.origin.x = std::round(static_cast(rc.origin.x)); } return rc; } @@ -1398,7 +1400,7 @@ static NSCursor *cursorFromEnum(Window::Cursor cursor) { #if defined(MAC_OS_X_VERSION_10_14) // Let SCIScrollView account for other subviews such as vertical ruler by turning off // automaticallyAdjustsContentInsets. - if (floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_13) { + if (std::floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_13) { scrollView.contentView.automaticallyAdjustsContentInsets = NO; scrollView.contentView.contentInsets = NSEdgeInsetsMake(0., 0., 0., 0.); } -- cgit v1.2.3