ProjectSection(SolutionItems) = preProject\r
..\..\..\test\include\cds_test\check_size.h = ..\..\..\test\include\cds_test\check_size.h\r
..\..\..\test\include\cds_test\city.h = ..\..\..\test\include\cds_test\city.h\r
+ ..\..\..\test\include\cds_test\ext_byteswap.h = ..\..\..\test\include\cds_test\ext_byteswap.h\r
+ ..\..\..\test\include\cds_test\ext_gtest.h = ..\..\..\test\include\cds_test\ext_gtest.h\r
..\..\..\test\include\cds_test\fc_hevy_value.h = ..\..\..\test\include\cds_test\fc_hevy_value.h\r
..\..\..\test\include\cds_test\fixture.h = ..\..\..\test\include\cds_test\fixture.h\r
..\..\..\test\include\cds_test\hash_func.h = ..\..\..\test\include\cds_test\hash_func.h\r
ProjectSection(SolutionItems) = preProject
..\..\..\test\include\cds_test\check_size.h = ..\..\..\test\include\cds_test\check_size.h
..\..\..\test\include\cds_test\city.h = ..\..\..\test\include\cds_test\city.h
+ ..\..\..\test\include\cds_test\ext_byteswap.h = ..\..\..\test\include\cds_test\ext_byteswap.h
..\..\..\test\include\cds_test\ext_gtest.h = ..\..\..\test\include\cds_test\ext_gtest.h
..\..\..\test\include\cds_test\fc_hevy_value.h = ..\..\..\test\include\cds_test\fc_hevy_value.h
..\..\..\test\include\cds_test\fixture.h = ..\..\..\test\include\cds_test\fixture.h
if(GTEST_INSTANTIATE_TEST_CASE_P_HAS_4TH_ARG)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DGTEST_LANG_CXX11 -DCDSTEST_GTEST_INSTANTIATE_TEST_CASE_P_HAS_4TH_ARG")
endif()
+
+# Check if there is byteswap.h (needed for cityhash)
+CHECK_CXX_SOURCE_COMPILES("
+#include <byteswap.h>
+int main( int argc, char **argv )
+{
+ return 0;
+}
+" CDSTEST_HAVE_BYTESWAP_H )
+
+if(CDSTEST_HAVE_BYTESWAP_H)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DCDSTEST_HAVE_BYTESWAP_H")
+endif()
+
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/unit)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/stress)
--- /dev/null
+/*
+ This file is a part of libcds - Concurrent Data Structures library
+
+ (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2017
+
+ Source code repo: http://github.com/khizmax/libcds/
+ Download: http://sourceforge.net/projects/libcds/files/
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef CDSTEST_BYTESWAP_H
+#define CDSTEST_BYTESWAP_H
+
+#ifdef CDSTEST_HAVE_BYTESWAP_H
+# include <byteswap.h>
+#else
+
+#define bswap_16(value) ((((value) & 0xff) << 8) | ((value) >> 8))
+
+#define bswap_32(value) (((uint32_t)bswap_16((uint16_t)((value) & 0xffff)) << 16) | (uint32_t)bswap_16((uint16_t)((value) >> 16)))
+
+#define bswap_64(value) (((uint64_t)bswap_32((uint32_t)((value) & 0xffffffff)) << 32) | (uint64_t)bswap_32((uint32_t)((value) >> 32)))
+
+#endif
+#endif // CDSTEST_BYTESWAP_H
\ No newline at end of file