From fab14f78542ca040cc1606dbd33a4db6aea5976a Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 22 Mar 2022 01:13:28 +0100 Subject: Fix build when using WITH_TBB=OFF after recent changes And wrap tbb::parallel_sort in blender namespace similar to other TBB functionality. --- source/blender/blenlib/BLI_sort.hh | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 source/blender/blenlib/BLI_sort.hh (limited to 'source/blender/blenlib/BLI_sort.hh') diff --git a/source/blender/blenlib/BLI_sort.hh b/source/blender/blenlib/BLI_sort.hh new file mode 100644 index 00000000000..411e6a0c4df --- /dev/null +++ b/source/blender/blenlib/BLI_sort.hh @@ -0,0 +1,32 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#pragma once + +/** \file + * \ingroup bli + */ + +#ifdef WITH_TBB +# include +#else +# include +#endif + +namespace blender { + +#ifdef WITH_TBB +using tbb::parallel_sort; +#else +template +void parallel_sort(RandomAccessIterator begin, RandomAccessIterator end) +{ + std::sort(begin, end); +} +template +void parallel_sort(RandomAccessIterator begin, RandomAccessIterator end, const Compare &comp) +{ + std::sort(begin, end, comp); +} +#endif + +} // namespace blender -- cgit v1.2.3