Cross-platform definition of _byteswap_uint64 and _byteswap_ulong
问题 Visual Studio defines _byteswap_uint64 and _byteswap_ulong in stdlib.h. Am I right to assume, that this is not standard and won't compile on Linux or Darwin? Is there a way to define these includes in a cross-platform way? 回答1: Google's CityHash source code uses this code: https://github.com/google/cityhash/blob/8af9b8c2b889d80c22d6bc26ba0df1afb79a30db/src/city.cc#L50 #ifdef _MSC_VER #include <stdlib.h> #define bswap_32(x) _byteswap_ulong(x) #define bswap_64(x) _byteswap_uint64(x) #elif