Skip to content

Convert _Bool to boolean #6

Open
@rversteegen

Description

@rversteegen

To my surprise, on examing the assembly/C, I realise that a boolean is stored as a value of either 0 or 1 in a byte, and is converted to/from 0/-1 when converting to/from a numerical type. This appears to mean it is exactly the same as C's _Bool (or bool with stdbool.h).

Therefore, why doesn't fbfrog convert _Bool to boolean? The fact that it instead translates to 'byte' breaks code such as while not WindowShouldClose() (function returning a bool) from the raylib examples and all previous translations of those examples and headers into FB, so I feel I have no choice but to edit my new translation of raylib.bi to use boolean.

Boolean was only added in 2015, so I guess it was just never implemented.
I'm currently working on this, and have come across no problems so far.
The only concern is whether there's any case where this would break code using existing headers, if the headers are regenerated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions