mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-14 06:39:36 +02:00

the stack pointer during the prolog. This was done previously in tcg.g_proc_entry(), but that routine is called after register allocation and hence has no influence. Also cleaned up the deallocation of that register by moving the previously ifdef'd code to thlcgppcgen (mantis #27634) git-svn-id: trunk@30164 -
67 lines
2.5 KiB
ObjectPascal
67 lines
2.5 KiB
ObjectPascal
type
|
|
MBHelpPtr = pointer;
|
|
MenuRecord = record end;
|
|
MenuItemsPtr = pointer;
|
|
MenuIconHandle = pointer;
|
|
MenuRef = pointer;
|
|
int16 = word;
|
|
int32 = longint;
|
|
OSStatus = int32;
|
|
Str255 = ShortString;
|
|
|
|
function MacMenuAddItemInternal
|
|
( var theMenuRecord : MenuRecord;
|
|
theMenuOrSubMenuID : Int32;
|
|
theOptBeforeItemIndex : Int32;
|
|
var theMenuRef : MenuRef;
|
|
var theItemsPtr : MenuItemsPtr;
|
|
const theItemStr : Str255;
|
|
theItemIconHandle : MenuIconHandle;
|
|
theEnableFlag : boolean;
|
|
theCheckFlag : boolean;
|
|
theCommandChar : char;
|
|
theCommandModifiers : Int16;
|
|
theItemCmdID : Int32;
|
|
const theItemAppStr : AnsiString;
|
|
var theNewItemIndex : Int32): OSStatus;
|
|
begin
|
|
end;
|
|
|
|
function MBMenuAddItemInternal
|
|
( var theMenuRecord : MenuRecord;
|
|
theMenuOrSubMenuID : Int32;
|
|
theOptBeforeItemIndex : Int32;
|
|
var theMenuRef : MenuRef;
|
|
var theItemsPtr : MenuItemsPtr;
|
|
const theItemStr : Str255;
|
|
theItemIconHandle : MenuIconHandle;
|
|
theEnableFlag : boolean;
|
|
theCheckFlag : boolean;
|
|
theCommandChar : char;
|
|
theCommandGlyph : Int16; { unused here }
|
|
theCommandModifiers : Int16;
|
|
theItemCmdID : Int32;
|
|
const theItemAppStr : AnsiString;
|
|
theItemHelpPtr : MBHelpPtr; { unused here }
|
|
var theNewItemIndex : Int32): OSStatus;
|
|
var
|
|
theErr : OSStatus;
|
|
begin
|
|
theItemsPtr := nil;
|
|
theNewItemIndex := 0;
|
|
theErr := MacMenuAddItemInternal
|
|
( theMenuRecord, theMenuOrSubMenuID, theOptBeforeItemIndex, theMenuRef, theItemsPtr,
|
|
theItemStr, theItemIconHandle, theEnableFlag, theCheckFlag, theCommandChar,
|
|
theCommandModifiers, theItemCmdID, theItemAppStr, theNewItemIndex);
|
|
MBMenuAddItemInternal := theErr
|
|
end;
|
|
|
|
var
|
|
theMenuRecord: MenuRecord;
|
|
theMenuRef: MenuRef;
|
|
theItemsPtr: MenuItemsPtr;
|
|
theNewItemIndex: Int32;
|
|
begin
|
|
MBMenuAddItemInternal(theMenuRecord,1,2,theMenuRef,theItemsPtr,'abc',nil,true,false,'b',3,4,5,'def',nil,theNewItemIndex);
|
|
end.
|