Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
13 changes: 0 additions & 13 deletions indra/cmake/Variables.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -154,19 +154,6 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(CMAKE_XCODE_ATTRIBUTE_GCC_OPTIMIZATION_LEVEL "${CMAKE_MATCH_1}")
message(STATUS "CMAKE_XCODE_ATTRIBUTE_GCC_OPTIMIZATION_LEVEL = '${CMAKE_XCODE_ATTRIBUTE_GCC_OPTIMIZATION_LEVEL}'")

# allow disabling this check by setting LL_SKIP_REQUIRE_SYSROOT either ON as cmake cache var or non-empty as environment var
# set(LL_SKIP_REQUIRE_SYSROOT OFF CACHE BOOL "Skip requirement to set toolchain sysroot ahead of time. Not skipped by default for consistency, but skipping can be useful for selecting alternative xcode versions side by side")
# if("$ENV{LL_SKIP_REQUIRE_SYSROOT}" STREQUAL "" AND NOT ${LL_SKIP_REQUIRE_SYSROOT})
# string(REGEX MATCHALL "[^ ]+" LL_BUILD_LIST "$ENV{LL_BUILD}")
# list(FIND LL_BUILD_LIST "-iwithsysroot" sysroot_idx)
# if ("${sysroot_idx}" LESS 0)
# message(FATAL_ERROR "Environment variable LL_BUILD must contain '-iwithsysroot'")
# endif ()
# math(EXPR sysroot_idx "${sysroot_idx} + 1")
# list(GET LL_BUILD_LIST "${sysroot_idx}" CMAKE_OSX_SYSROOT)
# endif()
# message(STATUS "CMAKE_OSX_SYSROOT = '${CMAKE_OSX_SYSROOT}'")

set(CMAKE_XCODE_ATTRIBUTE_GCC_STRICT_ALIASING NO)
set(CMAKE_XCODE_ATTRIBUTE_GCC_FAST_MATH NO)
set(CMAKE_XCODE_ATTRIBUTE_CLANG_X86_VECTOR_INSTRUCTIONS sse4.2)
Expand Down
2 changes: 1 addition & 1 deletion indra/llcommon/llmd5.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ void LLMD5::hex_digest(char* s) const
}

#if LL_DARWIN
#pragma clang diagnostic push
#pragma clang diagnostic pop
#endif

