-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathboolean.h
More file actions
41 lines (38 loc) · 1 KB
/
Copy pathboolean.h
File metadata and controls
41 lines (38 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/** @file boolean.h
* @brief Custom Boolean type for C (portable & self-contained)
* @author ByteBard
* @copyright MIT
*
* Note: Win32 API provides its own BOOL type. This header is not intended for use in Win32 API programming.
*/
#ifndef CLIBS_BOOLEAN_H
#define CLIBS_BOOLEAN_H
/* Custom boolean type. */
#ifndef _WINDOWS_
#ifdef __cplusplus
#ifndef _BOOL_IS_DEFINED
typedef bool BOOL;
#define FALSE false
#define TRUE true
#define _BOOL_IS_DEFINED
#endif
#else
#if __STDC_VERSION__ < 199901L
#ifndef _BOOL_IS_DEFINED
typedef char BOOL;
#define FALSE 0
#define TRUE 1
#define _BOOL_IS_DEFINED
#endif
#else
#ifndef _BOOL_IS_DEFINED
#include <stdbool.h>
typedef bool BOOL;
#define FALSE false
#define TRUE true
#define _BOOL_IS_DEFINED
#endif
#endif
#endif
#endif
#endif /* CLIBS_BOOLEAN_H */