@Cyrax;
Well, I gave your suggestion a try, but then the entire christmas-tree with error messages pops up, triggered by;
{$ifc defined CPUPOWERPC and defined CPUI386}
{$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
{$endc}
I'll admit I have copied everything between "interface" and "uses" from other units, and I'm not 100% sure what it all does (besides checking widget sets, CPU specifics and some mac stuff). Do I really need really these definitions?
So with that question in mind I just bluntly stripped away most of those macros.
Added "cdecl;" to each function and removed the underscore after "external".
Next I added Cyrax's suggestions (use
{$mode objfpc} and
{$calling cdecl}).
And I'm back where I started haha ... so with
{$mode objfpc} (
in my application units -
not in DiskArbitration and DADissenter) it works -with the occasional Access Violation, and with
{$mode objfpc} I get the same errors as before ...
The headers now look like this (I've attached the files for those who'd want to see everything):
DiskArbitration;
{$mode objfpc}
{$packenum 1}
{$inline on}
{$calling cdecl}
unit DiskArbitration;
interface
uses MacTypes,DASession,CFBase,CFDictionary, DADisk, CFArray, DADissenter;
and DADissenter:
{$mode objfpc}
{$packenum 1}
{$inline on}
{$calling cdecl}
unit DADissenter;
interface
uses MacTypes,DASession,CFBase,CFDictionary,CFString,mach_error;
and the returning error message ...
cocoa_applepibaker_daclass.pas(211,85) Error: Incompatible type for arg no. 4: Got "<address of procedure(DADiskRef;CFArrayRef;Pointer);CDecl>", expected "<procedure variable type of procedure(DADiskRef;CFArrayRef;Pointer);CDecl>"
DiskArbitration.pas(279,11) Hint: Found declaration: DARegisterDiskDescriptionChangedCallback(DASessionRef;CFDictionaryRef;CFArrayRef;DADiskDescriptionChangedCallback;Pointer); CDecl;
Next; test a newer FPC version.p.s. am I the only one experiencing issues with the editor for posting in the forum here? Each time I use backspace until it jumps to the previous line, the following line becomes microscopical sized font. All kinds of [ s i z e ] tags appear ... nice for hiding message, but maybe I'm doing something wrong here?