Skip to content

Commit cf9dbcc

Browse files
committed
Match MSL runtime units
1 parent 2bda80e commit cf9dbcc

76 files changed

Lines changed: 5589 additions & 3345 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

configure.py

Lines changed: 130 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,32 @@
249249
"-inline auto",
250250
]
251251

252+
cflags_msl_gc13_runtime = [
253+
*cflags_base,
254+
"-use_lmw_stmw on",
255+
"-str reuse,pool,readonly",
256+
"-common off",
257+
"-inline deferred,auto",
258+
"-char signed",
259+
"-lang=c",
260+
]
261+
262+
cflags_msl_runtime_c = [
263+
*cflags_base,
264+
"-use_lmw_stmw on",
265+
"-str reuse,pool,readonly",
266+
"-common off",
267+
"-inline deferred,auto",
268+
"-fp_contract off",
269+
"-char signed",
270+
"-lang=c",
271+
]
272+
273+
cflags_msl_runtime_cpp = [
274+
*cflags_runtime,
275+
"-lang=c++",
276+
]
277+
252278
# dolphin library flags
253279
cflags_dolphin = [
254280
*cflags_base,
@@ -841,66 +867,96 @@ def MatchingFor(*versions):
841867
"Runtime.PPCEABI.H",
842868
[],
843869
[
844-
Object(NonMatching, "Runtime/__mem.c", extra_cflags=["-inline on, deferred"]),
870+
Object(Matching, "Runtime/__mem.c"),
845871
Object(Matching, "Runtime/__va_arg.c"),
846-
Object(NonMatching, "Runtime/global_destructor_chain.c"),
847-
Object(NonMatching, "Runtime/New.cp"),
848-
Object(NonMatching, "Runtime/NMWException.cp"),
872+
Object(Matching, "Runtime/global_destructor_chain.c"),
873+
Object(
874+
Matching,
875+
"Runtime/New.cp",
876+
mw_version="GC/2.6",
877+
cflags=[
878+
flag
879+
for flag in cflags_runtime
880+
if flag not in ("-RTTI off", "-Cpp_exceptions off", "-inline auto", "-str reuse,pool,readonly")
881+
]
882+
+ ["-Cpp_exceptions on", "-RTTI on", "-inline auto,deferred", "-str reuse,nopool,readonly"],
883+
),
884+
Object(
885+
Matching,
886+
"Runtime/NMWException.cp",
887+
mw_version="GC/2.0p1",
888+
cflags=[
889+
flag
890+
for flag in cflags_runtime
891+
if flag not in ("-RTTI off", "-Cpp_exceptions off")
892+
]
893+
+ ["-Cpp_exceptions on", "-RTTI on", "-inline auto,deferred"],
894+
),
849895
Object(Matching, "Runtime/CPlusLibPPC.cp"),
850-
Object(NonMatching, "Runtime/ptmf.c"),
851-
Object(NonMatching, "Runtime/runtime.c"),
852-
Object(NonMatching, "Runtime/__init_cpp_exceptions.cpp"),
853-
Object(NonMatching, "Runtime/Gecko_ExceptionPPC.cp"),
854-
Object(NonMatching, "Runtime/GCN_mem_alloc.c"),
896+
Object(Matching, "Runtime/ptmf.c"),
897+
Object(Matching, "Runtime/runtime.c"),
898+
Object(Matching, "Runtime/__init_cpp_exceptions.cpp"),
899+
Object(
900+
Matching,
901+
"Runtime/Gecko_ExceptionPPC.cp",
902+
cflags=[
903+
flag
904+
for flag in cflags_runtime
905+
if flag not in ("-RTTI off", "-Cpp_exceptions off", "-str reuse,pool,readonly")
906+
]
907+
+ ["-Cpp_exceptions on", "-RTTI on", "-str reuse,nopool,readonly"],
908+
extab_padding=[0x02, 0x55],
909+
),
910+
Object(Matching, "Runtime/GCN_mem_alloc.c", extra_cflags=["-str reuse,nopool,readonly"]),
855911
]
856912
),
857913
mslLib(
858914
"MSL_C.PPCEABI.H",
859915
["-str pool", "-opt level=0, peephole, schedule, nospace", "-inline off", "-sym on"],
860916
[
861-
Object(NonMatching, "MSL_C/PPC_EABI/abort_exit.c"),
862-
Object(NonMatching, "MSL_C/MSL_Common/alloc.c"),
863-
Object(NonMatching, "MSL_C/MSL_Common/ansi_files.c"),
864-
Object(NonMatching, "MSL_C/MSL_Common_Embedded/ansi_fp.c"),
865-
Object(NonMatching, "MSL_C/MSL_Common/arith.c"),
866-
Object(NonMatching, "MSL_C/MSL_Common/bsearch.c"),
867-
Object(NonMatching, "MSL_C/MSL_Common/buffer_io.c"),
917+
Object(Matching, "MSL_C/PPC_EABI/abort_exit.c", cflags=cflags_runtime),
918+
Object(Matching, "MSL_C/MSL_Common/alloc.c", cflags=cflags_msl_runtime_c),
919+
Object(Matching, "MSL_C/MSL_Common/ansi_files.c", mw_version="GC/1.3", cflags=cflags_msl_gc13_runtime),
920+
Object(Matching, "MSL_C/MSL_Common_Embedded/ansi_fp.c", cflags=cflags_msl_runtime_c),
921+
Object(Matching, "MSL_C/MSL_Common/arith.c", cflags=cflags_runtime),
922+
Object(Matching, "MSL_C/MSL_Common/bsearch.c"),
923+
Object(Matching, "MSL_C/MSL_Common/buffer_io.c", cflags=cflags_runtime),
868924
Object(Matching, "MSL_C/PPC_EABI/critical_regions.gamecube.c"),
869-
Object(NonMatching, "MSL_C/MSL_Common/ctype.c"),
870-
Object(NonMatching, "MSL_C/MSL_Common/direct_io.c"),
925+
Object(Matching, "MSL_C/MSL_Common/ctype.c", cflags=cflags_runtime),
926+
Object(Matching, "MSL_C/MSL_Common/direct_io.c", cflags=cflags_runtime),
871927
Object(Matching, "MSL_C/MSL_Common/errno.c"),
872-
Object(NonMatching, "MSL_C/MSL_Common/file_io.c"),
873-
Object(NonMatching, "MSL_C/MSL_Common/FILE_POS.C"),
874-
Object(NonMatching, "MSL_C/MSL_Common/locale.c"),
875-
Object(NonMatching, "MSL_C/MSL_Common/mbstring.c"),
876-
Object(NonMatching, "MSL_C/MSL_Common/mem.c"),
877-
Object(NonMatching, "MSL_C/MSL_Common/mem_funcs.c"),
878-
Object(NonMatching, "MSL_C/MSL_Common/misc_io.c"),
879-
Object(NonMatching, "MSL_C/MSL_Common/printf.c"),
880-
Object(NonMatching, "MSL_C/MSL_Common/qsort.c"),
881-
Object(NonMatching, "MSL_C/MSL_Common/rand.c"),
882-
Object(NonMatching, "MSL_C/MSL_Common/scanf.c"),
883-
Object(NonMatching, "MSL_C/MSL_Common/signal.c"),
884-
Object(NonMatching, "MSL_C/MSL_Common/string.c"),
885-
Object(NonMatching, "MSL_C/MSL_Common/strtold.c"),
886-
Object(NonMatching, "MSL_C/MSL_Common/strtoul.c"),
887-
Object(NonMatching, "MSL_C/MSL_Common/float.c"),
888-
Object(NonMatching, "MSL_C/MSL_Common/char_io.c"),
889-
Object(NonMatching, "MSL_C/MSL_Common/wchar_io.c"),
890-
Object(NonMatching, "MSL_C/MSL_Common_Embedded/uart_console_io_gcn.c")
928+
Object(Matching, "MSL_C/MSL_Common/file_io.c", cflags=cflags_msl_runtime_c + ["-D_MSL_WIDE_CHAR"]),
929+
Object(Matching, "MSL_C/MSL_Common/FILE_POS.C", cflags=cflags_msl_runtime_cpp),
930+
Object(Matching, "MSL_C/MSL_Common/locale.c"),
931+
Object(Matching, "MSL_C/MSL_Common/mbstring.c", mw_version="GC/1.3", cflags=cflags_msl_gc13_runtime),
932+
Object(Matching, "MSL_C/MSL_Common/mem.c", mw_version="GC/1.3", cflags=cflags_msl_gc13_runtime),
933+
Object(Matching, "MSL_C/MSL_Common/mem_funcs.c", cflags=cflags_runtime),
934+
Object(Matching, "MSL_C/MSL_Common/misc_io.c", cflags=cflags_runtime),
935+
Object(Matching, "MSL_C/MSL_Common/printf.c", mw_version="GC/2.0p1", cflags=cflags_msl_runtime_c),
936+
Object(Matching, "MSL_C/MSL_Common/qsort.c", cflags=cflags_msl_runtime_c),
937+
Object(Matching, "MSL_C/MSL_Common/rand.c", cflags=cflags_runtime),
938+
Object(Matching, "MSL_C/MSL_Common/scanf.c", cflags=cflags_runtime + ["-inline deferred"]),
939+
Object(Matching, "MSL_C/MSL_Common/signal.c", cflags=cflags_msl_gc13_runtime),
940+
Object(Matching, "MSL_C/MSL_Common/string.c", cflags=cflags_runtime),
941+
Object(Matching, "MSL_C/MSL_Common/strtold.c", cflags=cflags_msl_runtime_c),
942+
Object(Matching, "MSL_C/MSL_Common/strtoul.c", cflags=cflags_runtime),
943+
Object(Matching, "MSL_C/MSL_Common/float.c"),
944+
Object(Matching, "MSL_C/MSL_Common/char_io.c", cflags=cflags_runtime),
945+
Object(Matching, "MSL_C/MSL_Common/wchar_io.c", cflags=cflags_runtime),
946+
Object(Matching, "MSL_C/MSL_Common_Embedded/uart_console_io_gcn.c", cflags=cflags_runtime)
891947
]
892948
),
893949
mslLib(
894950
"fdlibm.PPCEABI.H",
895951
[],
896952
[
897-
Object(NonMatching, "MSL_C/MSL_Common_Embedded/Math/Double_precision/e_acos.c"),
898-
Object(NonMatching, "MSL_C/MSL_Common_Embedded/Math/Double_precision/e_asin.c"),
953+
Object(Matching, "MSL_C/MSL_Common_Embedded/Math/Double_precision/e_acos.c"),
954+
Object(Matching, "MSL_C/MSL_Common_Embedded/Math/Double_precision/e_asin.c"),
899955
Object(Matching, "MSL_C/MSL_Common_Embedded/Math/Double_precision/e_atan2.c"),
900956
Object(Matching, "MSL_C/MSL_Common_Embedded/Math/Double_precision/e_exp.c"),
901957
Object(Matching, "MSL_C/MSL_Common_Embedded/Math/Double_precision/e_fmod.c"),
902958
Object(Matching, "MSL_C/MSL_Common_Embedded/Math/Double_precision/e_log.c"),
903-
Object(NonMatching, "MSL_C/MSL_Common_Embedded/Math/Double_precision/e_pow.c"),
959+
Object(Matching, "MSL_C/MSL_Common_Embedded/Math/Double_precision/e_pow.c"),
904960
Object(Matching, "MSL_C/MSL_Common_Embedded/Math/Double_precision/e_rem_pio2.c"),
905961
Object(Matching, "MSL_C/MSL_Common_Embedded/Math/Double_precision/k_cos.c"),
906962
Object(Matching, "MSL_C/MSL_Common_Embedded/Math/Double_precision/k_rem_pio2.c"),
@@ -923,52 +979,57 @@ def MatchingFor(*versions):
923979
Object(Matching, "MSL_C/MSL_Common_Embedded/Math/Double_precision/w_fmod.c"),
924980
Object(Matching, "MSL_C/MSL_Common_Embedded/Math/Double_precision/w_log.c"),
925981
Object(Matching, "MSL_C/MSL_Common_Embedded/Math/Double_precision/w_pow.c"),
926-
Object(NonMatching, "MSL_C/PPC_EABI/math_ppc.c"),
982+
Object(Matching, "MSL_C/PPC_EABI/math_ppc.c"),
927983
]
928984
),
929985
trkLib(
930986
"TRK_MINNOW_DOLPHIN",
931987
[
932-
Object(NonMatching, "debugger/embedded/MetroTRK/Portable/mainloop.c"),
933-
Object(NonMatching, "debugger/embedded/MetroTRK/Portable/nubevent.c"),
934-
Object(NonMatching, "debugger/embedded/MetroTRK/Portable/nubassrt.c"),
935-
Object(NonMatching, "debugger/embedded/MetroTRK/Portable/nubinit.c"),
936-
Object(NonMatching, "debugger/embedded/MetroTRK/Portable/msg.c"),
937-
Object(NonMatching, "debugger/embedded/MetroTRK/Portable/msgbuf.c"),
938-
Object(NonMatching, "debugger/embedded/MetroTRK/Portable/serpoll.c"),
939-
Object(NonMatching, "debugger/embedded/MetroTRK/Portable/dispatch.c"),
940-
Object(NonMatching, "debugger/embedded/MetroTRK/Portable/msghndlr.c"),
941-
Object(NonMatching, "debugger/embedded/MetroTRK/Portable/support.c"),
988+
Object(Matching, "debugger/embedded/MetroTRK/Portable/mainloop.c"),
989+
Object(Matching, "debugger/embedded/MetroTRK/Portable/nubevent.c"),
990+
Object(Matching, "debugger/embedded/MetroTRK/Portable/nubassrt.c"),
991+
Object(Matching, "debugger/embedded/MetroTRK/Portable/nubinit.c", extra_cflags=["-sdata 0", "-sdata2 0"]),
992+
Object(Matching, "debugger/embedded/MetroTRK/Portable/msg.c", mw_version="GC/1.3", cflags=cflags_trk),
993+
Object(Matching, "debugger/embedded/MetroTRK/Portable/msgbuf.c", mw_version="GC/1.3", cflags=cflags_trk),
994+
Object(Matching, "debugger/embedded/MetroTRK/Portable/serpoll.c", extra_cflags=["-sdata 0", "-sdata2 0"]),
995+
Object(Matching, "debugger/embedded/MetroTRK/Portable/dispatch.c", extra_cflags=["-sdata 0", "-sdata2 0"]),
996+
Object(Matching, "debugger/embedded/MetroTRK/Portable/msghndlr.c", mw_version="GC/2.6", cflags=cflags_trk),
997+
Object(Matching, "debugger/embedded/MetroTRK/Portable/support.c"),
942998
Object(Matching, "debugger/embedded/MetroTRK/Portable/mutex_TRK.c"),
943-
Object(NonMatching, "debugger/embedded/MetroTRK/Portable/notify.c"),
944-
Object(NonMatching, "debugger/embedded/MetroTRK/Portable/main_TRK.c"),
945-
Object(NonMatching, "debugger/embedded/MetroTRK/Portable/mem_TRK.c"),
946-
Object(NonMatching, "debugger/embedded/MetroTRK/Portable/string_TRK.c"),
999+
Object(Matching, "debugger/embedded/MetroTRK/Portable/notify.c"),
1000+
Object(Matching, "debugger/embedded/MetroTRK/Portable/main_TRK.c", extra_cflags=["-sdata 0", "-sdata2 0"]),
1001+
Object(Matching, "debugger/embedded/MetroTRK/Portable/mem_TRK.c"),
1002+
Object(Matching, "debugger/embedded/MetroTRK/Portable/string_TRK.c"),
9471003
Object(Matching, "debugger/embedded/MetroTRK/Processor/ppc/Generic/flush_cache.c"),
948-
Object(NonMatching, "debugger/embedded/MetroTRK/Processor/ppc/Generic/__exception.s"),
949-
Object(NonMatching, "debugger/embedded/MetroTRK/Processor/ppc/Generic/targimpl.c"),
1004+
Object(Matching, "debugger/embedded/MetroTRK/Processor/ppc/Generic/__exception.s"),
1005+
Object(Matching, "debugger/embedded/MetroTRK/Processor/ppc/Generic/targimpl.c", mw_version="GC/2.6", cflags=[*cflags_trk, "-gccinc", "-common off"]),
9501006
Object(Matching, "debugger/embedded/MetroTRK/Processor/ppc/Export/targsupp.s"),
9511007
Object(Matching, "debugger/embedded/MetroTRK/Processor/ppc/Generic/mpc_7xx_603e.c"),
952-
Object(NonMatching, "debugger/embedded/MetroTRK/Os/dolphin/dolphin_trk.c"),
953-
Object(NonMatching, "debugger/embedded/MetroTRK/Os/dolphin/usr_put.c"),
954-
Object(NonMatching, "debugger/embedded/MetroTRK/Os/dolphin/dolphin_trk_glue.c"),
1008+
Object(Matching, "debugger/embedded/MetroTRK/Os/dolphin/dolphin_trk.c", mw_version="GC/2.6", cflags=cflags_trk),
1009+
Object(Matching, "debugger/embedded/MetroTRK/Os/dolphin/usr_put.c"),
1010+
Object(Matching, "debugger/embedded/MetroTRK/Os/dolphin/dolphin_trk_glue.c", mw_version="GC/2.6", cflags=cflags_trk),
9551011
Object(Matching, "debugger/embedded/MetroTRK/Os/dolphin/targcont.c"),
956-
Object(NonMatching, "debugger/embedded/MetroTRK/Os/dolphin/target_options.c"),
957-
Object(NonMatching, "debugger/embedded/MetroTRK/Os/dolphin/UDP_Stubs.c"),
958-
Object(NonMatching, "debugger/embedded/MetroTRK/Export/mslsupp.c"),
1012+
Object(Matching, "debugger/embedded/MetroTRK/Os/dolphin/target_options.c", extra_cflags=["-sdata 0", "-sdata2 0"]),
1013+
Object(Matching, "debugger/embedded/MetroTRK/Os/dolphin/UDP_Stubs.c"),
1014+
Object(
1015+
Matching,
1016+
"debugger/embedded/MetroTRK/Export/mslsupp.c",
1017+
mw_version="GC/2.6",
1018+
cflags=cflags_trk,
1019+
),
9591020

960-
Object(NonMatching, "gamedev/cust_connection/cc/exi2/GCN/EXI2_DDH_GCN/main.c"),
961-
Object(NonMatching, "gamedev/cust_connection/utils/common/CircleBuffer.c"),
962-
Object(NonMatching, "gamedev/cust_connection/cc/exi2/GCN/EXI2_GDEV_GCN/main.c"),
963-
Object(NonMatching, "gamedev/cust_connection/utils/common/MWTrace.c"),
964-
Object(NonMatching, "gamedev/cust_connection/utils/gc/MWCriticalSection_gc.cpp"),
1021+
Object(Matching, "gamedev/cust_connection/cc/exi2/GCN/EXI2_DDH_GCN/main.c"),
1022+
Object(Matching, "gamedev/cust_connection/utils/common/CircleBuffer.c"),
1023+
Object(Matching, "gamedev/cust_connection/cc/exi2/GCN/EXI2_GDEV_GCN/main.c"),
1024+
Object(Matching, "gamedev/cust_connection/utils/common/MWTrace.c"),
1025+
Object(Matching, "gamedev/cust_connection/utils/gc/MWCriticalSection_gc.cpp"),
9651026
]
9661027
),
9671028
mslLib(
9681029
"MSL_C.PPCEABI.bare.H",
9691030
[],
9701031
[
971-
Object(NonMatching, "MSL_C/MSL_Common/extras.c")
1032+
Object(Matching, "MSL_C/MSL_Common/extras.c")
9721033
]
9731034
),
9741035
RenderWareLib(

src/PowerPC_EABI_Support/include/PowerPC_EABI_Support/MSL_C/MSL_Common/FILE_POS.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ extern "C" {
1111
int fseek(FILE *stream, fpos_t offset, int whence);
1212
int _fseek(FILE *stream, fpos_t offset, int whence);
1313
int ftell(FILE *stream);
14-
int _ftell(FILE *stream);
14+
fpos_t _ftell(FILE *stream);
1515

1616
#ifdef __cplusplus
1717
};

src/PowerPC_EABI_Support/include/PowerPC_EABI_Support/MSL_C/MSL_Common/file_io.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
#include "types.h"
55
#include "PowerPC_EABI_Support/MSL_C/MSL_Common/ansi_files.h"
66

7+
FILE* fopen(const char* filename, const char* mode);
78
int fclose(FILE* file);
89
int fflush(FILE* file);
10+
int __get_file_modes(const char* mode, file_modes* modes);
911

1012
#endif

src/PowerPC_EABI_Support/include/PowerPC_EABI_Support/MSL_C/MSL_Common/math_api.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ MATH_INLINE int __fpclassifyf(f32 x)
6060
return 4;
6161
}
6262

