REBOL3 tracker
  0.9.12 beta
Ticket #0001726 User: anonymous

Project:



rss
TypeBug Statusbuilt Date28-Oct-2010 03:31
Versionalpha 109 CategoryHost-Kit Submitted byssolie
PlatformAll Severityminor Prioritynormal

Summary BOOL type conflicts
Description The BOOL type is currently defined in reb-c.h with an #ifdef protecting it.

With AmigaOS, the BOOL type is typedef'd so the preprocessor protection is bypassed. The AmigaOS BOOL type is a short while the REBOL BOOL type is an int which subsequently causes problems.

I would like to suggest we eliminate the BOOL type in REBOL altogether and instead use the ISO C99 bool (_Bool) type defined in stdbool.h. Each platform should define stdbool.h in their optimal manner.

For those platforms without a stdbool.h we could provide a default implementation which again uses the int type as a default.

For that matter, the width specific types such as i16, u32, etc. could also be replaced by stdint.h.

The idea here is that ISO C99 has a bit more weight behind it than say the AmigaOS standard or the REBOL standard and thus has a better chance of fewer conflicts on the myriad of platforms REBOL could be on.
Example code

			

Assigned ton/a Fixed inalpha 110 Last Update1-Nov-2010 01:45


Comments
(0002697)
Carl
29-Oct-2010 01:36

There's a bit of history on this one and bool has shifted in its definition over the span of R3's implementation. The problem is that of abstract vs concrete datatypes, something that always get's us in trouble in C.

Anyway, I think we can solve this. I'm not sure if C99 is the ideal solution, but we can investigate it and we should try to get this nailed down sooner rather than later.
(0002718)
Carl
1-Nov-2010 01:45

Not all compilers support it. Therefore we've added:

#define HAS_BOOL

to the AMIGA section in reb-config.h.

This assumes it is available on all Amiga platforms.

Date User Field Action Change
1-Nov-2010 01:45 carl Comment : 0002718 Added -
1-Nov-2010 01:42 carl Fixedin Modified => alpha 110
1-Nov-2010 01:42 carl Status Modified reviewed => built
29-Oct-2010 01:36 carl Comment : 0002697 Modified -
29-Oct-2010 01:36 carl Comment : 0002697 Added -
29-Oct-2010 01:22 carl Description Modified -
29-Oct-2010 01:22 carl Status Modified submitted => reviewed
28-Oct-2010 03:31 ssolie Ticket Added -