--- libecb/ecb.pod 2011/12/10 11:58:38 1.39 +++ libecb/ecb.pod 2012/05/29 14:09:49 1.43 @@ -56,6 +56,42 @@ is usually implemented as a macro. Specifically, a "bool" in this manual refers to any kind of boolean value, not a specific type. +=head2 TYPES / TYPE SUPPORT + +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 ptrdiff_t + +The macro C is defined to the size of a pointer on this +platform (currently C<4> or C<8>). + +=head2 LANGUAGE/COMPILER VERSIONS + +=over 4 + +=item ECB_C99 + +Expands to a true value (suitable for testing in by the preprocessor) +if the environment claims to be C99 compliant. + +=item ECB_C11 + +Expands to a true value (suitable for testing in by the preprocessor) +if the environment claims to be C11 compliant. + +=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 givne version, or +higher. + +This macro tries to return false on compilers that claim to be GCC +compatible but aren't. + +=back + =head2 GCC ATTRIBUTES A major part of libecb deals with GCC attributes. These are additional @@ -427,6 +463,14 @@ ecb_ctz32 (3) = 0 ecb_ctz32 (6) = 1 +=item bool ecb_is_pot32 (uint32_t x) + +=item bool ecb_is_pot64 (uint32_t x) + +Return true iff C is a power of two or C. + +For smaller types then C you can safely use C. + =item int ecb_ld32 (uint32_t x) =item int ecb_ld64 (uint64_t x) @@ -564,4 +608,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 +