63+
#ifndef MATH_API_SKIP_FPCLASSIFYD
6364
MATH_INLINE int __fpclassifyd(f64 x)
6465
{
6566
switch (__HI(x) & 0x7ff00000)
@@ -83,6 +84,7 @@ MATH_INLINE int __fpclassifyd(f64 x)
8384
}
8485
return 4;
8586
}
87+
#endif
8688

8789
#define fpclassify(x) \
8890
((sizeof(x) == sizeof(float)) ? __fpclassifyf((float)(x)) : __fpclassifyd((double)(x)))
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
#ifndef _MSL_MATH_API_H
22
#define _MSL_MATH_API_H
33

4+
#include "PowerPC_EABI_Support/MSL_C/MSL_Common/ansi_files.h"
5+
46
extern void (*__stdio_exit)(void);
57

8+
void clearerr(FILE* stream);
69
void __stdio_atexit();
710

811
#endif

src/PowerPC_EABI_Support/include/PowerPC_EABI_Support/MSL_C/MSL_Common/printf.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include "PowerPC_EABI_Support/MSL_C/MSL_Common/file_struc.h"
66
#include "PowerPC_EABI_Support/MSL_C/MSL_Common/ansi_files.h"
77

8-
void printf(const char*, ...);
8+
int printf(const char*, ...);
99
// printf_s
1010
int fprintf(FILE*, const char* format, ...);
1111
// fprintf_s
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#ifndef METROTRK_PORTABLE_MEM_TRK_H
2+
#define METROTRK_PORTABLE_MEM_TRK_H
3+
4+
#include "dolphin/types.h"
5+
6+
#ifdef __cplusplus
7+
extern "C" {
8+
#endif
9+
10+
void* TRK_memset(void* dst, int val, size_t n);
11+
void* TRK_memcpy(void* dst, const void* src, size_t n);
12+
13+
#ifdef __cplusplus
14+
}
15+
#endif
16+
17+
#endif

