File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change 348348      unaware of any such platform). 
349349
350350      \i tem There is a new function \c ode{asRboolean}, a variannt of 
351-       \c ode{asLogical} more suitable  to converting logical arguments to 
351+       \c ode{asLogical} more suited  to converting logical arguments to 
352352      \c ode{Rboolean}. 
353+ 
354+       \i tem Header \f ile{R_ext/Boolean.h} now ensures a \c ode{bool} type 
355+       is available either as a keyword (C23 and C++) or by including the 
356+       C99 header \f ile{stdbool.h}. 
353357    } 
354358  } 
355359
Original file line number Diff line number Diff line change 2929#undef  FALSE
3030#undef  TRUE
3131
32+ /* Ensuure a 'bool' type is available.  We could use 
33+    __bool_true_false_are_defined,  
34+    but that was declared obsolescent in C23. 
35+ */ 
36+ #if  defined __STDC_VERSION__  &&  __STDC_VERSION__  >  202000L 
37+ // C23 so bool is a keyword 
38+ #elif  defined __cplusplus 
39+ // part of C++ >= 11, which is all R supports. 
40+ #else 
41+ # include  <stdbool.h> 
42+ // stdbool.h is C99, so available everywhere. 
43+ #endif 
44+ 
3245#include  <Rconfig.h>  /* for HAVE_ENUM_BASE_TYPE */ 
3346/* 
3447  Setting the underlying aka base type is supported in C23, C++11  
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments