1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-08 15:29:37 +00:00

Added enum for cc65 exit codes. replaced stdlib exit code names constants in libsrc with cc65 exit code named constants

This commit is contained in:
mc78 2019-11-12 13:08:33 +01:00 committed by Oliver Schmidt
parent 7bae9038cf
commit 3daecfb3dd
7 changed files with 15 additions and 7 deletions

View File

@ -36,6 +36,12 @@
#ifndef _CC65_H
#define _CC65_H
typedef enum {
CC65_EXIT_SUCCESS,
CC65_EXIT_FAILURE,
CC65_EXIT_AFAILED,
CC65_EXIT_ABORT
} cc65_exit_codes_t;
/*****************************************************************************/

View File

@ -17,5 +17,5 @@ void __fastcall__ _afailed (char* file, unsigned line)
{
raise (SIGABRT);
fprintf (stderr, "ASSERTION FAILED IN %s(%u)\n", file, line);
exit (2);
exit (CC65_EXIT_AFAILED);
}

View File

@ -16,7 +16,7 @@ void abort (void)
{
raise (SIGABRT);
fputs ("ABNORMAL PROGRAM TERMINATION\n", stderr);
exit (3);
exit (CC65_EXIT_ABORT);
}

View File

@ -1580,7 +1580,7 @@ void DbgEntry (void)
case 'q':
/* Quit program */
clrscr ();
exit (1);
exit (CC65_EXIT_FAILURE);
}
}

View File

@ -5,6 +5,7 @@
#include <dirent.h>
#include <device.h>
#include <dio.h>
#include <cc65.h>
unsigned char info_signature[3] = {3, 21, 63 | 0x80};
@ -69,7 +70,7 @@ static void err_exit(char *operation, unsigned char oserr)
operation);
}
getchar();
exit(EXIT_FAILURE);
exit(CC65_EXIT_FAILURE);
}
@ -342,5 +343,5 @@ int main(int argc, char* argv[])
printf("Convert to '%.*s' successful", dir_entry->storage_length.name_length,
dir_entry->file_name);
getchar();
return EXIT_SUCCESS;
return CC65_EXIT_SUCCESS;
}

View File

@ -28,5 +28,5 @@ void _afailed (char* file, unsigned line)
DlgBoxOk(CBOLDON "ASSERTION FAILED", "PROGRAM TERMINATED" CPLAINTEXT);
exit (2);
exit (CC65_EXIT_AFAILED);
}

View File

@ -6,10 +6,11 @@
#include <stdlib.h>
#include <geos.h>
#include <cc65.h>
void abort (void)
{
ExitTurbo();
DlgBoxOk(CBOLDON "ABNORMAL PROGRAM", "TERMINATION." CPLAINTEXT);
exit(3);
exit(CC65_EXIT_ABORT);
}