src/PowerPC_EABI_Support/include/PowerPC_EABI_Support/MetroTRK/trk.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,6 @@ void MWTRACE(u8, char*, ...);
166166

167167
//////// SUPPORT FUNCTIONS /////////
168168
DSError TRKRequestSend();
169-
u32 TRKAccessFile(u32, u32, u32*, u8*);
170169
////////////////////////////////////
171170

172171
///// SERIAL POLLING FUNCTIONS /////

src/PowerPC_EABI_Support/include/PowerPC_EABI_Support/Runtime/NMWException.h

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#define _NMWEXCEPTION
33

44
#include "types.h"
5-
#include "exception" //#include <exception>
5+
#include "PowerPC_EABI_Support/Runtime/exception.h"
66

77
#ifdef __cplusplus
88
extern "C" {
@@ -20,12 +20,22 @@ typedef struct CatchInfo {
2020
void* stacktop;
2121
} CatchInfo;
2222

23+
typedef struct DestructorChain {
24+
struct DestructorChain* next;
25+
void* destructor;
26+
void* object;
27+
} DestructorChain;
28+
29+
struct __eti_init_info;
30+
2331
void __unregister_fragment(int fragmentID);
24-
// struct __eti_init_info* info
25-
int __register_fragment(void* info, char* TOC);
32+
int __register_fragment(struct __eti_init_info* info, char* TOC);
2633
void* __register_global_object(void* object, void* destructor, void* regmem);
2734
void __destroy_global_chain(void);
2835
extern char __throw_catch_compare(const char* throwtype, const char* catchtype, s32* offset_result);
36+
extern void __end__catch(CatchInfo* catchinfo);
37+
extern void __throw(char* throwtype, void* location, void* dtor);
38+
extern void __unexpected(CatchInfo* catchinfo);
2939

3040
#ifdef __cplusplus
3141
}
Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
1-
#ifndef RUNTIME_MEM_H
2-
#define RUNTIME_MEM_H
3-
#include "macros.h"
4-
#include "types.h"
1+
#ifndef _RUNTIME_MEM_H
2+
#define _RUNTIME_MEM_H
3+
4+
#include "stddef.h"
5+
56
#ifdef __cplusplus
67
extern "C" {
78
#endif
89

9-
DECL_SECTION(".init") void* memcpy(void* dest, const void* src, size_t n);
10-
DECL_SECTION(".init") void __fill_mem(void* dest, int val, size_t count);
11-
DECL_SECTION(".init") void* memset(void* dest, int val, size_t count);
10+
__declspec(section ".init") void* memset(void* dest, int val, size_t count);
11+
__declspec(section ".init") void __fill_mem(void* dest, int val, size_t count);
12+
__declspec(section ".init") void* memcpy(void* dest, const void* src, size_t n);
1213

1314
#ifdef __cplusplus
1415
}
1516
#endif
17+
1618
#endif

0 commit comments

Comments
 (0)