std::ostream& operator<<(std::ostream& stream, const LLMD5& context)
Expand Down
2 changes: 1 addition & 1 deletion indra/llkdu/llimagej2ckdu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ void LLImageJ2CKDU::setupCodeStream(LLImageJ2C &base, bool keep_codestream, ECod
// *TODO: This seems to be wrong. The base class should have no idea of
// how j2c compression works so no good way of computing what's the byte
// range to be used.
mCodeStreamp->set_max_bytes(max_bytes);
mCodeStreamp->set_max_bytes(max_bytes);

// If you want to flip or rotate the image for some reason, change
// the resolution, or identify a restricted region of interest, this is
Expand Down
80 changes: 40 additions & 40 deletions indra/llwindow/llopenglview-objc.mm
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#import "llwindowmacosx-objc.h"
#import "llappdelegate-objc.h"

#import <Carbon/Carbon.h>
#import <Carbon/Carbon.h>

extern BOOL gHiDPISupport;

Expand Down Expand Up @@ -66,16 +66,16 @@ attributedStringInfo getSegments(NSAttributedString *str)
segment_standouts seg_standouts;
NSRange effectiveRange;
NSRange limitRange = NSMakeRange(0, [str length]);

while (limitRange.length > 0) {
NSNumber *attr = [str attribute:NSUnderlineStyleAttributeName atIndex:limitRange.location longestEffectiveRange:&effectiveRange inRange:limitRange];
limitRange = NSMakeRange(NSMaxRange(effectiveRange), NSMaxRange(limitRange) - NSMaxRange(effectiveRange));

if (effectiveRange.length <= 0)
{
effectiveRange.length = 1;
}

if ([attr integerValue] == 2)
{
seg_lengths.push_back(effectiveRange.length);
Expand All @@ -98,12 +98,12 @@ @implementation NSScreen (PointConversion)
+ (NSScreen *)currentScreenForMouseLocation
{
NSPoint mouseLocation = [NSEvent mouseLocation];

NSEnumerator *screenEnumerator = [[NSScreen screens] objectEnumerator];
NSScreen *screen;
while ((screen = [screenEnumerator nextObject]) && !NSMouseInRect(mouseLocation, screen.frame, NO))
;

return screen;
}

Expand Down Expand Up @@ -131,7 +131,7 @@ - (unsigned long)getVramSize
{
vram_megabytes = 256;
}

return (unsigned long)vram_megabytes; // return value is in megabytes.
}

Expand All @@ -140,15 +140,15 @@ - (void)viewDidMoveToWindow
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(windowResized:) name:NSWindowDidResizeNotification
object:[self window]];

[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(windowWillMiniaturize:) name:NSWindowWillMiniaturizeNotification
object:[self window]];

[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(windowDidDeminiaturize:) name:NSWindowDidDeminiaturizeNotification
object:[self window]];

[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(windowDidBecomeKey:) name:NSWindowDidBecomeKeyNotification
object:[self window]];
Expand Down Expand Up @@ -222,7 +222,7 @@ - (id) initWithFrame:(NSRect)frame withSamples:(NSUInteger)samples andVsync:(BOO
{
[self registerForDraggedTypes:[NSArray arrayWithObject:NSPasteboardTypeURL]];
[self initWithFrame:frame];

// Initialize with a default "safe" pixel format that will work with versions dating back to OS X 10.6.
// Any specialized pixel formats, i.e. a core profile pixel format, should be initialized through rebuildContextWithFormat.
// 10.7 and 10.8 don't really care if we're defining a profile or not. If we don't explicitly request a core or legacy profile, it'll always assume a legacy profile (for compatibility reasons).
Expand All @@ -240,34 +240,34 @@ - (id) initWithFrame:(NSRect)frame withSamples:(NSUInteger)samples andVsync:(BOO
NSOpenGLPFAOpenGLProfile, NSOpenGLProfileVersion4_1Core,
0
};

NSOpenGLPixelFormat *pixelFormat = [[[NSOpenGLPixelFormat alloc] initWithAttributes:attrs] autorelease];

if (pixelFormat == nil)
{
NSLog(@"Failed to create pixel format!", nil);
return nil;
}

NSOpenGLContext *glContext = [[NSOpenGLContext alloc] initWithFormat:pixelFormat shareContext:nil];

if (glContext == nil)
{
NSLog(@"Failed to create OpenGL context!", nil);
return nil;
}

[self setPixelFormat:pixelFormat];

//for retina support
[self setWantsBestResolutionOpenGLSurface:gHiDPISupport];

[self setOpenGLContext:glContext];

[glContext setView:self];

[glContext makeCurrentContext];

if (vsync)
{
GLint value = 1;
Expand All @@ -291,16 +291,16 @@ - (BOOL) rebuildContext
- (BOOL) rebuildContextWithFormat:(NSOpenGLPixelFormat *)format
{
NSOpenGLContext *ctx = [self openGLContext];

[ctx clearDrawable];
[ctx initWithFormat:format shareContext:nil];

if (ctx == nil)
{
NSLog(@"Failed to create OpenGL context!", nil);
return false;
}

[self setOpenGLContext:ctx];
[ctx setView:self];
[ctx makeCurrentContext];
Expand Down Expand Up @@ -405,9 +405,9 @@ - (void) mouseDragged:(NSEvent *)theEvent
float(dev_delta.x),
float(dev_delta.y)
};

callDeltaUpdate(mouseDeltas, 0);

NSPoint mPoint = [self convertPointToBacking:[theEvent locationInWindow]];
mMousePos[0] = mPoint.x;
mMousePos[1] = mPoint.y;
Expand All @@ -431,7 +431,7 @@ - (void) rightMouseDragged:(NSEvent *)theEvent

- (void) otherMouseDragged:(NSEvent *)theEvent
{
[self mouseDragged:theEvent];
[self mouseDragged:theEvent];
}

- (void) scrollWheel:(NSEvent *)theEvent
Expand All @@ -455,7 +455,7 @@ - (void) keyDown:(NSEvent *)theEvent
{
NativeKeyEventData eventData = extractKeyDataFromKeyEvent(theEvent);
eventData.mKeyEvent = NativeKeyEventData::KEYDOWN;

uint keycode = [theEvent keyCode];
// We must not depend on flagsChange event to detect modifier flags changed,
// must depend on the modifire flags in the event parameter.
Expand Down Expand Up @@ -489,13 +489,13 @@ - (void) keyDown:(NSEvent *)theEvent
- (void)flagsChanged:(NSEvent *)theEvent
{
NativeKeyEventData eventData = extractKeyDataFromModifierEvent(theEvent);

mModifiers = [theEvent modifierFlags];
callModifier([theEvent modifierFlags]);

NSInteger mask = 0;
switch([theEvent keyCode])
{
{
case kVK_Shift:
mask = NSEventModifierFlagShift;
break;
Expand All @@ -506,9 +506,9 @@ - (void)flagsChanged:(NSEvent *)theEvent
mask = NSEventModifierFlagControl;
break;
default:
return;
return;
}

if (mModifiers & mask)
{
eventData.mKeyEvent = NativeKeyEventData::KEYDOWN;
Expand All @@ -527,7 +527,7 @@ - (void)flagsChanged:(NSEvent *)theEvent
{
eventData.mKeyEvent = NativeKeyEventData::KEYUP;
callKeyUp(&eventData, [theEvent keyCode], 0);
}
}
}

- (BOOL) acceptsFirstResponder
Expand All @@ -539,11 +539,11 @@ - (NSDragOperation) draggingEntered:(id<NSDraggingInfo>)sender
{
NSPasteboard *pboard;
NSDragOperation sourceDragMask;

sourceDragMask = [sender draggingSourceOperationMask];

pboard = [sender draggingPasteboard];

if ([[pboard types] containsObject:NSPasteboardTypeURL])
{
if (sourceDragMask & NSDragOperationLink) {
Expand All @@ -558,7 +558,7 @@ - (NSDragOperation) draggingEntered:(id<NSDraggingInfo>)sender
- (NSDragOperation)draggingUpdated:(id <NSDraggingInfo>)sender
{
callHandleDragUpdated(mLastDraggedUrl);

return NSDragOperationLink;
}

Expand Down Expand Up @@ -612,12 +612,12 @@ - (void)setMarkedText:(id)aString selectedRange:(NSRange)selectedRange replaceme
unsigned(selectedRange.location),
unsigned(selectedRange.length)
};

unsigned int replacement[2] = {
unsigned(replacementRange.location),
unsigned(replacementRange.length)
};

int string_length = [aString length];
unichar *text = new unichar[string_length];
attributedStringInfo segments;
Expand Down Expand Up @@ -728,7 +728,7 @@ - (void)insertText:(id)aString replacementRange:(NSRange)replacementRange
return;
}
}

@try
{
if (!mHasMarkedText)
Expand All @@ -741,7 +741,7 @@ - (void)insertText:(id)aString replacementRange:(NSRange)replacementRange
resetPreedit();
// We may never get this point since unmarkText may be called before insertText ever gets called once we submit our text.
// But just in case...

for (NSInteger i = 0; i < [aString length]; i++)
{
handleUnicodeCharacter([aString characterAtIndex:i]);
Expand Down
2 changes: 2 additions & 0 deletions indra/newview/llappviewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5660,6 +5660,8 @@ void LLAppViewer::forceErrorBreakpoint()
#else
#if defined(LL_X86) || defined(LL_X86_64)
asm ("int $3");
#else
__builtin_trap();
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this might not be quite right. I'm not sure that the debugger would be able to resume after this intrinsic

#endif
#endif
return;
Expand Down