[getdns-api] stdbool.h

Willem Toorop willem at nlnetlabs.nl
Wed Nov 20 08:50:25 MST 2013


The current API includes stdbool.h, but has only one prototype that uses
the bool type:

getdns_return_t
getdns_context_create(
  getdns_context_t       *context,
  bool                   set_from_os
);

Why not use int instead of bool and loose the dependency on stdbool.h.
The API would become much more portable. I.e.:

getdns_return_t
getdns_context_create(
  getdns_context_t       *context,
  int                    set_from_os
);

I know from experience because ldns uses bool internal.  It needs quiet
a bit of autoconf magic to provide a safe alternative when it is not
available.  It has caused other problems as well; Struct members being
aligned differently for the library as for programs using the library,
because a difference in compiler options (i.e. is bool 1 byte or more).


More information about the getdns-api mailing list