1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/internal/stdbool.h
卜部昌平 8184adabe5 internal/stdbool.h rework
Noticed that internal/stdbool.h and addr2line.c are the only two place
where missing/stdbool.h is included.  Why not delete the file so that
we can merge internal/stdbool.h and missing/stdbool.h into one.
2019-12-26 20:45:12 +09:00

34 lines
991 B
C

#ifndef INTERNAL_STDBOOL_H /* -*- C -*- */
#define INTERNAL_STDBOOL_H
/**
* @file
* @brief Thin wrapper to <stdbool.h>
* @author \@shyouhei
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to either redistribute and/or
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
*/
#include "ruby/config.h" /* for HAVE_STDBOOL_H */
#ifdef HAVE_STDBOOL_H
# include <stdbool.h>
#endif
/* Note that we assume the compiler isn't C++. */
#ifdef __bool_true_false_are_defined
# undef bool
# undef true
# undef false
# undef __bool_true_false_are_defined
#else
typedef unsigned char _Bool;
#endif
/* See also http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2229.htm */
#define bool _Bool
#define true ((_Bool)+1)
#define false ((_Bool)+0)
#define __bool_true_false_are_defined
#endif /* INTERNAL_STDBOOL_H */