ascii-chat 0.11.33
Video chat in your terminal
Loading...
Searching...
No Matches
stdbool.h File Reference

ClangTool/LibTooling compatibility shim for stdbool.h. More...

Go to the source code of this file.

Macros

#define __bool_true_false_are_defined   1
 
#define bool   _Bool
 
#define true   1
 
#define false   0
 

Detailed Description

ClangTool/LibTooling compatibility shim for stdbool.h.

Provides a workaround for a LibTooling bug that prevents use of the standard clang stdbool.h header. This compatibility shim provides the same interface without using the problematic __has_include_next preprocessor operator.

Problem Statement

Clang's LibTooling (used by ascii-instr-panic for code instrumentation) has a bug where __has_include_next errors instead of returning false when a next header doesn't exist. This causes the standard clang stdbool.h to fail on macOS and other platforms, breaking instrumentation on any code that includes stdbool.h.

Solution

This header provides a simplified stdbool.h implementation that:

  • Defines bool, true, and false for C standards before C23
  • Handles C++98 and C++11+ compatibility
  • Avoids all problematic preprocessor checks
  • Maintains compatibility with the standard stdbool.h interface

Usage

This header is automatically injected into the include path when using ascii-instr-panic for instrumentation. No explicit includes are needed.

Scope

Works with:

  • C99, C11, C17, C23 (and later standards)
  • C++98, C++11, C++14, C++17, C++20, C++23 (and later standards)
  • GCC, Clang, and other C-compatible compilers
  • macOS, Linux, Windows, and other platforms

Definition in file stdbool.h.

Macro Definition Documentation

◆ __bool_true_false_are_defined

#define __bool_true_false_are_defined   1

Definition at line 56 of file stdbool.h.

◆ bool

#define bool   _Bool

Definition at line 61 of file stdbool.h.

◆ false

#define false   0

Definition at line 63 of file stdbool.h.

◆ true

#define true   1

Definition at line 62 of file stdbool.h.