#ifdef SORT_INT64
typedef u64 P(hash_t);
#define SORT_INT SORT_INT64
+#define SORT_LONG_HASH
#else
typedef uns P(hash_t);
#endif
}
#endif
+#if defined(SORT_HASH_BITS) || defined(SORT_INT)
+#define SORT_INTERNAL_RADIX
+#include "lib/sorter/s-radix.h"
+#endif
+
#if defined(SORT_VAR_KEY) || defined(SORT_VAR_DATA) || defined(SORT_UNIFY_WORKSPACE)
#include "lib/sorter/s-internal.h"
#else
#endif
#include "lib/sorter/s-twoway.h"
-
-#if defined(SORT_HASH_BITS) || defined(SORT_INT)
-#include "lib/sorter/s-radix.h"
-#endif
+#include "lib/sorter/s-multiway.h"
static struct fastbuf *P(sort)(
#ifdef SORT_INPUT_FILE
ctx.internal_sort = P(internal);
ctx.internal_estimate = P(internal_estimate);
ctx.twoway_merge = P(twoway_merge);
+ ctx.multiway_merge = P(multiway_merge);
sorter_run(&ctx);
return ctx.out_fb;
}
-#undef SORT_PREFIX
-#undef SORT_KEY
-#undef SORT_KEY_REGULAR
-#undef SORT_KEY_SIZE
+#undef SORT_ASSERT_UNIQUE
#undef SORT_DATA_SIZE
-#undef SORT_VAR_KEY
-#undef SORT_VAR_DATA
-#undef SORT_INT
-#undef SORT_INT64
+#undef SORT_DELETE_INPUT
#undef SORT_HASH_BITS
-#undef SORT_UNIFY
-#undef SORT_UNIFY_WORKSPACE
-#undef SORT_INPUT_FILE
#undef SORT_INPUT_FB
+#undef SORT_INPUT_FILE
+#undef SORT_INPUT_PIPE
#undef SORT_INPUT_PRESORT
-#undef SORT_OUTPUT_FILE
+#undef SORT_INT
+#undef SORT_INT64
+#undef SORT_INTERNAL_RADIX
+#undef SORT_KEY
+#undef SORT_KEY_REGULAR
+#undef SORT_KEY_SIZE
+#undef SORT_LONG_HASH
#undef SORT_OUTPUT_FB
+#undef SORT_OUTPUT_FILE
#undef SORT_OUTPUT_THIS_FB
+#undef SORT_PREFIX
+#undef SORT_UNIFY
+#undef SORT_UNIFY_WORKSPACE
#undef SORT_UNIQUE
-#undef SORT_ASSERT_UNIQUE
-#undef SORT_DELETE_INPUT
+#undef SORT_VAR_DATA
+#undef SORT_VAR_KEY
#undef SWAP
#undef LESS
#undef P
-/* FIXME: Check that we undef everything we should. */