summaryrefslogtreecommitdiff
path: root/compiler_and_linker/unsorted/CCompiler.c
diff options
context:
space:
mode:
authorAsh Wolf <ninji@wuffs.org>2023-01-19 13:00:09 +0000
committerAsh Wolf <ninji@wuffs.org>2023-01-19 13:00:09 +0000
commit4d670146b4054e11e90227f96a3a1c66410e8d0b (patch)
tree8dca31cf9ee497ee59e833f48dd76c81aaef3cf5 /compiler_and_linker/unsorted/CCompiler.c
parent5d0bbb19cc133753cebda7099e46d4b2084336c6 (diff)
downloadMWCC-4d670146b4054e11e90227f96a3a1c66410e8d0b.tar.gz
MWCC-4d670146b4054e11e90227f96a3a1c66410e8d0b.zip
more cross-platform work
Diffstat (limited to 'compiler_and_linker/unsorted/CCompiler.c')
-rw-r--r--compiler_and_linker/unsorted/CCompiler.c12
1 files changed, 9 insertions, 3 deletions
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;