Forum > Carbon

Is Mac carbon broken..

<< < (2/3) > >>

Cyrax:

--- Quote from: nsl on June 17, 2019, 02:38:29 pm ---
GetDashes expects parameter of type TCarbonDashes where
TCarbonDashes = array of Float32;

But the parameter passed is
CarbonDashStyle: Array [0..1] of Single

Float32 is alias for Single so should be assignment compatible.

I tried compiling the trunk code with version 3.0.4 I386 compiler and Carbon with no errors.

Could this be a compiler version issue?

--- End quote ---

In FPC trunk, conversion from regular arrays to dynamic ones has been disabled by default. See this for more info and how to enable it : https://wiki.lazarus.freepascal.org/User_Changes_Trunk#Disabled_default_support_for_automatic_conversions_of_regular_arrays_to_dynamic_arrays

skalogryz:
sounds like the fix is trivial

--- Quote ---Remedy: Either change the code so it no longer assigns regular arrays to dynamic arrays, or add {$modeswitch arraytodynarray}

--- End quote ---

--- Quote from: josh on June 16, 2019, 06:29:53 pm ---I have an old app that must stay on carbon for s while yet; as it is run on old mac's.

--- End quote ---
how old macOS are? (10.5, 10.4? older?)

Josh:
On trunk fpc and Lazarus
I have tried the {$modeswitch arraytodynarray}
in project lpr, and main unit1.pas of a an empty project, done a clean rebuild of blank form and get the same error.

Where should I be placing the {$modeswitch arraytodynarray} ?

skalogryz:
seems like the fix is only used for parameters passing.

try this patch.

--- Code: Diff  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---Index: carbongdiobjects.pp===================================================================--- carbongdiobjects.pp (revision 61402)+++ carbongdiobjects.pp (working copy)@@ -2022,13 +2022,13 @@  ------------------------------------------------------------------------------} procedure TCarbonPen.Apply(ADC: TCarbonContext; UseROP2: Boolean); -  function GetDashes(Source: TCarbonDashes): TCarbonDashes;+  function GetDashes(const Source: array of Single): TCarbonDashes;   var     i: Integer;   begin-    Result := Source;+    SetLength(Result, length(Source));     for i := Low(Result) to High(Result) do-      Result[i] := Result[i] * FWidth;+      Result[i] := Source[i] * FWidth;   end;  var 
Oddly enough, this was the exact place I've recently rewritten Cocoa getting rid of dynamic arrays (and dynamic array reallocation) completely

Josh:
Hi

The patch is helping, I can now compile a empty form; but when targeting for carbon I am getting

--- Code: ---Compile Project, CPU: i386, Target: /Users/josh/lazarus_trunk_cocoa/projects/project1: Success, Errors: 21
Error: ld: warning: text-based stub file /System/Library/Frameworks//OpenGL.framework/OpenGL.tbd and library file /System/Library/Frameworks//OpenGL.framework/OpenGL are out of sync. Falling back to library file for linking.
Error: ld: warning: text-based stub file /System/Library/Frameworks//Foundation.framework/Foundation.tbd and library file /System/Library/Frameworks//Foundation.framework/Foundation are out of sync. Falling back to library file for linking.
Error: ld: warning: text-based stub file /System/Library/Frameworks//Cocoa.framework/Cocoa.tbd and library file /System/Library/Frameworks//Cocoa.framework/Cocoa are out of sync. Falling back to library file for linking.
Error: ld: warning: text-based stub file /System/Library/Frameworks//OpenGL.framework/OpenGL.tbd and library file /System/Library/Frameworks//OpenGL.framework/OpenGL are out of sync. Falling back to library file for linking.
Error: ld: warning: text-based stub file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLU.tbd and library file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLU.dylib are out of sync. Falling back to library file for linking.
Error: ld: warning: text-based stub file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.tbd and library file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib are out of sync. Falling back to library file for linking.
Error: ld: warning: text-based stub file /System/Library/Frameworks//ApplicationServices.framework/Versions/A/ApplicationServices.tbd and library file /System/Library/Frameworks//ApplicationServices.framework/Versions/A/ApplicationServices are out of sync. Falling back to library file for linking.
Error: ld: warning: text-based stub file /System/Library/Frameworks//CoreFoundation.framework/Versions/A/CoreFoundation.tbd and library file /System/Library/Frameworks//CoreFoundation.framework/Versions/A/CoreFoundation are out of sync. Falling back to library file for linking.
Error: ld: warning: text-based stub file /System/Library/Frameworks//AppKit.framework/Versions/C/AppKit.tbd and library file /System/Library/Frameworks//AppKit.framework/Versions/C/AppKit are out of sync. Falling back to library file for linking.
Error: ld: warning: text-based stub file /System/Library/Frameworks//CoreGraphics.framework/Versions/A/CoreGraphics.tbd and library file /System/Library/Frameworks//CoreGraphics.framework/Versions/A/CoreGraphics are out of sync. Falling back to library file for linking.
Error: ld: warning: text-based stub file /System/Library/Frameworks//CoreText.framework/Versions/A/CoreText.tbd and library file /System/Library/Frameworks//CoreText.framework/Versions/A/CoreText are out of sync. Falling back to library file for linking.
Error: ld: warning: text-based stub file /System/Library/Frameworks//ImageIO.framework/Versions/A/ImageIO.tbd and library file /System/Library/Frameworks//ImageIO.framework/Versions/A/ImageIO are out of sync. Falling back to library file for linking.
Error: ld: warning: text-based stub file /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/ATS.tbd and library file /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/ATS are out of sync. Falling back to library file for linking.
Error: ld: warning: text-based stub file /System/Library/Frameworks//CoreServices.framework/Versions/A/CoreServices.tbd and library file /System/Library/Frameworks//CoreServices.framework/Versions/A/CoreServices are out of sync. Falling back to library file for linking.
Error: ld: warning: text-based stub file /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/HIServices.framework/Versions/A/HIServices.tbd and library file /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/HIServices.framework/Versions/A/HIServices are out of sync. Falling back to library file for linking.
Error: ld: warning: text-based stub file /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/SpeechSynthesis.framework/Versions/A/SpeechSynthesis.tbd and library file /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/SpeechSynthesis.framework/Versions/A/SpeechSynthesis are out of sync. Falling back to library file for linking.
Error: ld: warning: text-based stub file /System/Library/PrivateFrameworks/UIFoundation.framework/Versions/A/UIFoundation.tbd and library file /System/Library/PrivateFrameworks/UIFoundation.framework/Versions/A/UIFoundation are out of sync. Falling back to library file for linking.
Error: ld: warning: text-based stub file /System/Library/Frameworks//CFNetwork.framework/Versions/A/CFNetwork.tbd and library file /System/Library/Frameworks//CFNetwork.framework/Versions/A/CFNetwork are out of sync. Falling back to library file for linking.
Error: ld: warning: text-based stub file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/OSServices.framework/Versions/A/OSServices.tbd and library file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/OSServices.framework/Versions/A/OSServices are out of sync. Falling back to library file for linking.
Error: ld: warning: text-based stub file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/LaunchServices.tbd and library file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/LaunchServices are out of sync. Falling back to library file for linking.
Error: ld: warning: text-based stub file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SharedFileList.framework/Versions/A/SharedFileList.tbd and library file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SharedFileList.framework/Versions/A/SharedFileList are out of sync. Falling back to library file for linking.

--- End code ---


I added a few standard controls; label; combox and tmemo.
Moving around a putting some text in I then got estack overflow error

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version