--- libecb/ecb.pod 2012/05/28 08:40:25 1.41 +++ libecb/ecb.pod 2012/06/28 14:50:01 1.49 @@ -60,12 +60,62 @@ ecb.h makes sure that the following types are defined (in the expected way): - int8_t uint8_t int16_t uint16_t - int32_t uint32_t int64_t uint64_t - intptr_t uintptr_t + int8_t uint8_t int16_t uint16_t + int32_t uint32_t int64_t uint64_t + intptr_t uintptr_t The macro C is defined to the size of a pointer on this -platform (currently C<4> or C<8>). +platform (currently C<4> or C<8>) and can be used in preprocessor +expressions. + +For C and C use C. + +=head2 LANGUAGE/COMPILER VERSIONS + +All the following symbols expand to an expression that can be tested in +preprocessor instructions as well as treated as a boolean (use C to +ensure it's either C<0> or C<1> if you need that). + +=over 4 + +=item ECB_C + +True if the implementation defines the C<__STDC__> macro to a true value, +which is typically true for both C and C++ compilers. + +=item ECB_C99 + +True if the implementation claims to be compliant to C99 (ISO/IEC +9899:1999) or any later version. + +Note that later versions (ECB_C11) remove core features again (for +example, variable length arrays). + +=item ECB_C11 + +True if the implementation claims to be compliant to C11 (ISO/IEC +9899:2011) or any later version. + +=item ECB_CPP + +True if the implementation defines the C<__cplusplus__> macro to a true +value, which is typically true for C++ compilers. + +=item ECB_CPP11 + +True if the implementation claims to be compliant to ISO/IEC 14882:2011 +(C++11) or any later version. + +=item ECB_GCC_VERSION(major,minor) + +Expands to a true value (suitable for testing in by the preprocessor) +if the compiler used is GNU C and the version is the given version, or +higher. + +This macro tries to return false on compilers that claim to be GCC +compatible but aren't. + +=back =head2 GCC ATTRIBUTES @@ -583,4 +633,28 @@ =back +=head2 SYMBOLS GOVERNING COMPILATION OF ECB.H ITSELF + +These symbols need to be defined before including F the first time. + +=over 4 + +=item ECB_NO_THRADS + +If F is never used from multiple threads, then this symbol can +be defined, in which case memory fences (and similar constructs) are +completely removed, leading to more efficient code and fewer dependencies. + +Setting this symbol to a true value implies C. + +=item ECB_NO_SMP + +The weaker version of C - if F is used from +multiple threads, but never concurrently (e.g. if the system the program +runs on has only a single CPU with a single core, no hyperthreading and so +on), then this symbol can be defined, leading to more efficient code and +fewer dependencies. + +=back +