/* */
/* */
/* */
-/* (C) 2000-2013, Ullrich von Bassewitz */
+/* (C) 2000-2015, Ullrich von Bassewitz */
/* Roemerstrasse 52 */
/* D-70794 Filderstadt */
/* EMail: uz@cc65.org */
"\n"
"Long options:\n"
" --add-source\t\t\tInclude source as comment\n"
+ " --all-cdecl\t\t\tMake functions default to __cdecl__\n"
" --bss-name seg\t\tSet the name of the BSS segment\n"
" --check-stack\t\t\tGenerate stack overflow checks\n"
" --code-name seg\t\tSet the name of the CODE segment\n"
AbEnd ("Cannot use `module' as a target for the compiler");
break;
+ case TGT_ATARI5200:
+ DefineNumericMacro ("__ATARI5200__", 1);
+ break;
+
case TGT_ATARI:
DefineNumericMacro ("__ATARI__", 1);
break;
DefineNumericMacro ("__APPLE2ENH__", 1);
break;
+ case TGT_GAMATE:
+ DefineNumericMacro ("__GAMATE__", 1);
+ break;
+
case TGT_GEOS_CBM:
/* Do not handle as a CBM system */
DefineNumericMacro ("__GEOS__", 1);
DefineNumericMacro ("__ATMOS__", 1);
break;
+ case TGT_TELESTRAT:
+ DefineNumericMacro ("__TELESTRAT__", 1);
+ break;
+
case TGT_NES:
DefineNumericMacro ("__NES__", 1);
break;
DefineNumericMacro ("__SIM65C02__", 1);
break;
- case TGT_C1P:
+ case TGT_OSIC1P:
DefineNumericMacro ("__OSIC1P__", 1);
break;
+ case TGT_PCENGINE:
+ DefineNumericMacro ("__PCE__", 1);
+ break;
+
default:
AbEnd ("Unknown target system type %d", Target);
}
DefineNumericMacro (Def, 1);
} else {
/* We have a value, P points to the '=' character. Since the argument
- * is const, create a copy and replace the '=' in the copy by a zero
- * terminator.
- */
+ ** is const, create a copy and replace the '=' in the copy by a zero
+ ** terminator.
+ */
char* Q;
unsigned Len = strlen (Def)+1;
char* S = (char*) xmalloc (Len);
+static void OptAllCDecl (const char* Opt attribute ((unused)),
+ const char* Arg attribute ((unused)))
+/* Make functions default to cdecl instead of fastcall. */
+{
+ AutoCDecl = 1;
+}
+
+
+
static void OptBssName (const char* Opt attribute ((unused)), const char* Arg)
/* Handle the --bss-name option */
{
}
/* Read line by line, ignore empty lines and switch optimization
- * steps on/off.
- */
+ ** steps on/off.
+ */
while (fgets (Buf, sizeof (Buf), F) != 0) {
/* Remove trailing control chars. This will also remove the
- * trailing newline.
- */
+ ** trailing newline.
+ */
unsigned Len = strlen (Buf);
while (Len > 0 && IsControl (Buf[Len-1])) {
--Len;
}
/* Check the first character and enable/disable the step or
- * ignore the line
- */
+ ** ignore the line
+ */
switch (*Line) {
case '\0':
}
/* Close the file, no error check here since we were just reading and
- * this is only a debug function.
- */
+ ** this is only a debug function.
+ */
(void) fclose (F);
}
const char* Arg attribute ((unused)))
/* Print the compiler version */
{
- fprintf (stderr, "cc65 V%s\n", GetVersionAsString ());
+ fprintf (stderr, "%s V%s\n", ProgName, GetVersionAsString ());
exit (EXIT_SUCCESS);
}
/* Program long options */
static const LongOpt OptTab[] = {
{ "--add-source", 0, OptAddSource },
+ { "--all-cdecl", 0, OptAllCDecl },
{ "--bss-name", 1, OptBssName },
{ "--check-stack", 0, OptCheckStack },
{ "--code-name", 1, OptCodeName },
/* Return an apropriate exit code */
return (ErrorCount > 0)? EXIT_FAILURE : EXIT_SUCCESS;
}
-
-
-