several changes

add unit test for buffer
C/C++ mixed compilation with TLS support
(-lgcc_s seems unnecessary now?) but at least with clang or explicit gcc-4.8
plan to pass more info from sender to receiver