D
dr.oktopus
Hi,
I am developing a little library and I would like to develop it so
that it will be conforming both to the old and the new (c99) standard.
I have a function returning a boolean value, so I think that something
like:
file.h:
#if __STDC_VERSION__ >= 199901L
#include <stdbool.h>
#else
#define bool int
#endif
/* rest of the header */
bool my_func (void);
file.c:
#if __STDC_VERSION__ >= 199901L
#define false 0
#define true (!false)
#endif
should be. But bool could be defined even in user code.
What's the proper way to handle this kind of things?
I am developing a little library and I would like to develop it so
that it will be conforming both to the old and the new (c99) standard.
I have a function returning a boolean value, so I think that something
like:
file.h:
#if __STDC_VERSION__ >= 199901L
#include <stdbool.h>
#else
#define bool int
#endif
/* rest of the header */
bool my_func (void);
file.c:
#if __STDC_VERSION__ >= 199901L
#define false 0
#define true (!false)
#endif
should be. But bool could be defined even in user code.
What's the proper way to handle this kind of things?