summaryrefslogtreecommitdiff
path: root/h/sort.h
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2016-10-02 19:25:17 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2016-10-02 19:25:17 +0200
commitc2ca7be5a751879159f3cb591a64bb9568b79762 (patch)
tree04e38d4f4a2aad4d789bda0a65b7abb80a3439a2 /h/sort.h
parent45c152c326d87478fbf41714b4b8e2f7b57a282b (diff)
parent3db384424bd7398ffbb7a355cab8f15f3add009f (diff)
Updated version 1.9.1+repack from 'upstream/1.9.1+repack'
with Debian dir 98a996367aa69ae41accf9c6d369f600bc94de80
Diffstat (limited to 'h/sort.h')
-rw-r--r--h/sort.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/h/sort.h b/h/sort.h
index 98bee8f..8440425 100644
--- a/h/sort.h
+++ b/h/sort.h
@@ -1,4 +1,6 @@
+#ifndef SORT_H
+
/*
* Copyright 1996 - 2010 Graeme W. Gill
* All rights reserved.
@@ -7,13 +9,17 @@
* see the License2.txt file for licencing details.
*/
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
/*
* Heapsort macro - sort smallest to largest.
* Heapsort is guaranteed nlogn, doesn't need any
* extra storage, but often isn't as fast as quicksort.
*/
-/* Need to #define HEAP_COMPARE(A,B) so it returns true if A < B */
+/* To sort ascenting, need to #define HEAP_COMPARE(A,B) so it returns true if A < B */
/* Note that A will be ARRAY[a], and B will be ARRAY[b] where a and b are indexes. */
/* TYPE should be the type of each entry of the ARRAY */
#define HEAPSORT(TYPE,ARRAY,NUMBER) \
@@ -60,3 +66,9 @@
} \
}
+#ifdef __cplusplus
+ }
+#endif
+
+#define SORT_H
+#endif /* SORT_H */