Changeset 3e6a98c5 in mainline for uspace/lib/c/include/stdbool.h


Ignore:
Timestamp:
2012-11-30T19:26:36Z (11 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0fa34dd
Parents:
e80d8f8
Message:

Standards-compliant boolean type.

File:
1 moved

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/include/stdbool.h

    re80d8f8 r3e6a98c5  
    11/*
    2  * Copyright (c) 2011 Jiri Zarevucky
     2 * Copyright (c) 2006 Martin Decky
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
    29 /** @addtogroup libposix
     29/** @addtogroup libc
    3030 * @{
    3131 */
    32 /** @file Boolean type and values.
     32/** @file
    3333 */
    3434
    35 #ifndef POSIX_STDBOOL_H_
    36 #define POSIX_STDBOOL_H_
     35#ifndef LIBC_BOOL_H_
     36#define LIBC_BOOL_H_
    3737
    38 #ifdef LIBC_BOOL_H_
     38#include <libarch/types.h>
     39#include <abi/bool.h>
    3940
    40 #if (!defined(POSIX_STDIO_H_)) && \
    41     (!defined(POSIX_STDLIB_H_)) && \
    42     (!defined(POSIX_STRING_H_))
    43         #error "You can't include bool.h and stdbool.h at the same time."
     41#define false  0
     42#define true   1
     43
     44#define __bool_true_false_are_defined 1
     45
    4446#endif
    4547
    46 #endif /* LIBC_BOOL_H */
    47 
    48 #define LIBC_BOOL_H_
    49 
    50 #define bool _Bool
    51 #define true 1
    52 #define false 0
    53 #define __bool_true_false_are_defined 1
    54 
    55 #endif /* POSIX_STDBOOL_H_ */
     48/** @}
     49 */
Note: See TracChangeset for help on using the changeset viewer.