Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
clean-and-itasks
clm
Commits
dd91e253
Commit
dd91e253
authored
Oct 17, 2003
by
Ronny Wichers Schreur
🏘
Browse files
johnvg: add SortByM macro instead of importing StdOrdOverloadedList
parent
8c34bec1
Changes
1
Hide whitespace changes
Inline
Side-by-side
CleanIDE/Mac/mach_o_linker2.icl
View file @
dd91e253
implementation
module
mach_o_linker2
;
import
StdInt
,
StdBool
,
StdString
,
StdChar
,
StdArray
,
StdFile
,
StdClass
,
StdMisc
;
import
StdStrictLists
,
StdOverloadedList
,
StdOrdOverloadedList
;
import
StdStrictLists
,
StdOverloadedList
;
swap_bytes
i
:==
i
;
//swap_bytes i = ((i>>24) bitand 0xff) bitor ((i>>8) bitand 0xff00) bitor ((i<<8) bitand 0xff0000) bitor (i<<24);
...
...
@@ -529,6 +529,29 @@ N_SECT:==0xe;
sort_module_offsets
module_offsets
=
SortByM
(\
{
module_offset
=
x
}
{
module_offset
=
y
}
->
x
<
y
)
module_offsets
;
SortByM
less_f
l
:==
HdM
(
msort
(
pair
l
));
{
pair
[|
x1
,
x2
:
xs
]
|
less_f
x2
x1
=
[[|
x2
,
x1
]:
pair
xs
];
=
[[|
x1
,
x2
]:
pair
xs
];
pair
x
=
[|
x
];
msort
[|
x1
,
x2
:
xs
]
=
msort
(
merge_stage
[|
x1
,
x2
:
xs
]);
msort
x
=
x
;
merge_stage
[|
xs1
,
xs2
:
xxs
]
=
[
mergeBy
less_f
xs1
xs2
:
merge_stage
xxs
];
merge_stage
x
=
x
;
mergeBy
less_f
[|]
y
=
y
;
mergeBy
less_f
f
=:[|
x
:
xs
]
[|]
=
f
;
mergeBy
less_f
f
=:[|
x
:
xs
]
s
=:[|
y
:
ys
]
|
less_f
y
x
=
[|
y
:
mergeBy
less_f
f
ys
];
=
[|
x
:
mergeBy
less_f
xs
s
];
}
::
SymbolNumberAndOffset
=
{
symbol_n
::!
Int
,
module_offset
::!
Int
};
define_symbols
::
Int
Int
Int
String
String
{!
Section
}
String
Int
NamesTable
->
(!
NamesTable
,!
SymbolTable
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment