Skip to content

Commit f76c7f6

Browse files
EricCarrGHtschak909
authored andcommitted
Fix CoCo build. Improve CMOC bool portability.
1 parent d205912 commit f76c7f6

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

coco/src/fn_fuji/fuji_error.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include <dw.h>
55
#include <fujinet-fuji-coco.h>
66

7-
bool fuji_error()
7+
bool fuji_error(void)
88
{
99
return bus_error(OP_FUJI) == BUS_SUCCESS;
1010
}

coco/src/fn_fuji/fuji_set_device_filename.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@ bool fuji_set_device_filename(uint8_t mode, uint8_t hs, uint8_t ds, char *buffer
2626
bus_ready();
2727
dwwrite((uint8_t *)&sdf, sizeof(sdf));
2828

29-
return fuji_error(OP_FUJI) == BUS_SUCCESS;
29+
return fuji_error() == BUS_SUCCESS;
3030
}

fujinet-fuji.h

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,17 @@
66
// In general, bools return the "success" status, so true is good, false is bad.
77

88
#ifdef _CMOC_VERSION_
9-
#include <cmoc.h>
9+
#include <cmoc.h>
10+
11+
// Implement <stdbool.h> for CMOC.
12+
// Follow the standard "ifndef _STDBOOL_H" check in case the project already does this.
13+
#ifndef _STDBOOL_H
14+
#define _STDBOOL_H
1015
typedef unsigned char bool;
11-
#define true 1
12-
#define false 0
16+
#define true 1
17+
#define false 0
18+
#endif
19+
1320
#else
1421
#include <stddef.h>
1522
#include <stdbool.h>
@@ -43,7 +50,7 @@ typedef unsigned char bool;
4350
#ifdef __CBM__
4451
#define MAX_PASSWORD_LEN 65
4552
#else
46-
#define MAX_PASSWORD_LEN 64
53+
#define MAX_PASSWORD_LEN 64
4754
#endif
4855

4956
#define FUJICMD_RESET 0xFF

0 commit comments

Comments
 (0)