Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed bool type for c89 #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

damon-kwok
Copy link

Before c99 doesn't have _Bool‘ and STDC_VERSION'. Compensate.

#ifndef __STDC_VERSION__
#define __STDC_VERSION__ 0
#endif
#if defined(_MSC_VER) || (__STDC_VERSION__ < 199901L)
/* `MSVC' and `Before c99' doesn't have <stdbool.h>. Compensate. */
typedef char bool;
#define true (bool) 1
#define false (bool) 0
#else
#include <stdbool.h>
#endif

@barracuda156
Copy link

This may not be correct in general case. Darwin ppc ABI has 4-byte bool, for example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants