Using a #if define to optionally use gcc's intrinsics for thread-safe counting operations.