From 4d670146b4054e11e90227f96a3a1c66410e8d0b Mon Sep 17 00:00:00 2001 From: Ash Wolf Date: Thu, 19 Jan 2023 13:00:09 +0000 Subject: more cross-platform work --- compiler_and_linker/unsorted/CCompiler.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'compiler_and_linker/unsorted/CCompiler.c') diff --git a/compiler_and_linker/unsorted/CCompiler.c b/compiler_and_linker/unsorted/CCompiler.c index 06d518f..1eb6cd0 100644 --- a/compiler_and_linker/unsorted/CCompiler.c +++ b/compiler_and_linker/unsorted/CCompiler.c @@ -23,8 +23,13 @@ static void get_extension(ConstStringPtr src, char *dst) { if (ep >= 2) { int x; - for (x = 0; (x + ep) <= src[0]; x++) + for (x = 0; (x + ep) <= src[0]; x++) { +#ifdef CW_CLT dst[x] = src[x + ep]; +#else + dst[x] = tolower(src[x + ep]); +#endif + } dst[x] = 0; } } @@ -71,7 +76,7 @@ static int setup_param_block(CWPluginContext context) { cparams.targetOS = tinfo.targetOS; cparams.targetCPU = tinfo.targetCPU; cparams.idetargetname = target_name; - return CWGetTargetName(context, target_name, sizeof(target_name)) == cwNoErr; + return CWGetTargetName(context, cparams.idetargetname, sizeof(target_name)) == cwNoErr; } static short store_compile_results(void) { @@ -231,7 +236,8 @@ CWPLUGIN_ENTRY(MWC_main)(CWPluginContext context) { CodeGen_InitBackEndOptions(); CodeGen_UpdateOptimizerOptions(); CodeGen_UpdateBackEndOptions(); - if (C_Compiler(&cparams)) + result = C_Compiler(&cparams); + if (result != noErr) result = store_compile_results(); else result = cwErrRequestFailed; -- cgit v1.2.3