Skip to content

Commit

Permalink
more MSL linking
Browse files Browse the repository at this point in the history
  • Loading branch information
shibbo committed Oct 29, 2024
1 parent f846d2e commit ad6ebf3
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 21 deletions.
14 changes: 7 additions & 7 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -2783,11 +2783,11 @@ def JSysLib(lib_name: str, objects: List[Object]) -> Dict[str, Any]:
Object(Matching, "MSL_C/FILE_POS.c"),
Object(Matching, "MSL_C/float.c"),
Object(NonMatching, "MSL_C/locale.c"),
Object(NonMatching, "MSL_C/mbstring.c"),
Object(NonMatching, "MSL_C/mem.c"),
Object(NonMatching, "MSL_C/mem_funcs.c"),
Object(NonMatching, "MSL_C/math_api.c"),
Object(NonMatching, "MSL_C/misc_io.c"),
Object(Matching, "MSL_C/mbstring.c"),
Object(Matching, "MSL_C/mem.c"),
Object(Matching, "MSL_C/mem_funcs.c"),
Object(Matching, "MSL_C/math_api.c"),
Object(Matching, "MSL_C/misc_io.c"),
Object(NonMatching, "MSL_C/printf.c"),
Object(NonMatching, "MSL_C/scanf.c"),
Object(Matching, "MSL_C/signal.c"),
Expand All @@ -2798,8 +2798,8 @@ def JSysLib(lib_name: str, objects: List[Object]) -> Dict[str, Any]:
Object(NonMatching, "MSL_C/wprintf.c"),
Object(Matching, "MSL_C/wstring.c"),
Object(Matching, "MSL_C/wchar_io.c"),
Object(NonMatching, "MSL_C/uart_console_io_gcn.c"),
Object(NonMatching, "MSL_C/abort_exit_ppc_eabi.c"),
Object(Matching, "MSL_C/uart_console_io_gcn.c"),
Object(Matching, "MSL_C/abort_exit_ppc_eabi.c"),
Object(Matching, "MSL_C/math_sun.c"),
Object(Matching, "MSL_C/extras.c"),
Object(Matching, "MSL_C/MSL_Common_Embedded/Math/Double_precision/e_acos.c"),
Expand Down
3 changes: 2 additions & 1 deletion src/MSL_C/abort_exit_ppc_eabi.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <cstdlib>
#pragma exceptions on

int raise(int);
int exit(int);
Expand All @@ -10,4 +11,4 @@ void abort(void) {
raise(1);
__aborting = 1;
exit(1);
}
}
3 changes: 2 additions & 1 deletion src/MSL_C/math_api.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "math_api.h"
#pragma exceptions on

int __fpclassifyf(float f) {
int val = (*(int*)&f);
Expand Down Expand Up @@ -52,4 +53,4 @@ int __fpclassifyd(double dbl) {
}

return 4;
}
}
3 changes: 2 additions & 1 deletion src/MSL_C/mbstring.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "mbstring.h"
#include "locale.h"
#include <cstring>
#pragma exceptions on

int mbtowc(wchar_t *pDest, const char *s, size_t num) {
return _current_locale.ctype_cmpt_ptr->decode_mb(pDest, s, num);
Expand Down Expand Up @@ -106,4 +107,4 @@ size_t wcstombs(char *pSrc, const wchar_t *pwcs, size_t n) {
}

return chars_written;
}
}
3 changes: 2 additions & 1 deletion src/MSL_C/mem.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include <cstring>
#include "mem_funcs.h"
#include "string_api.h"
#pragma exceptions on

void* memmove(void *pDest, const void *pSource, size_t num) {
const char* cur;
Expand Down Expand Up @@ -79,4 +80,4 @@ int memcmp(const void *pSource1, const void *pSource2, size_t num) {
}

return 0;
}
}
3 changes: 2 additions & 1 deletion src/MSL_C/printf.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <cstdlib>
#include "ansi_fp.h"
#include "wchar_io.h"
#pragma exceptions on

#define LDBL_MANT_DIG 24
#define LDBL_MAX_EXP 128
Expand Down Expand Up @@ -1381,4 +1382,4 @@ int sprintf(char *s, const char *format, ...) {
va_list args;
va_start(args, format);
return vsnprintf(s, 0xFFFFFFFF, format, args);
}
}
3 changes: 2 additions & 1 deletion src/MSL_C/scanf.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "va_list.h"
#include <cctype>
#include <cmath>
#pragma exceptions on

enum argument_options {
normal_argument,
Expand Down Expand Up @@ -804,4 +805,4 @@ int sscanf(const char *s, const char *pFormat, ...) {
va_list args;
va_start(args, pFormat);
return vsscanf(s, pFormat, args);
}
}
3 changes: 2 additions & 1 deletion src/MSL_C/strtold.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <cctype>
#include <cmath>
#include "mem.h"
#pragma exceptions on

extern double nan(const char *);
extern double __dec2num(const decimal *);
Expand Down Expand Up @@ -624,4 +625,4 @@ long double __strtold(int max_width, int (*ReadProc)(void *, int, int), void* Re

return result;
}
}
}
9 changes: 3 additions & 6 deletions src/MSL_C/uart_console_io_gcn.c
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#include "size_t.h"
#include "UART.h"
#include <revolution.h>
#pragma exceptions on

int __TRK_write_console(unsigned long, unsigned char *, size_t *, void *);

typedef void (* __idle_proc) (void);

UARTError __init_uart_console(void) {
static UARTError __init_uart_console(void) {
UARTError err = kUARTNoError;
static int initialized = 0;

Expand All @@ -19,11 +20,7 @@ UARTError __init_uart_console(void) {
}

return err;
}

/* this is somewhere else */
int __read_console(unsigned long handle, unsigned char *buffer, size_t *count, __idle_proc) {
return 0;
}

int __write_console(unsigned long handle, unsigned char *buffer, size_t *count, void *ref) {
Expand All @@ -44,4 +41,4 @@ int __write_console(unsigned long handle, unsigned char *buffer, size_t *count,

int __close_console(unsigned long handle) {
return 0;
}
}
3 changes: 2 additions & 1 deletion src/MSL_C/wprintf.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "wmem.h"
#include "wstring.h"
#include "va_list.h"
#pragma exceptions on

#define LDBL_MANT_DIG 24
#define LDBL_MAX_EXP 128
Expand Down Expand Up @@ -1364,4 +1365,4 @@ int vswprintf(wchar_t *s, size_t n, const wchar_t *format, va_list arg) {
}

return count;
}
}

0 comments on commit ad6ebf3

Please sign in to comment.