Ticket #34570: patch-handy.h.stdbool.diff

File patch-handy.h.stdbool.diff, 1.5 KB (added by BjarneDMat, 12 years ago)

modifed for perl5.16

  • handy.h

    old new  
    7373#ifdef I_STDBOOL
    7474#  include <stdbool.h>
    7575#  ifndef HAS_BOOL
    7676#    define HAS_BOOL 1
    7777#  endif
    7878#endif
    7979
    80 /* bool is built-in for g++-2.6.3 and later, which might be used
    81    for extensions.  <_G_config.h> defines _G_HAVE_BOOL, but we can't
    82    be sure _G_config.h will be included before this file.  _G_config.h
    83    also defines _G_HAVE_BOOL for both gcc and g++, but only g++
    84    actually has bool.  Hence, _G_HAVE_BOOL is pretty useless for us.
    85    g++ can be identified by __GNUG__.
    86    Andy Dougherty       February 2000
    87 */
    88 #ifdef __GNUG__         /* GNU g++ has bool built-in */
    89 #  ifndef HAS_BOOL
    90 #    define HAS_BOOL 1
    91 #  endif
    92 #endif
    93 
    94 /* The NeXT dynamic loader headers will not build with the bool macro
    95    So declare them now to clear confusion.
    96 */
    97 #if defined(NeXT) || defined(__NeXT__)
    98 # undef FALSE
    99 # undef TRUE
    100   typedef enum bool { FALSE = 0, TRUE = 1 } bool;
    101 # define ENUM_BOOL 1
    102 # ifndef HAS_BOOL
    103 #  define HAS_BOOL 1
    104 # endif /* !HAS_BOOL */
    105 #endif /* NeXT || __NeXT__ */
    106 
    107 #ifndef HAS_BOOL
    108 # if defined(UTS) || defined(VMS)
    109 #  define bool int
    110 # else
    111 #  define bool char
    112 # endif
    113 # define HAS_BOOL 1
    114 #endif
     80#define HAS_BOOL 1
     81#include <stdbool.h>
    11582
    11683/* a simple (bool) cast may not do the right thing: if bool is defined
    11784 * as char for example, then the cast from int is implementation-defined
    11885 * (bool)!!(cbool) in a ternary triggers a bug in xlc on AIX
    11986 */