mirror of
https://github.com/cc65/cc65.git
synced 2025-08-15 06:27:36 +00:00
Allow numeric OS types in the config file
git-svn-id: svn://svn.cc65.org/cc65/trunk@3386 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -967,7 +967,13 @@ static void ParseO65 (void)
|
|||||||
case CFGTOK_OS:
|
case CFGTOK_OS:
|
||||||
/* Cannot use this attribute twice */
|
/* Cannot use this attribute twice */
|
||||||
FlagAttr (&AttrFlags, atOS, "OS");
|
FlagAttr (&AttrFlags, atOS, "OS");
|
||||||
/* Get the operating system */
|
/* Get the operating system. It may be specified as name or
|
||||||
|
* as a number in the range 1..255.
|
||||||
|
*/
|
||||||
|
if (CfgTok == CFGTOK_INTCON) {
|
||||||
|
CfgRangeCheck (O65OS_MIN, O65OS_MAX);
|
||||||
|
OS = (unsigned) CfgIVal;
|
||||||
|
} else {
|
||||||
CfgSpecialToken (OperatingSystems, ENTRY_COUNT (OperatingSystems), "OS type");
|
CfgSpecialToken (OperatingSystems, ENTRY_COUNT (OperatingSystems), "OS type");
|
||||||
switch (CfgTok) {
|
switch (CfgTok) {
|
||||||
case CFGTOK_LUNIX: OS = O65OS_LUNIX; break;
|
case CFGTOK_LUNIX: OS = O65OS_LUNIX; break;
|
||||||
@@ -975,6 +981,7 @@ static void ParseO65 (void)
|
|||||||
case CFGTOK_CC65: OS = O65OS_CC65; break;
|
case CFGTOK_CC65: OS = O65OS_CC65; break;
|
||||||
default: CfgError ("Unexpected OS token");
|
default: CfgError ("Unexpected OS token");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CFGTOK_ID:
|
case CFGTOK_ID:
|
||||||
@@ -1010,8 +1017,8 @@ static void ParseO65 (void)
|
|||||||
|
|
||||||
/* Check for attributes that may not be combined */
|
/* Check for attributes that may not be combined */
|
||||||
if (OS == O65OS_CC65) {
|
if (OS == O65OS_CC65) {
|
||||||
if ((AttrFlags & (atImport | atExport)) != 0) {
|
if ((AttrFlags & (atImport | atExport)) != 0 && ModuleId < 0x8000) {
|
||||||
CfgError ("OS type CC65 may not have imports or exports");
|
CfgError ("OS type CC65 may not have imports or exports for ids < $8000");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (AttrFlags & atID) {
|
if (AttrFlags & atID) {
|
||||||
|
@@ -6,7 +6,7 @@
|
|||||||
/* */
|
/* */
|
||||||
/* */
|
/* */
|
||||||
/* */
|
/* */
|
||||||
/* (C) 1999-2003 Ullrich von Bassewitz */
|
/* (C) 1999-2005 Ullrich von Bassewitz */
|
||||||
/* R<>merstrasse 52 */
|
/* R<>merstrasse 52 */
|
||||||
/* D-70794 Filderstadt */
|
/* D-70794 Filderstadt */
|
||||||
/* EMail: uz@cc65.org */
|
/* EMail: uz@cc65.org */
|
||||||
@@ -62,9 +62,11 @@ typedef struct O65Desc O65Desc;
|
|||||||
#define O65OPT_TIMESTAMP 4
|
#define O65OPT_TIMESTAMP 4
|
||||||
|
|
||||||
/* Operating system codes for O65OPT_OS */
|
/* Operating system codes for O65OPT_OS */
|
||||||
|
#define O65OS_MIN 1
|
||||||
#define O65OS_OSA65 1
|
#define O65OS_OSA65 1
|
||||||
#define O65OS_LUNIX 2
|
#define O65OS_LUNIX 2
|
||||||
#define O65OS_CC65 3
|
#define O65OS_CC65 3
|
||||||
|
#define O65OS_MAX 255
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user