diff options
| author | Mattias Andrée <m@maandree.se> | 2026-06-01 19:07:14 +0200 |
|---|---|---|
| committer | Mattias Andrée <m@maandree.se> | 2026-06-01 19:07:14 +0200 |
| commit | 77ade8d20906fe9ca2cf6788ff1e1437e0912868 (patch) | |
| tree | 61495e90e057bf792bb1d8ce157cef0ecc2ab696 /libnormalform_literal_sort_cmp__.c | |
| parent | First commit (diff) | |
| download | libnormalform-master.tar.gz libnormalform-master.tar.bz2 libnormalform-master.tar.xz | |
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to 'libnormalform_literal_sort_cmp__.c')
| -rw-r--r-- | libnormalform_literal_sort_cmp__.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/libnormalform_literal_sort_cmp__.c b/libnormalform_literal_sort_cmp__.c new file mode 100644 index 0000000..c0b8937 --- /dev/null +++ b/libnormalform_literal_sort_cmp__.c @@ -0,0 +1,33 @@ +/* See LICENSE file for copyright and license details. */ +#include "common.h" +#ifndef TEST + + +int +(libnormalform_literal_sort_cmp__)(const void *a, const void *b) +{ + struct expression *const *ap = a, *const *bp = b; + return libnormalform_literal_cmp__(*ap, *bp); +} + + +#else + + +#if defined(__GNUC__) /* TODO remove when testing is implemented in libnormalform_literal_sort_cmp__.c */ +# pragma GCC diagnostic ignored "-Wunused-function" +# pragma GCC diagnostic ignored "-Wunused-macros" +#endif + +#define libnormalform_literal_cmp__(...) cmptrampoline(__VA_ARGS__) + +PURE static int +cmptrampoline(struct expression *a, struct expression *b) +{ + return libnormalform_literal_sort_cmp__(&a, &b); +} + +#include "libnormalform_literal_cmp__.c" + + +#endif |
