mirror of
https://frontier.innolan.net/rainlance/c-ares.git
synced 2025-11-21 20:13:19 +00:00
Check for stdbool.h at configuration stage, and include it if available.
Check for lowercase 'bool' type at configuration stage. If not available provide a suitable replacement with a type definition of 'unsigned char' in setup_once.h Move definitions of TRUE and FALSE to setup_once.h
This commit is contained in:
26
setup_once.h
26
setup_once.h
@ -62,6 +62,10 @@
|
||||
#include <fcntl.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STDBOOL_H
|
||||
#include <stdbool.h>
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Definition of timeval struct for platforms that don't have it.
|
||||
@ -176,6 +180,28 @@ struct timeval {
|
||||
(((unsigned char)x) == '\t'))
|
||||
|
||||
|
||||
/*
|
||||
* Typedef to 'unsigned char' if bool is not an available 'typedefed' type.
|
||||
*/
|
||||
|
||||
#ifndef HAVE_BOOL_T
|
||||
typedef unsigned char bool;
|
||||
#define HAVE_BOOL_T
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Default definition of uppercase TRUE and FALSE.
|
||||
*/
|
||||
|
||||
#ifndef TRUE
|
||||
#define TRUE 1
|
||||
#endif
|
||||
#ifndef FALSE
|
||||
#define FALSE 0
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Typedef to 'int' if sig_atomic_t is not an available 'typedefed' type.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user