Replaced enum in cc65.h by defines. added comment that cc65 exit constants should not redefine 0 and 1 as they are reserved for exit_success and exit_failure

This commit is contained in:
mc78
2019-11-15 16:35:58 +01:00
committed by Oliver Schmidt
parent 694dd9240f
commit 16a66f19e1
3 changed files with 10 additions and 10 deletions

View File

@@ -36,12 +36,13 @@
#ifndef _CC65_H #ifndef _CC65_H
#define _CC65_H #define _CC65_H
typedef enum {
CC65_EXIT_SUCCESS, /* Those cc65 exit constants definitions are in addition the the
CC65_EXIT_FAILURE, constants defined in stdlib.h. The values 0 and 1 are still
CC65_EXIT_AFAILED, reserved for EXIT_SUCCESS and EXIT_FAILURE and should not be
CC65_EXIT_ABORT redefined */
} cc65_exit_codes_t; #define CC65_EXIT_AFAILED 2
#define CC65_EXIT_ABORT 3
/*****************************************************************************/ /*****************************************************************************/

View File

@@ -14,7 +14,6 @@
#include <ctype.h> #include <ctype.h>
#include <6502.h> #include <6502.h>
#include <dbg.h> #include <dbg.h>
#include <cc65.h>
/*****************************************************************************/ /*****************************************************************************/
@@ -1583,7 +1582,7 @@ void DbgEntry (void)
/* Exit intentionally with error because one may /* Exit intentionally with error because one may
say that DbgEntry is always abnormal. */ say that DbgEntry is always abnormal. */
exit (CC65_EXIT_FAILURE); exit (EXIT_FAILURE);
} }
} }

View File

@@ -70,7 +70,7 @@ static void err_exit(char *operation, unsigned char oserr)
operation); operation);
} }
getchar(); getchar();
exit(CC65_EXIT_FAILURE); exit(EXIT_FAILURE);
} }
@@ -343,5 +343,5 @@ int main(int argc, char* argv[])
printf("Convert to '%.*s' successful", dir_entry->storage_length.name_length, printf("Convert to '%.*s' successful", dir_entry->storage_length.name_length,
dir_entry->file_name); dir_entry->file_name);
getchar(); getchar();
return CC65_EXIT_SUCCESS; return EXIT_SUCCESS;
} }