Commit 8117bf7c authored by Diederik van Arkel's avatar Diederik van Arkel
Browse files

Differentiate app resource linking between PEF and MachO;

parent 5dcc1dc6
......@@ -550,7 +550,7 @@ Link linker` winfun path
| r1==r1
# application_existed = False;
# (resources_ok,ps) = accFiles (create_application_resource path True application_existed (fs,fn) hs heap_size_multiple ss flags
# (resources_ok,ps) = accFiles (create_application_resource path MachO application_existed (fs,fn) hs heap_size_multiple ss flags
0 initial_heap_size minheap) ps
= (ps,True)
= (winfun ["Linker error: "+++toString r1] ps,False)
......
......@@ -2,5 +2,7 @@ definition module linker_resources;
from StdFile import :: Files;
:: ResourceClass = Classic | Carbon | MachO;
read_application_options :: !{#Char} !*Files -> (!Bool,(!Int, !{#Char}), !Int, !Int, !Int, !Int, !Int, !Int, !Int, !Int, !*Files);
create_application_resource :: !{#Char} !Bool /* RWS ... */ !Bool /* ... RWS */ (!Int, !{#Char}) !Int !Int !Int !Int !Int !Int !Int !*Files -> (!Bool,!*Files);
create_application_resource :: !{#Char} !ResourceClass /* RWS ... */ !Bool /* ... RWS */ (!Int, !{#Char}) !Int !Int !Int !Int !Int !Int !Int !*Files -> (!Bool,!*Files);
......@@ -11,8 +11,8 @@ import pointer;
import StdMisc;
create_application_resource :: !{#Char} !Bool /* RWS ... */ !Bool /* ... RWS */ (!Int, !{#Char}) !Int !Int !Int !Int !Int !Int !Int !*Files -> (!Bool,!*Files);
create_application_resource file_name add_carb /* RWS ... */ application_existed /* ... RWS */ font_info heap_size heap_size_multiple stack_size flags application_and_extra_memory_size initial_heap_size memory_profile_minimum_heap_size files
create_application_resource :: !{#Char} !ResourceClass /* RWS ... */ !Bool /* ... RWS */ (!Int, !{#Char}) !Int !Int !Int !Int !Int !Int !Int !*Files -> (!Bool,!*Files);
create_application_resource file_name r_class /* RWS ... */ application_existed /* ... RWS */ font_info heap_size heap_size_multiple stack_size flags application_and_extra_memory_size initial_heap_size memory_profile_minimum_heap_size files
| error_n<>0
= (False,files);
| ref_num==(-1)
......@@ -24,7 +24,11 @@ create_application_resource file_name add_carb /* RWS ... */ application_existed
(res_error,_)=ResError (CloseResFile ref_num t9);
/* DvA ... */
(ok6,t9)=add_carb_resource add_carb t8;
(ok6,t9)=case r_class of {
Classic -> (True,t8);
Carbon -> add_carb_resource t8;
MachO -> add_carb_resource t8;//(True,t8);
};
/* ... DvA */
/* RWS ... */
......@@ -36,10 +40,18 @@ create_application_resource file_name add_carb /* RWS ... */ application_existed
/* RWS ...
(ok3,t6)=add_size_resource (heap_size+stack_size+application_and_extra_memory_size) t5;
*/
(ok3,t6)=change_size_resource (heap_size+stack_size+application_and_extra_memory_size) t5;
(ok3,t6)=case r_class of {
Classic -> change_size_resource (heap_size+stack_size+application_and_extra_memory_size) t5;
Carbon -> change_size_resource (heap_size+stack_size+application_and_extra_memory_size) t5;
MachO -> (True,t5);
};
/* ... RWS */
(ok2,t5)=add_sthp_resource heap_size heap_size_multiple stack_size flags initial_heap_size t4;
(ok1,t4)=add_cfrg_resource file_name stack_size t2;
(ok1,t4)=case r_class of {
Classic -> add_cfrg_resource file_name stack_size t2;
Carbon -> add_cfrg_resource file_name stack_size t2;
MachO -> (True,t2);
};
/*
(ok1,t4)=add_code1_resource t3;
(ok0,t3)=add_code0_resource t2;
......@@ -234,10 +246,8 @@ add_font_resource (font_size, font_name) t0
/* ... RWS */
/* DvA ... */
add_carb_resource :: Bool *Int -> (!Bool,!*Int);
add_carb_resource add t0
| not add
= (True,t0);
add_carb_resource :: *Int -> (!Bool,!*Int);
add_carb_resource t0
| handle==0
= (False,t1);
= (error_n==0,t4);
......
......@@ -334,7 +334,7 @@ link_xcoff_files file_names library_file_names application_file_name font_info h
= ((False,["Too many TOC-entries: "+++toString end_toc_offset]),files5);
| not ok
= ((False,["Link error"]),files5);
# (ok2,files6) = create_application_resource application_file_name add_carb_resource /* RWS ... */ application_existed /* ... RWS */ font_info heap_size heap_size_multiple stack_size flags
# (ok2,files6) = create_application_resource application_file_name (if add_carb_resource Carbon Classic) /* RWS ... */ application_existed /* ... RWS */ font_info heap_size heap_size_multiple stack_size flags
(pef_application_size+extra_application_memory) initial_heap_size memory_profile_minimum_heap_size files5;
| not ok2
= ((False,["Link error"]),files6);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment